Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
hyteg
hyteg
Commits
36b5ce4d
Commit
36b5ce4d
authored
Apr 07, 2022
by
wagnandr
Browse files
Merge branch 'master' into wagnandr/dg-enriched
parents
b3993b3f
474976d2
Pipeline
#39023
failed with stages
in 32 minutes and 45 seconds
Changes
36
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
36b5ce4d
...
...
@@ -197,6 +197,7 @@ endif()
string
(
TOUPPER
${
CMAKE_BUILD_TYPE
}
CMAKE_BUILD_TYPE_UPPER
)
set
(
HYTEG_BUILD_TYPE
${
CMAKE_BUILD_TYPE
}
)
set
(
HYTEG_COMPILER_INFO
"
${
CMAKE_CXX_COMPILER_ID
}
${
CMAKE_CXX_COMPILER_VERSION
}
"
)
set
(
HYTEG_COMPILER_FLAGS
"
${
CMAKE_CXX_FLAGS_
${
CMAKE_BUILD_TYPE_UPPER
}}
${
CMAKE_CXX_FLAGS
}
"
)
string
(
REPLACE
"
\"
"
"
\\\"
"
HYTEG_COMPILER_FLAGS
${
HYTEG_COMPILER_FLAGS
}
)
...
...
src/hyteg/BuildInfo.in.hpp
View file @
36b5ce4d
...
...
@@ -24,7 +24,7 @@
namespace
hyteg
{
std
::
string
build
Flavour
()
std
::
string
build
Type
()
{
return
"@HYTEG_BUILD_TYPE@"
;
}
...
...
@@ -34,11 +34,17 @@ std::string compilerFlags()
return
"@HYTEG_COMPILER_FLAGS@"
;
}
std
::
string
compilerInfo
()
{
return
"@HYTEG_COMPILER_INFO@"
;
}
void
printBuildInfo
()
{
WALBERLA_LOG_INFO_ON_ROOT
(
"Build info:"
)
WALBERLA_LOG_INFO_ON_ROOT
(
" - flavour: "
<<
buildFlavour
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
" - compiler flags: "
<<
compilerFlags
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
" - build type ....... "
<<
buildType
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
" - compiler ......... "
<<
compilerInfo
()
);
WALBERLA_LOG_INFO_ON_ROOT
(
" - compiler flags ... "
<<
compilerFlags
()
);
}
}
src/hyteg/celldofspace/CellDoFIndexing.hpp
View file @
36b5ce4d
...
...
@@ -45,15 +45,19 @@ enum class CellType : uint_t
GREEN_DOWN
};
const
std
::
map
<
CellType
,
std
::
string
>
CellTypeToStr
=
{{
CellType
::
WHITE_UP
,
"WHITE_UP"
},
{
CellType
::
BLUE_UP
,
"BLUE_UP"
},
{
CellType
::
GREEN_UP
,
"GREEN_UP"
},
{
CellType
::
WHITE_DOWN
,
"WHITE_DOWN"
},
{
CellType
::
BLUE_DOWN
,
"BLUE_DOWN"
},
{
CellType
::
GREEN_DOWN
,
"GREEN_DOWN"
}};
const
std
::
array
<
CellType
,
6
>
allCellTypes
=
{
{
CellType
::
WHITE_UP
,
CellType
::
BLUE_UP
,
CellType
::
GREEN_UP
,
CellType
::
WHITE_DOWN
,
CellType
::
BLUE_DOWN
,
CellType
::
GREEN_DOWN
}};
const
std
::
map
<
CellType
,
std
::
string
>
CellTypeToStr
=
{
{
CellType
::
WHITE_UP
,
"WHITE_UP"
},
{
CellType
::
BLUE_UP
,
"BLUE_UP"
},
{
CellType
::
GREEN_UP
,
"GREEN_UP"
},
{
CellType
::
WHITE_DOWN
,
"WHITE_DOWN"
},
{
CellType
::
BLUE_DOWN
,
"BLUE_DOWN"
},
{
CellType
::
GREEN_DOWN
,
"GREEN_DOWN"
}
};
const
std
::
array
<
CellType
,
6
>
allCellTypes
=
{
{
CellType
::
WHITE_UP
,
CellType
::
BLUE_UP
,
CellType
::
GREEN_UP
,
CellType
::
WHITE_DOWN
,
CellType
::
BLUE_DOWN
,
CellType
::
GREEN_DOWN
}
};
namespace
macrocell
{
...
...
@@ -78,6 +82,27 @@ inline constexpr uint_t numCellsPerRowByType( const uint_t& level, const CellTyp
}
}
inline
constexpr
uint_t
numCellsPerRowByTypeFromWidth
(
const
uint_t
&
width
,
const
CellType
&
cellType
)
{
switch
(
cellType
)
{
case
CellType
::
WHITE_UP
:
return
levelinfo
::
num_microedges_per_edge_from_width
(
width
);
case
CellType
::
BLUE_UP
:
return
levelinfo
::
num_microedges_per_edge_from_width
(
width
)
-
1
;
case
CellType
::
GREEN_UP
:
return
levelinfo
::
num_microedges_per_edge_from_width
(
width
)
-
1
;
case
CellType
::
WHITE_DOWN
:
return
levelinfo
::
num_microedges_per_edge_from_width
(
width
)
-
2
;
case
CellType
::
BLUE_DOWN
:
return
levelinfo
::
num_microedges_per_edge_from_width
(
width
)
-
1
;
case
CellType
::
GREEN_DOWN
:
return
levelinfo
::
num_microedges_per_edge_from_width
(
width
)
-
1
;
default:
return
std
::
numeric_limits
<
uint_t
>::
max
();
}
}
inline
constexpr
uint_t
numMicroCellsPerMacroCell
(
const
uint_t
&
level
,
const
CellType
&
cellType
)
{
return
levelinfo
::
num_microvertices_per_cell_from_width
(
numCellsPerRowByType
(
level
,
cellType
)
);
...
...
@@ -135,35 +160,35 @@ inline std::array< Index, 4 > getMicroVerticesFromMicroCell( const Index& microC
switch
(
microCellType
)
{
case
CellType
::
WHITE_UP
:
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
,
cellY
,
cellZ
),
Index
(
cellX
+
1
,
cellY
,
cellZ
),
Index
(
cellX
,
cellY
+
1
,
cellZ
),
Index
(
cellX
,
cellY
,
cellZ
+
1
)
}
}
);
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
,
cellY
,
cellZ
),
Index
(
cellX
+
1
,
cellY
,
cellZ
),
Index
(
cellX
,
cellY
+
1
,
cellZ
),
Index
(
cellX
,
cellY
,
cellZ
+
1
)
}
}
);
case
CellType
::
BLUE_UP
:
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
+
1
,
cellY
,
cellZ
),
Index
(
cellX
+
1
,
cellY
+
1
,
cellZ
),
Index
(
cellX
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
)
}
}
);
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
+
1
,
cellY
,
cellZ
),
Index
(
cellX
+
1
,
cellY
+
1
,
cellZ
),
Index
(
cellX
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
)
}
}
);
case
CellType
::
GREEN_UP
:
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
+
1
,
cellY
,
cellZ
),
Index
(
cellX
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
),
Index
(
cellX
,
cellY
,
cellZ
+
1
)
}
}
);
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
+
1
,
cellY
,
cellZ
),
Index
(
cellX
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
),
Index
(
cellX
,
cellY
,
cellZ
+
1
)
}
}
);
case
CellType
::
WHITE_DOWN
:
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
+
1
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
+
1
,
cellZ
+
1
),
Index
(
cellX
,
cellY
+
1
,
cellZ
+
1
),
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
)
}
}
);
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
+
1
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
+
1
,
cellZ
+
1
),
Index
(
cellX
,
cellY
+
1
,
cellZ
+
1
),
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
)
}
}
);
case
CellType
::
BLUE_DOWN
:
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
),
Index
(
cellX
,
cellY
+
1
,
cellZ
+
1
),
Index
(
cellX
,
cellY
,
cellZ
+
1
),
Index
(
cellX
,
cellY
+
1
,
cellZ
)
}
}
);
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
),
Index
(
cellX
,
cellY
+
1
,
cellZ
+
1
),
Index
(
cellX
,
cellY
,
cellZ
+
1
),
Index
(
cellX
,
cellY
+
1
,
cellZ
)
}
}
);
case
CellType
::
GREEN_DOWN
:
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
),
Index
(
cellX
,
cellY
+
1
,
cellZ
+
1
)
}
}
);
return
std
::
array
<
Index
,
4
>
(
{
{
Index
(
cellX
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
+
1
,
cellZ
),
Index
(
cellX
+
1
,
cellY
,
cellZ
+
1
),
Index
(
cellX
,
cellY
+
1
,
cellZ
+
1
)
}
}
);
default:
WALBERLA_ABORT
(
"Not implemented for this cell type."
);
break
;
...
...
src/hyteg/dataexport/VTKDGWriter.cpp
View file @
36b5ce4d
...
...
@@ -47,23 +47,19 @@ void VTKDGWriter::write( const VTKOutput& mgr, std::ostream& output, const uint_
auto
storage
=
mgr
.
storage_
;
WALBERLA_CHECK
(
!
storage
->
hasGlobalCells
(),
"DG VTK output not implemented for 3D"
);
const
std
::
map
<
uint_t
,
uint_t
>
degreeToEvalPoints2D
=
{
{
1
,
3
},
{
2
,
6
},
};
const
uint_t
numberOfPoints2D
=
storage
->
getNumberOfLocalFaces
()
*
levelinfo
::
num_microfaces_per_face
(
level
)
*
3
;
const
uint_t
numberOfCells2D
=
storage
->
getNumberOfLocalFaces
()
*
levelinfo
::
num_microfaces_per_face
(
level
);
const
uint_t
numberOfPoints3D
=
storage
->
getNumberOfLocalCells
()
*
levelinfo
::
num_microcells_per_cell
(
level
)
*
4
;
const
uint_t
numberOfCells3D
=
storage
->
getNumberOfLocalCells
()
*
levelinfo
::
num_microcells_per_cell
(
level
);
if
(
mgr
.
write2D_
)
{
vtk
::
writePieceHeader
(
output
,
numberOfPoints2D
,
numberOfCells2D
);
}
else
{
// TODO
vtk
::
writePieceHeader
(
output
,
numberOfPoints3D
,
numberOfCells3D
);
}
output
<<
"<Points>
\n
"
;
...
...
@@ -157,7 +153,27 @@ void VTKDGWriter::writeScalarFunction( std::ostream&
}
else
{
WALBERLA_ABORT
(
"DGFunction VTK not implemented in 3D."
);
for
(
const
auto
&
it
:
storage
->
getCells
()
)
{
const
PrimitiveID
cellID
=
it
.
first
;
const
Cell
&
cell
=
*
it
.
second
;
for
(
auto
cellType
:
celldof
::
allCellTypes
)
{
for
(
const
auto
&
idxIt
:
celldof
::
macrocell
::
Iterator
(
level
,
cellType
)
)
{
const
std
::
array
<
indexing
::
Index
,
4
>
vertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
idxIt
,
cellType
);
for
(
uint_t
i
=
0
;
i
<
4
;
i
++
)
{
const
auto
vtkPoint
=
vertexdof
::
macrocell
::
coordinateFromIndex
(
level
,
cell
,
vertexIndices
[
i
]
);
value_t
value
;
function
.
evaluateOnMicroElement
(
vtkPoint
,
level
,
cellID
,
idxIt
,
cellType
,
value
);
streamWriter
<<
value
;
}
}
}
}
}
streamWriter
.
toStream
(
output
);
...
...
src/hyteg/dataexport/VTKMeshWriter.cpp
View file @
36b5ce4d
...
...
@@ -99,7 +99,25 @@ void VTKMeshWriter::writePointsForMicroVertices( const VTKOutput&
{
if
(
discontinuous
)
{
WALBERLA_ABORT
(
"Discontinuous points not implemented for 3D."
);
for
(
const
auto
&
it
:
storage
->
getCells
()
)
{
const
Cell
&
cell
=
*
it
.
second
;
for
(
auto
cellType
:
celldof
::
allCellTypes
)
{
for
(
const
auto
&
idxIt
:
celldof
::
macrocell
::
Iterator
(
level
,
cellType
)
)
{
auto
vertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
idxIt
,
cellType
);
for
(
auto
vIdx
:
vertexIndices
)
{
const
Point3D
vtkPoint
=
vertexdof
::
macrocell
::
coordinateFromIndex
(
level
,
cell
,
vIdx
);
Point3D
xBlend
;
cell
.
getGeometryMap
()
->
evalF
(
vtkPoint
,
xBlend
);
streamWriter
<<
xBlend
[
0
]
<<
xBlend
[
1
]
<<
xBlend
[
2
];
}
}
}
}
}
else
{
...
...
@@ -368,8 +386,6 @@ void VTKMeshWriter::writeCells3D( const VTKOutput& mgr
uint_t
width
,
bool
discontinuous
)
{
WALBERLA_CHECK
(
!
discontinuous
,
"Discontinuous VTK cells not implemented in 3D."
);
using
CellIdx_T
=
int32_t
;
output
<<
"<Cells>
\n
"
;
...
...
@@ -381,8 +397,9 @@ void VTKMeshWriter::writeCells3D( const VTKOutput& mgr
auto
calcVTKPointArrayPosition
=
[
width
](
const
indexing
::
Index
&
vertexIndex
)
->
uint_t
{
const
uint_t
zOffset
=
levelinfo
::
num_microvertices_per_cell_from_width
(
width
)
-
levelinfo
::
num_microvertices_per_cell_from_width
(
width
-
uint_c
(
vertexIndex
.
z
()
)
);
const
uint_t
yOffset
=
levelinfo
::
num_microvertices_per_face_from_width
(
width
-
uint_c
(
vertexIndex
.
z
()
)
)
-
levelinfo
::
num_microvertices_per_face_from_width
(
width
-
uint_c
(
vertexIndex
.
z
()
)
-
uint_c
(
vertexIndex
.
y
()
)
);
const
uint_t
yOffset
=
levelinfo
::
num_microvertices_per_face_from_width
(
width
-
uint_c
(
vertexIndex
.
z
()
)
)
-
levelinfo
::
num_microvertices_per_face_from_width
(
width
-
uint_c
(
vertexIndex
.
z
()
)
-
uint_c
(
vertexIndex
.
y
()
)
);
const
uint_t
xOffset
=
uint_c
(
vertexIndex
.
x
()
);
return
xOffset
+
yOffset
+
zOffset
;
};
...
...
@@ -390,67 +407,90 @@ void VTKMeshWriter::writeCells3D( const VTKOutput& mgr
const
uint_t
numberOfVertices
=
levelinfo
::
num_microvertices_per_cell_from_width
(
width
);
const
uint_t
numberOfCells
=
levelinfo
::
num_microcells_per_cell_from_width
(
width
);
CellIdx_T
offset
=
0
;
for
(
uint_t
macroCellIdx
=
0
;
macroCellIdx
<
storage
->
getNumberOfLocalCells
();
macroCellIdx
++
)
{
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
1
)
)
if
(
discontinuous
)
{
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
WHITE_UP
);
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
for
(
auto
cellType
:
celldof
::
allCellTypes
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
celldof
::
macrocell
::
numCellsPerRowByTypeFromWidth
(
width
,
cellType
);
const
uint_t
numMicroCellsAtBoundary
=
celldof
::
macrocell
::
numCellsPerRowByTypeFromWidth
(
width
,
cellType
);
for
(
const
auto
&
idxIt
:
indexing
::
CellIterator
(
numMicroCellsAtBoundary
)
)
{
streamWriterCells
<<
offset
<<
offset
+
1
<<
offset
+
2
<<
offset
+
3
;
offset
+=
4
;
WALBERLA_UNUSED
(
idxIt
);
}
}
}
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
2
)
)
else
{
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
BLUE_UP
);
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
1
)
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
WHITE_UP
);
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
2
)
)
{
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
GREEN_UP
);
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
2
)
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
BLUE_UP
);
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
3
)
)
{
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
WHITE_DOWN
);
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
2
)
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
GREEN_UP
);
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
2
)
)
{
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
BLUE_DOWN
);
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
3
)
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
WHITE_DOWN
);
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
}
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
2
)
)
{
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
GREEN
_DOWN
);
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
2
)
)
{
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
BLUE
_DOWN
);
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
for
(
const
auto
&
it
:
indexing
::
CellIterator
(
width
-
2
)
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
const
auto
spanningVertexIndices
=
celldof
::
macrocell
::
getMicroVerticesFromMicroCell
(
it
,
celldof
::
CellType
::
GREEN_DOWN
);
for
(
const
auto
&
spanningVertexIndex
:
spanningVertexIndices
)
{
streamWriterCells
<<
macroCellIdx
*
numberOfVertices
+
calcVTKPointArrayPosition
(
spanningVertexIndex
);
}
}
}
}
...
...
@@ -465,7 +505,7 @@ void VTKMeshWriter::writeCells3D( const VTKOutput& mgr
VTKOutput
::
VTKStreamWriter
<
OffsetType
>
streamWriterOffsets
(
mgr
.
vtkDataFormat_
);
// offsets
uint_t
offset
=
4
;
offset
=
4
;
for
(
const
auto
&
it
:
storage
->
getCells
()
)
{
WALBERLA_UNUSED
(
it
);
...
...
src/hyteg/dgfunctionspace/CMakeLists.txt
View file @
36b5ce4d
...
...
@@ -3,8 +3,10 @@ target_sources( hyteg
DGBasisInfo.hpp
DGBasisLinearLagrange_Example.hpp
DGDiffusionForm_Example.hpp
DGDiffusionForm_Example.cpp
DGForm.hpp
DGForm2D.hpp
DGFormVolume.hpp
DGFunction.cpp
DGFunction.hpp
DGMassForm_Example.hpp
...
...
src/hyteg/dgfunctionspace/DGBasisInfo.hpp
View file @
36b5ce4d
...
...
@@ -42,8 +42,8 @@ class DGBasisInfo
/// \brief Returns the maximum polynomial degree for which basis functions are implemented.
virtual
uint_t
maxPolynomialDegree
()
const
=
0
;
/// \brief Returns the number of DoFs per element for the passed polynomial degree.
virtual
uint_t
numDoFsPerElement
(
uint_t
degree
)
const
=
0
;
/// \brief Returns the number of DoFs per element for the passed polynomial degree
and type of the element
.
virtual
uint_t
numDoFsPerElement
(
uint_t
dim
,
uint_t
degree
)
const
=
0
;
/// \brief Returns the degree of the quadrature rule that is used for the evaluation of the linear functional \f$\int_T f \phi_i\f$.
virtual
uint_t
quadratureDegreeForLinearFunctional
()
const
=
0
;
...
...
@@ -59,13 +59,24 @@ class DGBasisInfo
const
std
::
vector
<
real_t
>&
dofs
,
real_t
&
value
)
const
=
0
;
/// \brief Evaluates the polynomial on the reference tetrahedron.
///
/// \param degree degree of the piecewise polynomials
/// \param pos where to evaluate on the micro-element (in reference space)
/// \param dofs DoFs that correspond to the basis functions
/// \param value value of the polynomial
virtual
void
evaluate
(
uint_t
degree
,
const
Eigen
::
Matrix
<
real_t
,
3
,
1
>&
pos
,
const
std
::
vector
<
real_t
>&
dofs
,
real_t
&
value
)
const
=
0
;
/// \brief Evaluates the linear functional
///
/// \f{align*}{
/// l( v ) = \int_T f v
/// \f}
///
/// by quadrature over the passed element \f$T\f$ for all basis functions, i.e. it returns an approximation to
/// by quadrature over the passed
face
element \f$T\f$ for all basis functions, i.e. it returns an approximation to
///
/// \f{align*}{
/// \int_T f \phi_i.
...
...
@@ -79,6 +90,27 @@ class DGBasisInfo
const
std
::
array
<
Eigen
::
Matrix
<
real_t
,
2
,
1
>
,
3
>&
coords
,
const
std
::
function
<
real_t
(
const
Point3D
&
)
>&
f
,
std
::
vector
<
real_t
>&
values
)
=
0
;
/// \brief Evaluates the linear functional
///
/// \f{align*}{
/// l( v ) = \int_T f v
/// \f}
///
/// by quadrature over the passed cell element \f$T\f$ for all basis functions, i.e. it returns an approximation to
///
/// \f{align*}{
/// \int_T f \phi_i.
/// \f}
///
/// \param degree degree of the piecewise polynomials
/// \param coords coordinates of the affine element (computational space)
/// \param f function to multiply with the basis functions
/// \param value result of the integration (all DoFs)
virtual
void
integrateBasisFunction
(
uint_t
degree
,
const
std
::
array
<
Eigen
::
Matrix
<
real_t
,
3
,
1
>
,
4
>&
coords
,
const
std
::
function
<
real_t
(
const
Point3D
&
)
>&
f
,
std
::
vector
<
real_t
>&
values
)
=
0
;
};
}
// namespace dg
...
...
src/hyteg/dgfunctionspace/DGBasisLinearLagrange_Example.hpp
View file @
36b5ce4d
This diff is collapsed.
Click to expand it.
src/hyteg/dgfunctionspace/DGDiffusionForm_Example.cpp
0 → 100644
View file @
36b5ce4d
This diff is collapsed.
Click to expand it.
src/hyteg/dgfunctionspace/DGDiffusionForm_Example.hpp
View file @
36b5ce4d
This diff is collapsed.
Click to expand it.
src/hyteg/dgfunctionspace/DGForm.hpp
View file @
36b5ce4d
...
...
@@ -34,7 +34,11 @@ namespace dg {
class
DGForm
{
public:
/// \brief Integrates the volume contribution on a triangle element (2D).
/// \brief Returns true if only volume integrals are non-zero.
/// The integration of facet integrals can then be skipped altogether.
[[
nodiscard
]]
virtual
bool
onlyVolumeIntegrals
()
const
{
return
false
;
}
/// \brief Integrates the volume contribution on a triangle element.
///
/// \param dim 2 for 2D volumes, 3 for 3D volumes
/// \param coords coordinates of the triangle element vertices
...
...
@@ -65,7 +69,7 @@ class DGForm
}
};
/// \brief Integrates the inner part of the facet contribution on a triangle element
(2D)
.
/// \brief Integrates the inner part of the facet contribution on a triangle element.
///
/// \param dim 2 for 2D volumes, 3 for 3D volumes
/// \param coordsElement coordinates of the triangle element vertices
...
...
@@ -104,7 +108,7 @@ class DGForm
}
}
/// \brief Integrates the facet contributions from both sides on a triangle element
(2D)
- writing to the inner DoFs.
/// \brief Integrates the facet contributions from both sides on a triangle element - writing to the inner DoFs.
///
/// \param dim 2 for 2D volumes, 3 for 3D volumes
/// \param coordsElementInner coordinates of the triangle element vertices of the inner (dst) element
...
...
@@ -165,7 +169,7 @@ class DGForm
}
}
/// \brief Integrates the facet contributions at Dirichlet boundaries
(2D)
- writing to the inner DoFs.
/// \brief Integrates the facet contributions at Dirichlet boundaries - writing to the inner DoFs.
///
/// \param dim 2 for 2D volumes, 3 for 3D volumes
/// \param coordsElement coordinates of the triangle element vertices of the inner (dst) element
...
...
@@ -204,7 +208,7 @@ class DGForm
}
}
/// \brief Integrates the facet contributions at Dirichlet boundaries
(2D)
for the right-hand side.
/// \brief Integrates the facet contributions at Dirichlet boundaries for the right-hand side.
///
/// \param dim 2 for 2D volumes, 3 for 3D volumes
/// \param coordsElement coordinates of the triangle element vertices of the inner (dst) element
...
...
src/hyteg/dgfunctionspace/DGFormVolume.hpp
0 → 100644
View file @
36b5ce4d
/*
* Copyright (c) 2017-2022 Nils Kohl.
*
* This file is part of HyTeG
* (see https://i10git.cs.fau.de/hyteg/hyteg).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include
"core/DataTypes.h"
#include
"hyteg/dgfunctionspace/DGBasisInfo.hpp"
#include
"hyteg/dgfunctionspace/DGForm.hpp"
#include
"hyteg/types/matrix.hpp"
#include
"hyteg/types/pointnd.hpp"
#include
"Eigen/Eigen"
namespace
hyteg
{
namespace
dg
{
/// \brief Helper class to derive from if only volume integrals are non-zero.
class
DGFormVolume
:
public
DGForm
{
public:
virtual
bool
onlyVolumeIntegrals
()
const
{
return
true
;
}
protected:
virtual
void
integrateFacetInner2D
(
const
std
::
vector
<
Eigen
::
Matrix
<
real_t
,
3
,
1
>
>&
coordsElement
,
const
std
::
vector
<
Eigen
::
Matrix
<
real_t
,
3
,
1
>
>&
coordsFacet
,
const
Eigen
::
Matrix
<
real_t
,
3
,
1
>&
oppositeVertex
,
const
Eigen
::
Matrix
<
real_t
,
3
,
1
>&
outwardNormal
,
const
DGBasisInfo
&
trialBasis
,
const
DGBasisInfo
&
testBasis
,
int
trialDegree
,
int
testDegree
,
Eigen
::
Matrix
<
real_t
,
Eigen
::
Dynamic
,
Eigen
::
Dynamic
>&
elMat
)
const
{
WALBERLA_UNUSED
(
coordsElement
);