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'.");
157 int nVariables = inarray.size();
164 for (
int i = 0; i < nVariables; ++i)
167 m_fieldsALE[i]->MultiplyByElmtInvMass(inarray[i], tmp);
183 m_fieldsALE[0]->GetGraph()->GetMovement()->PerformMovement(
201 m_fieldsALE[0]->GetGraph()->GetMovement()->GetCoordExchangeFlag() =
true;
212 ALE->ResetMatricesNormal(traceNormals,
m_fieldsALE);
221 if (ALE->UpdateNormalsFlag())
236 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneFixed>(zone))
254 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneTranslate>(zone))
263 auto vel =
m_zone->GetVel(time);
264 auto exp = fields[0]->GetExp();
266 auto elements =
m_zone->GetElements();
267 for (
auto &el : elements)
269 int indx = fields[0]->GetElmtToExpId(el->GetGlobalID());
270 int offset = fields[0]->GetPhys_Offset(indx);
271 auto expansion = (*exp)[indx];
273 int nq = expansion->GetTotPoints();
274 for (
int i = 0; i < nq; ++i)
276 for (
int j = 0; j < gridVelocity.size(); ++j)
278 gridVelocity[j][offset + i] += vel[j];
288 auto &curvedEdges = fields[0]->GetGraph()->GetCurvedEdges();
289 auto &curvedFaces = fields[0]->GetGraph()->GetCurvedFaces();
294 for (
auto &field : fields)
296 field->ResetMatrices();
306 auto conEl =
m_zone->GetConstituentElements();
307 for (
const auto &i : conEl)
309 for (
const auto &j : i)
311 j->ResetNonRecursive(curvedEdges, curvedFaces);
316 for (
const auto &i : conEl[fields[0]->GetShapeDimension() -
319 fields[0]->GetTrace()->GetExpFromGeomId(i->GetGlobalID())->Reset();
325 auto conEl =
m_zone->GetConstituentElements();
331 fields[0]->GetExpFromGeomId(i->GetGlobalID())->Reset();
335 for (
auto &field : fields)
344 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneRotate>(zone))
354 auto angVel =
m_zone->GetAngularVel(time);
355 auto axis =
m_zone->GetAxis();
356 auto origin =
m_zone->GetOrigin();
358 auto exp = fields[0]->GetExp();
360 auto elements =
m_zone->GetElements();
361 for (
auto &el : elements)
363 int indx = fields[0]->GetElmtToExpId(el->GetGlobalID());
364 int offset = fields[0]->GetPhys_Offset(indx);
365 auto expansion = (*exp)[indx];
367 int nq = expansion->GetTotPoints();
371 expansion->GetCoords(xc, yc, zc);
372 for (
int i = 0; i < nq; ++i)
375 NekDouble xpointMinOrigin = xc[i] - origin(0);
376 NekDouble ypointMinOrigin = yc[i] - origin(1);
377 NekDouble zpointMinOrigin = zc[i] - origin(2);
382 norm[0] = (ypointMinOrigin * axis[2] - zpointMinOrigin * axis[1]) *
384 norm[1] = (zpointMinOrigin * axis[0] - xpointMinOrigin * axis[2]) *
386 norm[2] = (xpointMinOrigin * axis[1] - ypointMinOrigin * axis[0]) *
388 for (
int j = 0; j < gridVelocity.size(); ++j)
390 gridVelocity[j][offset + i] = norm[j];
401 auto &curvedEdges = fields[0]->GetGraph()->GetCurvedEdges();
402 auto &curvedFaces = fields[0]->GetGraph()->GetCurvedFaces();
407 for (
auto &field : fields)
409 field->ResetMatrices();
418 auto conEl =
m_zone->GetConstituentElements();
419 for (
const auto &i : conEl)
421 for (
const auto &j : i)
423 j->ResetNonRecursive(curvedEdges, curvedFaces);
428 for (
const auto &i : conEl[fields[0]->GetShapeDimension() -
431 fields[0]->GetTrace()->GetExpFromGeomId(i->GetGlobalID())->Reset();
437 auto conEl =
m_zone->GetConstituentElements();
443 fields[0]->GetExpFromGeomId(i->GetGlobalID())->Reset();
449 auto conEl =
m_zone->GetConstituentElements();
456 fields[0]->GetExpFromGeomId(i->GetGlobalID())->GetNtraces();
457 for (
int j = 0; j < nfaces; ++j)
460 ->GetExpFromGeomId(i->GetGlobalID())
461 ->ComputeTraceNormal(j);
466 for (
auto &field : fields)
474 fields[0]->GetTrace()->GetNormals(traceNormals);
479 std::vector<std::string> &variables)
484 std::string gridVarName[3] = {
"gridVx",
"gridVy",
"gridVz"};
489 fieldcoeffs.emplace_back(gridVel);
490 variables.emplace_back(gridVarName[i]);
496 std::vector<std::string> &variables)
502 std::string gridXName[3] = {
"gridX",
"gridY",
"gridZ"};
532 fieldcoeffs.emplace_back(coeffs);
533 variables.emplace_back(gridXName[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
SOLVER_UTILS_EXPORT void UpdateNormalsFlag()
virtual SOLVER_UTILS_EXPORT void v_ALEPreMultiplyMass(Array< OneD, Array< OneD, NekDouble > > &fields)
SOLVER_UTILS_EXPORT void ExtraFldOutputGrid(std::vector< Array< OneD, NekDouble > > &fieldcoeffs, std::vector< std::string > &variables)
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 ResetMatricesNormal(Array< OneD, Array< OneD, NekDouble > > &traceNormals)
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
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)
void v_ResetMatricesNormal(Array< OneD, Array< OneD, NekDouble > > &traceNormals, Array< OneD, MultiRegions::ExpListSharedPtr > &fields) final
SpatialDomains::ZoneRotateShPtr m_zone
void v_ResetMatricesNormal(Array< OneD, Array< OneD, NekDouble > > &traceNormals, Array< OneD, MultiRegions::ExpListSharedPtr > &fields) final
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_ResetMatricesNormal(Array< OneD, Array< OneD, NekDouble > > &traceNormals, Array< OneD, MultiRegions::ExpListSharedPtr > &fields) final
void v_UpdateGridVel(const NekDouble time, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, Array< OneD, Array< OneD, NekDouble > > &gridVelocity) final