Nektar++
Public Member Functions | Private Attributes | List of all members
Nektar::SolverUtils::ALERotate Struct Referencefinal

#include <ALEHelper.h>

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

Public Member Functions

 ALERotate (SpatialDomains::ZoneBaseShPtr zone)
 
void v_UpdateGridVel (const NekDouble time, Array< OneD, MultiRegions::ExpListSharedPtr > &fields, Array< OneD, Array< OneD, NekDouble > > &gridVelocity) 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)
 

Private Attributes

SpatialDomains::ZoneRotateShPtr m_zone
 

Detailed Description

Definition at line 143 of file ALEHelper.h.

Constructor & Destructor Documentation

◆ ALERotate()

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

Definition at line 337 of file ALEHelper.cpp.

338 : m_zone(std::static_pointer_cast<SpatialDomains::ZoneRotate>(zone))
339{
340}
SpatialDomains::ZoneRotateShPtr m_zone
Definition: ALEHelper.h:153

Member Function Documentation

◆ v_UpdateGridVel()

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

Implements Nektar::SolverUtils::ALEBase.

Definition at line 342 of file ALEHelper.cpp.

346{
347 auto angVel = m_zone->GetAngularVel(time);
348 auto axis = m_zone->GetAxis();
349 auto origin = m_zone->GetOrigin();
350
351 auto exp = fields[0]->GetExp();
352
353 auto elements = m_zone->GetElements();
354 for (auto &el : elements)
355 {
356 int indx = fields[0]->GetElmtToExpId(el->GetGlobalID());
357 int offset = fields[0]->GetPhys_Offset(indx);
358 auto expansion = (*exp)[indx];
359
360 int nq = expansion->GetTotPoints();
361
362 Array<OneD, NekDouble> xc(nq, 0.0), yc(nq, 0.0), zc(nq, 0.0);
363 Array<OneD, NekDouble> norm(3, 0.0);
364 expansion->GetCoords(xc, yc, zc);
365 for (int i = 0; i < nq; ++i)
366 {
367 // Vector from origin to point
368 NekDouble xpointMinOrigin = xc[i] - origin(0);
369 NekDouble ypointMinOrigin = yc[i] - origin(1);
370 NekDouble zpointMinOrigin = zc[i] - origin(2);
371
372 // Vector orthogonal to plane formed by axis and point
373 // We negate angVel here as by convention a positive angular
374 // velocity is counter-clockwise
375 norm[0] = (ypointMinOrigin * axis[2] - zpointMinOrigin * axis[1]) *
376 (-angVel);
377 norm[1] = (zpointMinOrigin * axis[0] - xpointMinOrigin * axis[2]) *
378 (-angVel);
379 norm[2] = (xpointMinOrigin * axis[1] - ypointMinOrigin * axis[0]) *
380 (-angVel);
381 for (int j = 0; j < gridVelocity.size(); ++j)
382 {
383 gridVelocity[j][offset + i] = norm[j];
384 }
385 }
386 }
387}
const NekPoint< NekDouble > origin
double NekDouble

References Nektar::MovementTests::axis, m_zone, and Nektar::MovementTests::origin.

Member Data Documentation

◆ m_zone

SpatialDomains::ZoneRotateShPtr Nektar::SolverUtils::ALERotate::m_zone
private

Definition at line 153 of file ALEHelper.h.

Referenced by v_UpdateGridVel().