47 : m_type(type), m_id(indx), m_domainID(domainID), m_domain(domain),
50 for (
auto &comp : domain)
52 for (
auto &geom : comp.second->m_geomVec)
57 switch (geom->GetShapeDim())
60 for (
int i = 0; i < geom->GetNumFaces(); ++i)
66 for (
int i = 0; i < geom->GetNumEdges(); ++i)
82 std::unordered_set<int> seenVerts, seenEdges, seenFaces;
87 for (
auto &geom : comp.second->m_geomVec)
89 for (
int i = 0; i < geom->GetNumVerts(); ++i)
93 if (seenVerts.find(vert->GetGlobalID()) != seenVerts.end())
98 seenVerts.insert(vert->GetGlobalID());
102 for (
int i = 0; i < geom->GetNumEdges(); ++i)
105 std::static_pointer_cast<SegGeom>(geom->GetEdge(i));
107 if (seenEdges.find(edge->GetGlobalID()) != seenEdges.end())
112 seenEdges.insert(edge->GetGlobalID());
123 for (
int i = 0; i < geom->GetNumFaces(); ++i)
126 std::static_pointer_cast<Geometry2D>(geom->GetFace(i));
128 if (seenFaces.find(face->GetGlobalID()) != seenFaces.end())
133 seenFaces.insert(face->GetGlobalID());
154 for (
auto &pt : curve->m_points)
166 m_origin(
origin), m_axis(
axis), m_angularVelEqn(angularVelEqn)
185 el->ClearBoundingBox();
187 int nfaces = el->GetNumFaces();
188 for (
int i = 0; i < nfaces; ++i)
190 el->GetFace(i)->ClearBoundingBox();
193 int nedges = el->GetNumEdges();
194 for (
int i = 0; i < nedges; ++i)
196 el->GetEdge(i)->ClearBoundingBox();
239 rot = rot + sin(angle) *
m_W + (1 - cos(angle)) *
m_W2;
245 DNekVec pntVec = {pnt[0], pnt[1], pnt[2]};
256 for (
auto &vert : curve->m_points)
259 DNekVec pntVec = {pnt[0], pnt[1], pnt[2]};
263 vert->UpdatePosition(newLoc(0) +
m_origin[0],
308 newLoc[i] = pnt(i) + disp[i];
311 vert->UpdatePosition(newLoc[0], newLoc[1], newLoc[2]);
317 for (
auto &vert : curve->m_points)
324 newLoc[i] = pnt(i) + disp[i];
327 vert->UpdatePosition(newLoc[0], newLoc[1], newLoc[2]);
std::shared_ptr< Equation > EquationSharedPtr
const NekPoint< NekDouble > origin
std::shared_ptr< Curve > CurveSharedPtr
MovementType
Enum of zone movement type.
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
std::map< int, CompositeSharedPtr > CompositeMap
Zone base: Contains the shared functions and variables.
ZoneBase(MovementType type, int indx, int domainID, CompositeMap domain, int coordDim)
Constructor.
std::array< std::set< GeometrySharedPtr >, 3 > m_constituentElements
Array of all dimension elements i.e. faces = [2], edges = [1], geom = [0].
std::vector< PointGeomSharedPtr > m_verts
Vector of all points in the zone.
int m_coordDim
Coordinate dimension.
void ClearBoundingBoxes()
Clears all bounding boxes associated with the zones elements.
std::vector< PointGeom > m_origVerts
Vector of all points in the zone at initialisation.
std::vector< CurveSharedPtr > m_curves
Vector of all curves in the zone.
CompositeMap m_domain
Zone domain.
std::vector< GeometrySharedPtr > m_elements
Vector of highest dimension zone elements.
std::vector< NekDouble > v_GetDisp() const override
Returns the displacement of the zone.
bool v_Move(NekDouble time) final
Virtual function for movement of the zone at.
DNekVec m_axis
Axis rotation is performed around.
NekDouble GetAngularVel(NekDouble &time) const
Return the angular velocity of the zone at.
DNekMat m_W
W matrix Rodrigues' rotation formula, cross product of axis.
NekPoint< NekDouble > m_origin
Origin point rotation is performed around.
LibUtilities::EquationSharedPtr m_angularVelEqn
Equation defining angular velocity as a function of time.
bool v_Move(NekDouble time) final
Virtual function for movement of the zone at.
DNekMat m_W2
W^2 matrix Rodrigues' rotation formula, cross product of axis squared.
ZoneRotate(int id, int domainID, const CompositeMap &domain, const int coordDim, const NekPoint< NekDouble > &origin, const DNekVec &axis, const LibUtilities::EquationSharedPtr &angularVelEqn)
std::vector< NekDouble > GetDisp(NekDouble &time)
Returns the displacement of the zone.
std::vector< NekDouble > m_disp
bool v_Move(NekDouble time) final
Virtual function for movement of the zone at.
Array< OneD, LibUtilities::EquationSharedPtr > m_displacementEqns
Array< OneD, LibUtilities::EquationSharedPtr > m_velocityEqns
std::vector< NekDouble > GetVel(NekDouble &time) const
Returns the velocity of the zone.