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 144 of file ALEHelper.h.

Constructor & Destructor Documentation

◆ ALERotate()

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

Definition at line 339 of file ALEHelper.cpp.

340 : m_zone(std::static_pointer_cast<SpatialDomains::ZoneRotate>(zone))
341{
342}
SpatialDomains::ZoneRotateShPtr m_zone
Definition: ALEHelper.h:154

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

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

Referenced by v_UpdateGridVel().