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())
102 for (
int i = 0; i < geom->GetNumEdges(); ++i)
106 if (seenEdges.find(edge->
GetGlobalID()) != seenEdges.end())
122 for (
int i = 0; i < geom->GetNumFaces(); ++i)
126 if (seenFaces.find(face->
GetGlobalID()) != seenFaces.end())
152 for (
auto &pt : curve->m_points)
166 m_origin(origin), m_axis(axis), m_angularVelEqn(angularVelEqn),
167 m_rampTime(rampTime), m_sector(sector), m_base(base)
186 el->ClearBoundingBox();
188 int nfaces = el->GetNumFaces();
189 for (
int i = 0; i < nfaces; ++i)
191 el->GetFace(i)->ClearBoundingBox();
194 int nedges = el->GetNumEdges();
195 for (
int i = 0; i < nedges; ++i)
197 el->GetEdge(i)->ClearBoundingBox();
247 rot = rot + sin(angle) *
m_W + (1 - cos(angle)) *
m_W2;
253 DNekVec pntVec = {pnt[0], pnt[1], pnt[2]};
264 for (
auto &vert : curve->m_points)
267 DNekVec pntVec = {pnt[0], pnt[1], pnt[2]};
271 vert->UpdatePosition(newLoc(0) +
m_origin[0],
293 rot = rot + sin(angle) *
m_W + (1 - cos(angle)) *
m_W2;
300 gloCoord[0] = newLoc(0) +
m_origin[0];
301 gloCoord[1] = newLoc(1) +
m_origin[1];
302 gloCoord[2] = newLoc(2) +
m_origin[2];
306 int id,
int domainID,
const CompositeMap &domain,
const int coordDim,
310 m_velocityEqns(velocityEqns), m_displacementEqns(displacementEqns)
321 for (
int j = 0; j < 3; ++j)
323 min[j] = std::numeric_limits<double>::max();
324 max[j] = -std::numeric_limits<double>::max();
327 for (
int i = 0; i < NumVerts; ++i)
330 p.GetCoords(x[0], x[1], x[2]);
331 for (
int j = 0; j < 3; ++j)
333 min[j] = (x[j] <
min[j] ? x[j] :
min[j]);
334 max[j] = (x[j] >
max[j] ? x[j] :
max[j]);
337 for (
int j = 0; j < 3; ++j)
378 newLoc[i] = pnt(i) + disp[i];
381 vert->UpdatePosition(newLoc[0], newLoc[1], newLoc[2]);
387 for (
auto &vert : curve->m_points)
394 newLoc[i] = pnt(i) + disp[i];
397 vert->UpdatePosition(newLoc[0], newLoc[1], newLoc[2]);
CurveSharedPtr GetCurve()
int GetGlobalID(void) const
Get the ID of this object.
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
CurveSharedPtr GetCurve()
std::shared_ptr< Equation > EquationSharedPtr
std::shared_ptr< Curve > CurveSharedPtr
MovementType
Enum of zone movement type.
std::map< int, CompositeSharedPtr > CompositeMap
scalarT< T > max(scalarT< T > lhs, scalarT< T > rhs)
scalarT< T > min(scalarT< T > lhs, scalarT< T > rhs)
Zone base: Contains the shared functions and variables.
ZoneBase(MovementType type, int indx, int domainID, CompositeMap domain, int coordDim)
Constructor.
std::array< std::set< Geometry * >, 3 > m_constituentElements
Array of all dimension elements i.e. faces = [2], edges = [1], geom = [0].
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< Geometry * > m_elements
Vector of highest dimension zone elements.
std::vector< PointGeomUniquePtr > m_verts
Vector of all points in the zone.
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.
NekDouble v_GetAngle() const override
Returns the displacement of the zone.
DNekVec m_axis
Axis rotation is performed around.
NekDouble GetAngle(const NekDouble &time)
Returns the rotation angle of the zone.
DNekMat m_W
W matrix Rodrigues' rotation formula, cross product of axis.
NekPoint< NekDouble > m_origin
Origin point rotation is performed around.
NekDouble GetAngularVel(const NekDouble &time) const
Return the angular velocity of the zone at.
LibUtilities::EquationSharedPtr m_angularVelEqn
Equation defining angular velocity as a function of time.
void Rotate(Array< OneD, NekDouble > &gloCoord, const NekDouble &angle)
Rotates the given global coordinate by the given angle.
NekDouble m_angle
Rotate angle.
NekDouble m_rampTime
Ramp time.
ZoneRotate(int id, int domainID, const CompositeMap &domain, const int coordDim, const NekPoint< NekDouble > &origin, const DNekVec &axis, const LibUtilities::EquationSharedPtr &angularVelEqn, const NekDouble rampTime, const NekDouble sector, const Array< OneD, NekDouble > &base)
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.
std::vector< NekDouble > GetDisp(NekDouble &time)
Returns the displacement of the zone.
Array< OneD, NekDouble > m_ZoneLength
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.
ZoneTranslate(int id, int domainID, const CompositeMap &domain, const int coordDim, const Array< OneD, LibUtilities::EquationSharedPtr > &velocityEqns, const Array< OneD, LibUtilities::EquationSharedPtr > &displacementEqns)
Array< OneD, NekDouble > m_ZoneBox