Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
dune-curvedgrid
Commits
e9a18563
Commit
e9a18563
authored
Apr 06, 2020
by
Praetorius, Simon
Browse files
added static_assert in case of wrong ORDER parameter
parent
ce73bdd6
Changes
3
Hide whitespace changes
Inline
Side-by-side
dune/curvedsurfacegrid/geometry.hh
View file @
e9a18563
...
...
@@ -576,7 +576,7 @@ namespace Dune
protected:
VertexGeometry
(
Construct
,
const
ReferenceElement
&
refElement
,
const
LocalFunction
&
localFunction
,
const
LocalGeometry
&
lg
)
const
LocalGeometry
&
lg
)
:
Super
(
refElement
,
std
::
vector
<
GlobalCoordinate
>
{
localFunction
(
lg
.
global
(
refElement
.
position
(
0
,
0
)))})
{}
...
...
dune/curvedsurfacegrid/gridfamily.hh
View file @
e9a18563
...
...
@@ -65,6 +65,7 @@ namespace Dune
using
LocalFunction
=
std
::
decay_t
<
decltype
(
localFunction
(
std
::
declval
<
GF
const
&>
()))
>
;
static
const
bool
differentiableLocalFunction
=
DifferentiableLocalFunction
<
GF
,
LocalFunction
>::
value
;
static_assert
((
differentiableLocalFunction
||
order
>
0
),
"Either provide a differentiable GridFunction or set ORDER > 0"
);
using
ctype
=
typename
HostGrid
::
ctype
;
...
...
example/example.cc
View file @
e9a18563
...
...
@@ -9,7 +9,6 @@
#include
<dune/common/exceptions.hh>
// We use exceptions
#include
<dune/alugrid/grid.hh>
#include
<dune/curvedsurfacegrid/curvedsurfacegrid.hh>
#include
<dune/curvedsurfacegrid/gridfunctions/analyticgridfunction.hh>
#include
<dune/grid/io/file/gmshreader.hh>
#include
<dune/grid/io/file/vtk/vtkwriter.hh>
#include
<dune/grid/io/file/vtk/subsamplingvtkwriter.hh>
...
...
@@ -46,12 +45,10 @@ int main(int argc, char** argv)
//case1: projection to actual sphere
{
SphereCoordFunction
sphereCF
(
/*center=*/
{
0.0
,
0.0
,
0.0
},
/*radius=*/
1.0
);
auto
sphereGridFct
=
analyticGridFunction
<
HostGridType
>
(
sphereCF
);
using
GridType
=
CurvedSurfaceGrid
<
decltype
(
sphereGridFct
),
ip_order
>
;
GridType
grid
(
*
hostGrid
,
sphereGridFct
);
CurvedSurfaceGrid
grid
(
*
hostGrid
,
sphereCF
,
std
::
integral_constant
<
int
,
ip_order
>
{});
using
G
ridView
=
G
rid
Type
::
L
eafGridView
;
GridView
gridView
=
grid
.
leafG
ridView
(
);
auto
g
ridView
=
g
rid
.
l
eafGridView
()
;
using
GridView
=
decltype
(
g
ridView
);
VTKWriter
<
GridView
>
vtkWriter
(
gridView
);
vtkWriter
.
write
(
"sphere1_real_elements"
);
SubsamplingVTKWriter
<
GridView
>
ssvtkWriter
(
gridView
,
refinementIntervals
(
ip_order
));
...
...
@@ -61,12 +58,10 @@ int main(int argc, char** argv)
//case2: projection to a surface-mesh of a sphere
{
SurfaceDistanceCoordFunction
<>
surfdistCF
(
"example/sphere_fine.vtu"
);
auto
surfaceDistGridFct
=
analyticGridFunction
<
HostGridType
>
(
surfdistCF
);
using
GridType
=
CurvedSurfaceGrid
<
decltype
(
surfaceDistGridFct
),
ip_order
>
;
GridType
grid
(
*
hostGrid
,
surfaceDistGridFct
);
using
GridView
=
GridType
::
LeafGridView
;
GridView
gridView
=
grid
.
leafGridView
();
CurvedSurfaceGrid
grid
(
*
hostGrid
,
std
::
ref
(
surfdistCF
),
std
::
integral_constant
<
int
,
ip_order
>
{});
auto
gridView
=
grid
.
leafGridView
();
using
GridView
=
decltype
(
gridView
);
VTKWriter
<
GridView
>
vtkWriter
(
gridView
);
vtkWriter
.
write
(
"sphere2_real_elements"
);
SubsamplingVTKWriter
<
GridView
>
ssvtkWriter
(
gridView
,
refinementIntervals
(
ip_order
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment