43 [[maybe_unused]]
int spaceDim,
49 [[maybe_unused]]
int spaceDim,
53 if (fields[0]->GetGraph() !=
56 for (
auto &zone : fields[0]->GetGraph()->GetMovement()->GetZones())
58 switch (zone.second->GetMovementType())
79 "Zone cannot have movement type of 'None'.");
153 int nVariables = inarray.size();
160 for (
int i = 0; i < nVariables; ++i)
163 m_fieldsALE[i]->MultiplyByElmtInvMass(inarray[i], tmp);
177 auto curvedEdges =
m_fieldsALE[0]->GetGraph()->GetCurvedEdges();
178 auto curvedFaces =
m_fieldsALE[0]->GetGraph()->GetCurvedFaces();
182 m_fieldsALE[0]->GetGraph()->GetMovement()->PerformMovement(
190 field->ResetMatrices();
196 for (
auto &zone :
m_fieldsALE[0]->GetGraph()->GetMovement()->GetZones())
198 if (zone.second->GetMoved())
200 auto conEl = zone.second->GetConstituentElements();
201 for (
const auto &i : conEl)
203 for (
const auto &j : i)
205 j->ResetNonRecursive(curvedEdges, curvedFaces);
210 for (
const auto &i : conEl[
m_fieldsALE[0]->GetShapeDimension() -
215 ->GetExpFromGeomId(i->GetGlobalID())
223 for (
auto &zone :
field->GetGraph()->GetMovement()->GetZones())
225 if (zone.second->GetMoved())
227 auto conEl = zone.second->GetConstituentElements();
233 field->GetExpFromGeomId(i->GetGlobalID())->Reset();
239 for (
auto &zone :
m_fieldsALE[0]->GetGraph()->GetMovement()->GetZones())
241 if (zone.second->GetMoved())
243 auto conEl = zone.second->GetConstituentElements();
250 ->GetExpFromGeomId(i->GetGlobalID())
252 for (
int j = 0; j < nfaces; ++j)
255 ->GetExpFromGeomId(i->GetGlobalID())
256 ->ComputeTraceNormal(j);
270 m_fieldsALE[0]->GetTrace()->GetNormals(traceNormals);
283 m_fieldsALE[0]->GetGraph()->GetMovement()->GetCoordExchangeFlag() =
true;
295 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneFixed>(zone))
307 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneTranslate>(zone))
316 auto vel =
m_zone->GetVel(time);
317 auto exp = fields[0]->GetExp();
319 auto elements =
m_zone->GetElements();
320 for (
auto &el : elements)
322 int indx = fields[0]->GetElmtToExpId(el->GetGlobalID());
323 int offset = fields[0]->GetPhys_Offset(indx);
324 auto expansion = (*exp)[indx];
326 int nq = expansion->GetTotPoints();
327 for (
int i = 0; i < nq; ++i)
329 for (
int j = 0; j < gridVelocity.size(); ++j)
331 gridVelocity[j][offset + i] += vel[j];
338 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneRotate>(zone))
347 auto angVel =
m_zone->GetAngularVel(time);
351 auto exp = fields[0]->GetExp();
353 auto elements =
m_zone->GetElements();
354 for (
auto &el : elements)
356 int indx = fields[0]->GetElmtToExpId(el->GetGlobalID());
357 int offset = fields[0]->GetPhys_Offset(indx);
358 auto expansion = (*exp)[indx];
360 int nq = expansion->GetTotPoints();
364 expansion->GetCoords(xc, yc, zc);
365 for (
int i = 0; i < nq; ++i)
375 norm[0] = (ypointMinOrigin *
axis[2] - zpointMinOrigin *
axis[1]) *
377 norm[1] = (zpointMinOrigin *
axis[0] - xpointMinOrigin *
axis[2]) *
379 norm[2] = (xpointMinOrigin *
axis[1] - ypointMinOrigin *
axis[0]) *
381 for (
int j = 0; j < gridVelocity.size(); ++j)
383 gridVelocity[j][offset + i] = norm[j];
391 std::vector<std::string> &variables)
396 std::string gridVarName[3] = {
"gridVx",
"gridVy",
"gridVz"};
401 fieldcoeffs.emplace_back(gridVel);
402 variables.emplace_back(gridVarName[i]);
#define WARNINGL0(condition, msg)
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
Describes a matrix with ordering defined by a local to global map.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fieldsALE
virtual SOLVER_UTILS_EXPORT void v_ALEPreMultiplyMass(Array< OneD, Array< OneD, NekDouble > > &fields)
virtual SOLVER_UTILS_EXPORT void v_ALEInitObject(int spaceDim, Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
SOLVER_UTILS_EXPORT void ALEDoElmtInvMass(Array< OneD, Array< OneD, NekDouble > > &traceNormals, Array< OneD, Array< OneD, NekDouble > > &fields, NekDouble time)
Update m_fields with u^n by multiplying by inverse mass matrix. That's then used in e....
SOLVER_UTILS_EXPORT void InitObject(int spaceDim, Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
Array< OneD, Array< OneD, NekDouble > > m_gridVelocityTrace
SOLVER_UTILS_EXPORT void ALEDoElmtInvMassBwdTrans(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray)
SOLVER_UTILS_EXPORT void ExtraFldOutputGridVelocity(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
SOLVER_UTILS_EXPORT void MoveMesh(const NekDouble &time, Array< OneD, Array< OneD, NekDouble > > &traceNormals)
virtual SOLVER_UTILS_EXPORT void v_UpdateGridVelocity(const NekDouble &time)
NekDouble m_prevStageTime
SOLVER_UTILS_EXPORT const Array< OneD, const Array< OneD, NekDouble > > & GetGridVelocityTrace()
Array< OneD, Array< OneD, NekDouble > > m_gridVelocity
std::vector< ALEBaseShPtr > m_ALEs
const NekPoint< NekDouble > origin
std::shared_ptr< ALETranslate > ALETranslateShPtr
std::shared_ptr< ALERotate > ALERotateShPtr
std::shared_ptr< ALEFixed > ALEFixedShPtr
std::shared_ptr< ZoneBase > ZoneBaseShPtr
void v_UpdateGridVel(const NekDouble time, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, Array< OneD, Array< OneD, NekDouble > > &gridVelocity) final
ALEFixed(SpatialDomains::ZoneBaseShPtr zone)
SpatialDomains::ZoneRotateShPtr m_zone
ALERotate(SpatialDomains::ZoneBaseShPtr zone)
void v_UpdateGridVel(const NekDouble time, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, Array< OneD, Array< OneD, NekDouble > > &gridVelocity) final
SpatialDomains::ZoneTranslateShPtr m_zone
ALETranslate(SpatialDomains::ZoneBaseShPtr zone)
void v_UpdateGridVel(const NekDouble time, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, Array< OneD, Array< OneD, NekDouble > > &gridVelocity) final