Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-gdt
Commits
363950d9
Commit
363950d9
authored
5 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[spaces.h1] add ContinuousFlatTopSpace
parent
d35338d0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/gdt/spaces/h1/continuous-flattop.hh
+178
-0
178 additions, 0 deletions
dune/gdt/spaces/h1/continuous-flattop.hh
dune/gdt/type_traits.hh
+3
-0
3 additions, 0 deletions
dune/gdt/type_traits.hh
with
181 additions
and
0 deletions
dune/gdt/spaces/h1/continuous-flattop.hh
0 → 100644
+
178
−
0
View file @
363950d9
// This file is part of the dune-gdt project:
// https://github.com/dune-community/dune-gdt
// Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
// with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
// Felix Schindler (2019)
#ifndef DUNE_GDT_SPACES_H1_CONTINUOUS_FLATTOP_HH
#define DUNE_GDT_SPACES_H1_CONTINUOUS_FLATTOP_HH
#include
<memory>
//#include <vector>
//#include <dune/common/typetraits.hh>
//#include <dune/geometry/type.hh>
#include
<dune/grid/common/gridview.hh>
//#include <dune/xt/common/exceptions.hh>
//#include <dune/xt/grid/type_traits.hh>
#include
<dune/gdt/local/finite-elements/flattop.hh>
#include
<dune/gdt/spaces/basis/default.hh>
#include
<dune/gdt/spaces/mapper/continuous.hh>
#include
<dune/gdt/spaces/interface.hh>
namespace
Dune
{
namespace
GDT
{
/**
* \sa make_local_lagrange_finite_element
*/
template
<
class
GV
,
size_t
r
=
1
,
class
R
=
double
>
class
ContinuousFlatTopSpace
:
public
SpaceInterface
<
GV
,
r
,
1
,
R
>
{
using
ThisType
=
ContinuousFlatTopSpace
;
using
BaseType
=
SpaceInterface
<
GV
,
r
,
1
,
R
>
;
public:
using
BaseType
::
d
;
using
typename
BaseType
::
D
;
using
typename
BaseType
::
GlobalBasisType
;
using
typename
BaseType
::
GridViewType
;
using
typename
BaseType
::
LocalFiniteElementFamilyType
;
using
typename
BaseType
::
MapperType
;
private:
using
MapperImplementation
=
ContinuousMapper
<
GridViewType
,
LocalFiniteElementFamilyType
,
r
>
;
using
GlobalBasisImplementation
=
DefaultGlobalBasis
<
GridViewType
,
r
,
1
,
R
>
;
public:
ContinuousFlatTopSpace
(
GridViewType
grd_vw
,
const
int
fe_order
,
const
D
&
overlap
=
0.5
)
:
grid_view_
(
grd_vw
)
,
fe_order_
(
fe_order
)
,
local_finite_elements_
(
std
::
make_unique
<
LocalFlatTopFiniteElementFamily
<
D
,
d
,
R
,
r
>>
(
overlap
))
,
mapper_
(
nullptr
)
,
basis_
(
nullptr
)
{
this
->
update_after_adapt
();
}
ContinuousFlatTopSpace
(
const
ThisType
&
)
=
default
;
ContinuousFlatTopSpace
(
ThisType
&&
)
=
default
;
ThisType
&
operator
=
(
const
ThisType
&
)
=
delete
;
ThisType
&
operator
=
(
ThisType
&&
)
=
delete
;
const
GridViewType
&
grid_view
()
const
override
final
{
return
grid_view_
;
}
const
MapperType
&
mapper
()
const
override
final
{
assert
(
mapper_
&&
"This must not happen!"
);
return
*
mapper_
;
}
const
GlobalBasisType
&
basis
()
const
override
final
{
assert
(
basis_
&&
"This must not happen!"
);
return
*
basis_
;
}
const
LocalFiniteElementFamilyType
&
finite_elements
()
const
override
final
{
return
*
local_finite_elements_
;
}
SpaceType
type
()
const
override
final
{
return
SpaceType
::
continuous_lagrange
;
}
int
min_polorder
()
const
override
final
{
return
fe_order_
;
}
int
max_polorder
()
const
override
final
{
return
fe_order_
+
1
;
}
bool
continuous
(
const
int
diff_order
)
const
override
final
{
return
diff_order
==
0
;
}
bool
continuous_normal_components
()
const
override
final
{
return
true
;
}
bool
is_lagrangian
()
const
override
final
{
return
true
;
}
void
update_after_adapt
()
override
final
{
// check: the mapper does not work for non-conforming intersections
if
(
d
==
3
&&
grid_view_
.
indexSet
().
types
(
0
).
size
()
!=
1
)
DUNE_THROW
(
Exceptions
::
space_error
,
"in ContinuousFlatTopSpace: non-conforming intersections are not (yet) "
"supported, and more than one element type in 3d leads to non-conforming intersections!"
);
// create/update mapper ...
if
(
mapper_
)
mapper_
->
update_after_adapt
();
else
mapper_
=
std
::
make_unique
<
MapperImplementation
>
(
grid_view_
,
*
local_finite_elements_
,
fe_order_
);
// ... and basis
if
(
basis_
)
basis_
->
update_after_adapt
();
else
basis_
=
std
::
make_unique
<
GlobalBasisImplementation
>
(
grid_view_
,
*
local_finite_elements_
,
fe_order_
);
this
->
create_communicator
();
}
// ... update_after_adapt(...)
private
:
const
GridViewType
grid_view_
;
const
int
fe_order_
;
std
::
unique_ptr
<
const
LocalFlatTopFiniteElementFamily
<
D
,
d
,
R
,
r
>>
local_finite_elements_
;
std
::
unique_ptr
<
MapperImplementation
>
mapper_
;
std
::
unique_ptr
<
GlobalBasisImplementation
>
basis_
;
};
// class ContinuousFlatTopSpace
/**
* \sa ContinuousFlatTopSpace
*/
template
<
size_t
r
,
class
GV
,
class
R
=
double
>
ContinuousFlatTopSpace
<
GV
,
r
,
R
>
make_continuous_flattop_space
(
GV
grid_view
,
const
int
order
,
const
double
&
overlap
=
0.5
)
{
return
ContinuousFlatTopSpace
<
GV
,
r
,
R
>
(
grid_view
,
order
,
overlap
);
}
/**
* \sa ContinuousFlatTopSpace
*/
template
<
class
GV
,
class
R
=
double
>
ContinuousFlatTopSpace
<
GV
,
1
,
R
>
make_continuous_flattop_space
(
GV
grid_view
,
const
int
order
,
const
double
&
overlap
=
0.5
)
{
return
ContinuousFlatTopSpace
<
GV
,
1
,
R
>
(
grid_view
,
order
,
overlap
);
}
}
// namespace GDT
}
// namespace Dune
#endif // DUNE_GDT_SPACES_H1_CONTINUOUS_FLATTOP_HH
This diff is collapsed.
Click to expand it.
dune/gdt/type_traits.hh
+
3
−
0
View file @
363950d9
...
...
@@ -23,6 +23,7 @@ namespace GDT {
enum
class
SpaceType
{
continuous_flattop
,
continuous_lagrange
,
discontinuous_lagrange
,
finite_volume
,
...
...
@@ -34,6 +35,8 @@ std::ostream& operator<<(std::ostream& out, const SpaceType& space_type)
{
if
(
space_type
==
SpaceType
::
continuous_lagrange
)
out
<<
"continuous_lagrange"
;
else
if
(
space_type
==
SpaceType
::
continuous_flattop
)
out
<<
"continuous_flattop"
;
else
if
(
space_type
==
SpaceType
::
discontinuous_lagrange
)
out
<<
"discontinuous_lagrange"
;
else
if
(
space_type
==
SpaceType
::
finite_volume
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment