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 256 of file ALEHelper.cpp.

257 : m_zone(std::static_pointer_cast<SpatialDomains::ZoneTranslate>(zone))
258{
259}
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 287 of file ALEHelper.cpp.

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

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 261 of file ALEHelper.cpp.

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

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().