45 boost::ignore_unused(spaceDim, fields);
51 boost::ignore_unused(spaceDim, fields);
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'.");
135 boost::ignore_unused(time, traceNormals);
154 int nVariables = inarray.size();
161 for (
int i = 0; i < nVariables; ++i)
164 m_fieldsALE[i]->MultiplyByElmtInvMass(inarray[i], tmp);
178 auto curvedEdges =
m_fieldsALE[0]->GetGraph()->GetCurvedEdges();
179 auto curvedFaces =
m_fieldsALE[0]->GetGraph()->GetCurvedFaces();
183 m_fieldsALE[0]->GetGraph()->GetMovement()->PerformMovement(
191 field->ResetMatrices();
197 for (
auto &zone :
m_fieldsALE[0]->GetGraph()->GetMovement()->GetZones())
199 if (zone.second->GetMoved())
201 auto conEl = zone.second->GetConstituentElements();
202 for (
const auto &i : conEl)
204 for (
const auto &j : i)
206 j->ResetNonRecursive(curvedEdges, curvedFaces);
211 for (
const auto &i : conEl[
m_fieldsALE[0]->GetShapeDimension() -
216 ->GetExpFromGeomId(i->GetGlobalID())
224 for (
auto &zone :
field->GetGraph()->GetMovement()->GetZones())
226 if (zone.second->GetMoved())
228 auto conEl = zone.second->GetConstituentElements();
234 field->GetExpFromGeomId(i->GetGlobalID())->Reset();
240 for (
auto &zone :
m_fieldsALE[0]->GetGraph()->GetMovement()->GetZones())
242 if (zone.second->GetMoved())
244 auto conEl = zone.second->GetConstituentElements();
251 ->GetExpFromGeomId(i->GetGlobalID())
253 for (
int j = 0; j < nfaces; ++j)
256 ->GetExpFromGeomId(i->GetGlobalID())
257 ->ComputeTraceNormal(j);
271 m_fieldsALE[0]->GetTrace()->GetNormals(traceNormals);
284 m_fieldsALE[0]->GetGraph()->GetMovement()->GetCoordExchangeFlag() =
true;
296 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneFixed>(zone))
304 boost::ignore_unused(time, fields, gridVelocity);
308 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneTranslate>(zone))
316 boost::ignore_unused(time);
318 auto vel =
m_zone->GetVel(time);
319 auto exp = fields[0]->GetExp();
321 auto elements =
m_zone->GetElements();
322 for (
auto &el : elements)
324 int indx = fields[0]->GetElmtToExpId(el->GetGlobalID());
325 int offset = fields[0]->GetPhys_Offset(indx);
326 auto expansion = (*exp)[indx];
328 int nq = expansion->GetTotPoints();
329 for (
int i = 0; i < nq; ++i)
331 for (
int j = 0; j < gridVelocity.size(); ++j)
333 gridVelocity[j][offset + i] += vel[j];
340 : m_zone(
std::static_pointer_cast<SpatialDomains::ZoneRotate>(zone))
348 boost::ignore_unused(time, fields, gridVelocity);
350 auto angVel =
m_zone->GetAngularVel(time);
354 auto exp = fields[0]->GetExp();
356 auto elements =
m_zone->GetElements();
357 for (
auto &el : elements)
359 int indx = fields[0]->GetElmtToExpId(el->GetGlobalID());
360 int offset = fields[0]->GetPhys_Offset(indx);
361 auto expansion = (*exp)[indx];
363 int nq = expansion->GetTotPoints();
367 expansion->GetCoords(xc, yc, zc);
368 for (
int i = 0; i < nq; ++i)
378 norm[0] = (ypointMinOrigin *
axis[2] - zpointMinOrigin *
axis[1]) *
380 norm[1] = (zpointMinOrigin *
axis[0] - xpointMinOrigin *
axis[2]) *
382 norm[2] = (xpointMinOrigin *
axis[1] - ypointMinOrigin *
axis[0]) *
384 for (
int j = 0; j < gridVelocity.size(); ++j)
386 gridVelocity[j][offset + i] = norm[j];
394 std::vector<std::string> &variables)
399 std::string gridVarName[3] = {
"gridVx",
"gridVy",
"gridVz"};
404 fieldcoeffs.emplace_back(gridVel);
405 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