Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Nektar::SolverUtils::ALETranslate Struct Referencefinal

#include <ALEHelper.h>

Inheritance diagram for Nektar::SolverUtils::ALETranslate:
[legend]

Public Member Functions

 ALETranslate (SpatialDomains::ZoneBaseShPtr zone)
 
void v_UpdateGridVel (const NekDouble time, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, Array< OneD, Array< OneD, NekDouble > > &gridVelocity) final
 
bool v_UpdateNormalsFlag () final
 
void v_ResetMatricesNormal (Array< OneD, Array< OneD, NekDouble > > &traceNormals, Array< OneD, MultiRegions::ExpListSharedPtr > &fields) final
 
- Public Member Functions inherited from Nektar::SolverUtils::ALEBase
virtual ~ALEBase ()=default
 
void UpdateGridVel (const NekDouble time, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, Array< OneD, Array< OneD, NekDouble > > &gridVelocity)
 
void ResetMatricesNormal (Array< OneD, Array< OneD, NekDouble > > &traceNormals, Array< OneD, MultiRegions::ExpListSharedPtr > &fields)
 
bool UpdateNormalsFlag ()
 

Private Attributes

SpatialDomains::ZoneTranslateShPtr m_zone
 

Additional Inherited Members

- Public Attributes inherited from Nektar::SolverUtils::ALEBase
bool m_meshDistorted = false
 

Detailed Description

Definition at line 180 of file ALEHelper.h.

Constructor & Destructor Documentation

◆ ALETranslate()

Nektar::SolverUtils::ALETranslate::ALETranslate ( SpatialDomains::ZoneBaseShPtr  zone)

Definition at line 253 of file ALEHelper.cpp.

254 : m_zone(std::static_pointer_cast<SpatialDomains::ZoneTranslate>(zone))
255{
256}
SpatialDomains::ZoneTranslateShPtr m_zone
Definition ALEHelper.h:199

Member Function Documentation

◆ v_ResetMatricesNormal()

void Nektar::SolverUtils::ALETranslate::v_ResetMatricesNormal ( Array< OneD, Array< OneD, NekDouble > > &  traceNormals,
Array< OneD, MultiRegions::ExpListSharedPtr > &  fields 
)
finalvirtual

Implements Nektar::SolverUtils::ALEBase.

Definition at line 284 of file ALEHelper.cpp.

287{
288 auto &curvedEdges = fields[0]->GetGraph()->GetCurvedEdges();
289 auto &curvedFaces = fields[0]->GetGraph()->GetCurvedFaces();
290
291 // The order of the resets below is v important to avoid errors
292 if (m_meshDistorted)
293 {
294 for (auto &field : fields)
295 {
296 field->ResetMatrices();
297 }
298 }
299
300 // Loop over all elements and faces and edges and reset geometry
301 // information. Only need to do this on the first field as the geometry
302 // information is shared.
303
304 if (m_zone->GetMoved())
305 {
306 auto conEl = m_zone->GetConstituentElements();
307 for (const auto &i : conEl)
308 {
309 for (const auto &j : i)
310 {
311 j->ResetNonRecursive(curvedEdges, curvedFaces);
312 }
313 }
314
315 // We need to rebuild geometric factors on the trace elements
316 for (const auto &i : conEl[fields[0]->GetShapeDimension() -
317 1]) // This only takes the trace elements
318 {
319 fields[0]->GetTrace()->GetExpFromGeomId(i->GetGlobalID())->Reset();
320 }
321 }
322
323 if (m_zone->GetMoved())
324 {
325 auto conEl = m_zone->GetConstituentElements();
326 // Loop over zone elements expansions and rebuild geometric
327 // factors
328 for (const auto &i :
329 conEl[0]) // This only takes highest dimensioned elements
330 {
331 fields[0]->GetExpFromGeomId(i->GetGlobalID())->Reset();
332 }
333 }
334
335 for (auto &field : fields)
336 {
337 // Reset collections (despite the default being eNoCollection it does
338 // remember the last auto-tuned values), eNoImpType gives lots of output
339 field->CreateCollections(Collections::eNoCollection);
340 }
341}

References Nektar::Collections::eNoCollection, Nektar::SolverUtils::ALEBase::m_meshDistorted, and m_zone.

◆ v_UpdateGridVel()

void Nektar::SolverUtils::ALETranslate::v_UpdateGridVel ( const NekDouble  time,
Array< OneD, MultiRegions::ExpListSharedPtr > &  fields,
Array< OneD, Array< OneD, NekDouble > > &  gridVelocity 
)
finalvirtual

Implements Nektar::SolverUtils::ALEBase.

Definition at line 258 of file ALEHelper.cpp.

262{
263 auto vel = m_zone->GetVel(time);
264 auto exp = fields[0]->GetExp();
265
266 auto elements = m_zone->GetElements();
267 for (auto &el : elements)
268 {
269 int indx = fields[0]->GetElmtToExpId(el->GetGlobalID());
270 int offset = fields[0]->GetPhys_Offset(indx);
271 auto expansion = (*exp)[indx];
272
273 int nq = expansion->GetTotPoints();
274 for (int i = 0; i < nq; ++i)
275 {
276 for (int j = 0; j < gridVelocity.size(); ++j)
277 {
278 gridVelocity[j][offset + i] += vel[j];
279 }
280 }
281 }
282}

References m_zone.

◆ v_UpdateNormalsFlag()

bool Nektar::SolverUtils::ALETranslate::v_UpdateNormalsFlag ( )
inlinefinalvirtual

Implements Nektar::SolverUtils::ALEBase.

Definition at line 189 of file ALEHelper.h.

190 {
191 return false;
192 }

Member Data Documentation

◆ m_zone

SpatialDomains::ZoneTranslateShPtr Nektar::SolverUtils::ALETranslate::m_zone
private

Definition at line 199 of file ALEHelper.h.

Referenced by v_ResetMatricesNormal(), and v_UpdateGridVel().