Commit f8ac2cb1 authored by daniele.corallo's avatar daniele.corallo
Browse files

[445-enable-usage-of-lagrangedisc-with-st] added SpacetimeQuad to hexahedron cases

parent 075f26b7
......@@ -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!")
......
......@@ -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);
......
......@@ -92,7 +92,7 @@ public:
}
CELLTYPE ReferenceType() const override {
return c->ReferenceType();
return SpaceTimeCellType(c->ReferenceType());
}
// Todo write classes for different TCell types!!!!!!
......
......@@ -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;
}
......@@ -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;
......
......@@ -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; }
};
......
......@@ -21,6 +21,11 @@ public:
bool isDgInTime, bool single, bool blockDiagonal = false);
void update();
bool IsSpaceTime() const {
return true;
}
};
#endif //SPACETIMEMATRIXGRAPH_HPP
......@@ -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!")
......
......@@ -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>();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment