Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
Mpp
Commits
f8ac2cb1
Commit
f8ac2cb1
authored
May 12, 2022
by
daniele.corallo
Browse files
[445-enable-usage-of-lagrangedisc-with-st] added SpacetimeQuad to hexahedron cases
parent
075f26b7
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/lib2_mesh/cells/Celltype.cpp
View file @
f8ac2cb1
...
...
@@ -36,6 +36,7 @@ CELLTYPE FaceCellType(const CELLTYPE &type) {
case
TETRAHEDRON
:
return
TRIANGLE
;
case
HEXAHEDRON
:
case
SPACETIME_QUADRILATERAL
:
return
QUADRILATERAL
;
default:
THROW
(
"Celltype not implemented!"
)
...
...
src/lib2_mesh/cells/Celltype.hpp
View file @
f8ac2cb1
...
...
@@ -19,6 +19,8 @@ enum CELLTYPE {
bool
isSpaceTimeCellType
(
const
CELLTYPE
&
type
);
CELLTYPE
SpaceTimeCellType
(
const
CELLTYPE
&
type
);
CELLTYPE
SpaceCellType
(
const
CELLTYPE
&
type
);
CELLTYPE
FaceCellType
(
const
CELLTYPE
&
type
);
...
...
src/lib2_mesh/cells/TCell.hpp
View file @
f8ac2cb1
...
...
@@ -92,7 +92,7 @@ public:
}
CELLTYPE
ReferenceType
()
const
override
{
return
c
->
ReferenceType
();
return
SpaceTimeCellType
(
c
->
ReferenceType
()
)
;
}
// Todo write classes for different TCell types!!!!!!
...
...
src/lib3_disc/dof/NodalPointProvider.cpp
View file @
f8ac2cb1
...
...
@@ -57,6 +57,7 @@ int EquidistantNodalPointCount(CELLTYPE type, int degree) {
case
TETRAHEDRON
:
return
((
degree
+
1
)
*
(
degree
+
2
)
*
(
degree
+
3
))
/
6
;
case
HEXAHEDRON
:
case
SPACETIME_QUADRILATERAL
:
return
(
degree
+
1
)
*
(
degree
+
1
)
*
(
degree
+
1
);
default:
THROW
(
"Cell type not implemented in LagrangeDoF"
)
}
...
...
@@ -157,10 +158,11 @@ void EquidistantNodalPoints(const cell &c, int degree, std::vector<Point> &z) {
LagrangeNodalPointsTetrahedron
(
c
,
z
,
degree
);
break
;
case
HEXAHEDRON
:
case
SPACETIME_QUADRILATERAL
:
LagrangeNodalPointsHexahedron
(
c
,
z
,
degree
);
break
;
default:
THROW
(
"Cell type not implemented"
)
default:
THROW
(
"Celltype for EquidistantNodalPoints not implemented: "
+
std
::
to_string
(
c
.
ReferenceType
()))
}
return
;
}
src/lib3_disc/matrixgraph/MatrixGraph.cpp
View file @
f8ac2cb1
...
...
@@ -384,7 +384,7 @@ void MatrixGraph::PrintInfo() const {
}
rows
::
rows
(
const
MatrixGraph
&
g
,
const
cell
&
c
)
{
if
(
c
.
IsSpaceTime
())
{
if
(
g
.
IsSpaceTime
())
{
resize
(
1
);
(
*
this
)[
0
]
=
g
.
find_row
(
c
());
return
;
...
...
src/lib3_disc/matrixgraph/MatrixGraph.hpp
View file @
f8ac2cb1
...
...
@@ -19,8 +19,8 @@ protected:
ExchangeBuffer
DPE
;
public:
explicit
MatrixGraphBuffers
(
int
commSplit
=
0
)
:
APE
(
commSplit
),
CPE
(
commSplit
),
AIE
(
commSplit
),
CIE
(
commSplit
),
AVE
(
commSplit
),
MAE
(
commSplit
),
MIE
(
commSplit
),
DPE
(
commSplit
)
{}
APE
(
commSplit
),
CPE
(
commSplit
),
AIE
(
commSplit
),
CIE
(
commSplit
),
AVE
(
commSplit
),
MAE
(
commSplit
),
MIE
(
commSplit
),
DPE
(
commSplit
)
{}
ExchangeBuffer
&
AccumulateParallelBuffer
()
{
return
APE
.
Rewind
();
}
...
...
@@ -52,11 +52,12 @@ struct MatrixGraphMemoryInfo {
int
memTotal_GB
;
double
memBalance
;
MatrixGraphMemoryInfo
(
int
totalSize
,
int
sizeOnProc
,
int
commSplit
,
std
::
string
name
=
"MemoryInfo"
)
:
name
(
name
),
sizeOnProc
(
sizeOnProc
),
totalSize
(
totalSize
)
{
memOnProc_MB
=
MAX
((
sizeOnProc
*
sizeof
(
T
)
)
/
(
1024
*
1024
),
1
);
MatrixGraphMemoryInfo
(
int
totalSize
,
int
sizeOnProc
,
int
commSplit
,
std
::
string
name
=
"MemoryInfo"
)
:
name
(
name
),
sizeOnProc
(
sizeOnProc
),
totalSize
(
totalSize
)
{
memOnProc_MB
=
MAX
((
sizeOnProc
*
sizeof
(
T
))
/
(
1024
*
1024
),
1
);
memOnProc_GB
=
memOnProc_MB
/
1024
;
memMaxOnProc_MB
=
PPM
->
Max
(
memOnProc_MB
,
commSplit
);
memMaxOnProc_GB
=
memMaxOnProc_MB
/
1024
;
...
...
@@ -106,7 +107,7 @@ protected:
void
InitIndexData
();
virtual
/// functions to initialize the MatrixGraph
void
AddCell
(
const
cell
&
c
,
int
depth
=
1
,
bool
withNB
=
false
);
void
AddCell
(
const
cell
&
c
,
int
depth
=
1
,
bool
withNB
=
false
);
void
Init
(
const
Mesh
&
mesh
);
...
...
@@ -122,21 +123,21 @@ protected:
// Todo best case: Only one protected constructor is left
MatrixGraph
(
std
::
unique_ptr
<
DoFs
>
dofs
,
const
Mesh
&
mesh
)
:
dofs
(
std
::
move
(
dofs
)),
mesh
(
mesh
),
buffers
(
mesh
.
CommSplit
())
{
dofs
(
std
::
move
(
dofs
)),
mesh
(
mesh
),
buffers
(
mesh
.
CommSplit
())
{
_procSets
.
SetCommSplit
(
CommSplit
());
config
.
get
(
"MatrixGraphVerbose"
,
verbose
);
}
MatrixGraph
(
std
::
unique_ptr
<
DoFs
>
dofs
,
const
Mesh
&
stMesh
,
bool
single
)
:
dofs
(
std
::
move
(
dofs
)),
mesh
(
stMesh
),
singleEntries
(
single
),
buffers
(
stMesh
.
CommSplit
())
{
dofs
(
std
::
move
(
dofs
)),
mesh
(
stMesh
),
singleEntries
(
single
),
buffers
(
stMesh
.
CommSplit
())
{
_procSets
.
SetCommSplit
(
CommSplit
());
config
.
get
(
"MatrixGraphVerbose"
,
verbose
);
}
public:
MatrixGraph
(
const
Mesh
&
mesh
,
std
::
unique_ptr
<
DoFs
>
dofs
,
int
depth
=
-
1
,
bool
withNB
=
false
)
:
dofs
(
std
::
move
(
dofs
)),
mesh
(
mesh
),
buffers
(
mesh
.
CommSplit
())
{
MatrixGraph
(
const
Mesh
&
mesh
,
std
::
unique_ptr
<
DoFs
>
dofs
,
int
depth
=
-
1
,
bool
withNB
=
false
)
:
dofs
(
std
::
move
(
dofs
)),
mesh
(
mesh
),
buffers
(
mesh
.
CommSplit
())
{
_procSets
.
SetCommSplit
(
CommSplit
());
for
(
cell
c
=
mesh
.
cells
();
c
!=
mesh
.
cells_end
();
++
c
)
AddCell
(
c
,
depth
,
withNB
);
...
...
@@ -267,6 +268,11 @@ public:
row
rows_end
()
const
{
return
row
(
_rows
.
end
());
}
row
find_row
(
const
Point
&
z
)
const
{
return
row
(
_rows
.
find
(
z
));
}
virtual
bool
IsSpaceTime
()
const
{
return
false
;
}
};
class
HybridMatrixGraph
:
public
MatrixGraph
{
...
...
@@ -275,7 +281,7 @@ public:
HybridMatrixGraph
(
const
Mesh
&
mesh
,
std
::
unique_ptr
<
DoFs
>
shapeDoFs
,
std
::
unique_ptr
<
DoFs
>
vectorDoFs
)
:
MatrixGraph
(
mesh
,
std
::
move
(
vectorDoFs
)),
shapeDoFs
(
std
::
move
(
shapeDoFs
))
{}
:
MatrixGraph
(
mesh
,
std
::
move
(
vectorDoFs
)),
shapeDoFs
(
std
::
move
(
shapeDoFs
))
{}
DoFs
&
GetShapeDoFs
()
const
override
{
return
*
shapeDoFs
;
}
};
...
...
src/lib3_disc/matrixgraph/SpaceTimeMatrixGraph.hpp
View file @
f8ac2cb1
...
...
@@ -21,6 +21,11 @@ public:
bool
isDgInTime
,
bool
single
,
bool
blockDiagonal
=
false
);
void
update
();
bool
IsSpaceTime
()
const
{
return
true
;
}
};
#endif //SPACETIMEMATRIXGRAPH_HPP
src/lib3_disc/quadrature/Quadrature.cpp
View file @
f8ac2cb1
...
...
@@ -87,6 +87,7 @@ const QuadratureT<> &GetQuadratureT(const CELLTYPE cellType,
Quads
[
key
]
=
new
QpriSym
(
exactUpTo
,
exactUpTo1
);
break
;
case
HEXAHEDRON
:
case
SPACETIME_QUADRILATERAL
:
Quads
[
key
]
=
new
Qhex
(
exactUpTo
,
exactUpTo1
,
exactUpTo2
);
break
;
default:
THROW
(
"No Quadrature implemented for given cell type!"
)
...
...
src/lib3_disc/shapes/LagrangeShapes.hpp
View file @
f8ac2cb1
...
...
@@ -91,6 +91,7 @@ ShapeT<T, sDim, tDim> *createLagrangeShape(const CELLTYPE cellType, int degree)
default:
THROW
(
"Shape not implemented"
)
}
case
HEXAHEDRON
:
case
SPACETIME_QUADRILATERAL
:
switch
(
degree
)
{
case
0
:
return
new
P0HexT
<
T
,
sDim
,
tDim
>
();
...
...
Write
Preview
Markdown
is supported
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