Nektar++
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Nektar::SpatialDomains::ZonePrescribe Struct Referencefinal

Prescribed zone: applies equation to every point. More...

#include <Zones.h>

Inheritance diagram for Nektar::SpatialDomains::ZonePrescribe:
[legend]

Public Member Functions

 ZonePrescribe (int id, int domainID, const CompositeMap &domain, const int coordDim, LibUtilities::EquationSharedPtr xDeform, LibUtilities::EquationSharedPtr yDeform, LibUtilities::EquationSharedPtr zDeform)
 
 ~ZonePrescribe () override=default
 Default destructor. More...
 
NekDouble GetXDeform (NekDouble x, NekDouble y, NekDouble z, NekDouble t) const
 
NekDouble GetYDeform (NekDouble x, NekDouble y, NekDouble z, NekDouble t) const
 
NekDouble GetZDeform (NekDouble x, NekDouble y, NekDouble z, NekDouble t) const
 
LibUtilities::EquationSharedPtr GetXDeformEquation () const
 Returns the equation for the prescribed motion in the x-coordinate. More...
 
LibUtilities::EquationSharedPtr GetYDeformEquation () const
 Returns the equation for the prescribed motion in the y-coordinate. More...
 
LibUtilities::EquationSharedPtr GetZDeformEquation () const
 Returns the equation for the prescribed motion in the z-coordinate. More...
 
- Public Member Functions inherited from Nektar::SpatialDomains::ZoneBase
 ZoneBase (MovementType type, int indx, int domainID, CompositeMap domain, int coordDim)
 Constructor. More...
 
virtual ~ZoneBase ()=default
 Default destructor. More...
 
MovementType GetMovementType () const
 Returns the type of movement. More...
 
CompositeMap GetDomain () const
 Returns the domain the zone is on. More...
 
int & GetId ()
 Returns the zone ID. More...
 
int & GetDomainID ()
 Returns the ID of the domain making up this Zone. More...
 
bool Move (NekDouble time)
 Performs the movement of the zone at. More...
 
std::vector< GeometrySharedPtr > const & GetElements () const
 Returns all highest dimension elements in the zone. More...
 
bool & GetMoved ()
 Returns the flag which states if the zone has moved in this timestep. More...
 
void ClearBoundingBoxes ()
 Clears all bounding boxes associated with the zones elements. More...
 

Protected Member Functions

bool v_Move (NekDouble time) final
 Virtual function for movement of the zone at. More...
 
virtual bool v_Move (NekDouble time)
 Virtual function for movement of the zone at. More...
 

Protected Attributes

LibUtilities::EquationSharedPtr m_xDeform
 Equation specifying prescribed motion in x-direction. More...
 
LibUtilities::EquationSharedPtr m_yDeform
 Equation specifying prescribed motion in y-direction. More...
 
LibUtilities::EquationSharedPtr m_zDeform
 Equation specifying prescribed motion in z-direction. More...
 
- Protected Attributes inherited from Nektar::SpatialDomains::ZoneBase
MovementType m_type = MovementType::eNone
 Type of zone movement. More...
 
int m_id
 Zone ID. More...
 
int m_domainID
 ID for the composite making up this zone. More...
 
CompositeMap m_domain
 Zone domain. More...
 
std::vector< GeometrySharedPtrm_elements
 Vector of highest dimension zone elements. More...
 
bool m_moved = true
 Moved flag. More...
 
int m_coordDim
 Coordinate dimension. More...
 
std::vector< PointGeomSharedPtrm_verts
 Vector of all points in the zone. More...
 
std::vector< CurveSharedPtrm_curves
 Vector of all curves in the zone. More...
 
std::vector< PointGeomm_origVerts
 Vector of all points in the zone at initialisation. More...
 

Detailed Description

Prescribed zone: applies equation to every point.

Definition at line 243 of file Zones.h.

Constructor & Destructor Documentation

◆ ZonePrescribe()

Nektar::SpatialDomains::ZonePrescribe::ZonePrescribe ( int  id,
int  domainID,
const CompositeMap domain,
const int  coordDim,
LibUtilities::EquationSharedPtr  xDeform,
LibUtilities::EquationSharedPtr  yDeform,
LibUtilities::EquationSharedPtr  zDeform 
)
inline

Constructor for prescribed zone

Parameters
idZone ID
domainIDID associated with the the domain making up the zone
domainDomain that the zone consists of
coordDimCoordinate dimension
xDeformEquation for prescribed motion of x-coordinate
yDeformEquation for prescribed motion of y-coordinate
zDeformEquation for prescribed motion of z-coordinate

Definition at line 257 of file Zones.h.

261 : ZoneBase(MovementType::ePrescribe, id, domainID, domain, coordDim),
262 m_xDeform(xDeform), m_yDeform(yDeform), m_zDeform(zDeform)
263 {
264 }
ZoneBase(MovementType type, int indx, int domainID, CompositeMap domain, int coordDim)
Constructor.
LibUtilities::EquationSharedPtr m_zDeform
Equation specifying prescribed motion in z-direction.
Definition: Zones.h:338
LibUtilities::EquationSharedPtr m_yDeform
Equation specifying prescribed motion in y-direction.
Definition: Zones.h:336
LibUtilities::EquationSharedPtr m_xDeform
Equation specifying prescribed motion in x-direction.
Definition: Zones.h:334

◆ ~ZonePrescribe()

Nektar::SpatialDomains::ZonePrescribe::~ZonePrescribe ( )
overridedefault

Default destructor.

Member Function Documentation

◆ GetXDeform()

NekDouble Nektar::SpatialDomains::ZonePrescribe::GetXDeform ( NekDouble  x,
NekDouble  y,
NekDouble  z,
NekDouble  t 
) const
inline

Returns point

Parameters
x

param y

Parameters
zdeformation in the x direction at time
t
xx-coordinate
yy-coordinate
zz-coordinate
ttime
Returns
deformation in x direction

Definition at line 278 of file Zones.h.

280 {
281 return m_xDeform->Evaluate(x, y, z, t);
282 }
std::vector< double > z(NPUPPER)

References m_xDeform, and Nektar::UnitTests::z().

◆ GetXDeformEquation()

LibUtilities::EquationSharedPtr Nektar::SpatialDomains::ZonePrescribe::GetXDeformEquation ( ) const
inline

Returns the equation for the prescribed motion in the x-coordinate.

Definition at line 315 of file Zones.h.

316 {
317 return m_xDeform;
318 }

References m_xDeform.

◆ GetYDeform()

NekDouble Nektar::SpatialDomains::ZonePrescribe::GetYDeform ( NekDouble  x,
NekDouble  y,
NekDouble  z,
NekDouble  t 
) const
inline

Returns point

Parameters
x

param y

Parameters
zdeformation in the y direction at time
t
xx-coordinate
yy-coordinate
zz-coordinate
ttime
Returns
deformation in y direction

Definition at line 293 of file Zones.h.

295 {
296 return m_yDeform->Evaluate(x, y, z, t);
297 }

References m_yDeform, and Nektar::UnitTests::z().

◆ GetYDeformEquation()

LibUtilities::EquationSharedPtr Nektar::SpatialDomains::ZonePrescribe::GetYDeformEquation ( ) const
inline

Returns the equation for the prescribed motion in the y-coordinate.

Definition at line 321 of file Zones.h.

322 {
323 return m_yDeform;
324 }

References m_yDeform.

◆ GetZDeform()

NekDouble Nektar::SpatialDomains::ZonePrescribe::GetZDeform ( NekDouble  x,
NekDouble  y,
NekDouble  z,
NekDouble  t 
) const
inline

Returns point

Parameters
x

param y

Parameters
zdeformation in the z direction at time
t
xx-coordinate
yy-coordinate
zz-coordinate
ttime
Returns
deformation in z direction

Definition at line 308 of file Zones.h.

310 {
311 return m_zDeform->Evaluate(x, y, z, t);
312 }

References m_zDeform, and Nektar::UnitTests::z().

◆ GetZDeformEquation()

LibUtilities::EquationSharedPtr Nektar::SpatialDomains::ZonePrescribe::GetZDeformEquation ( ) const
inline

Returns the equation for the prescribed motion in the z-coordinate.

Definition at line 327 of file Zones.h.

328 {
329 return m_zDeform;
330 }

References m_zDeform.

◆ v_Move()

bool Nektar::SpatialDomains::ZonePrescribe::v_Move ( NekDouble  time)
finalprotectedvirtual

Virtual function for movement of the zone at.

Parameters
time

Reimplemented from Nektar::SpatialDomains::ZoneBase.

Definition at line 284 of file Movement/Zones.cpp.

285{
286 int cnt = 0;
287 for (auto &vert : m_verts)
288 {
289 auto pnt = m_origVerts[cnt++];
290
291 Array<OneD, NekDouble> coords(3, 0.0);
292 vert->GetCoords(coords);
293
294 Array<OneD, NekDouble> newLoc(3, 0.0);
295 newLoc[0] =
296 m_xDeform->Evaluate(coords[0], coords[1], coords[2], time) + pnt(0);
297 newLoc[1] =
298 m_yDeform->Evaluate(coords[0], coords[1], coords[2], time) + pnt(1);
299 newLoc[2] =
300 m_zDeform->Evaluate(coords[0], coords[1], coords[2], time) + pnt(2);
301
302 vert->UpdatePosition(newLoc[0], newLoc[1], newLoc[2]);
303 }
304
306
307 return true;
308}
std::vector< PointGeomSharedPtr > m_verts
Vector of all points in the zone.
Definition: Zones.h:131
void ClearBoundingBoxes()
Clears all bounding boxes associated with the zones elements.
std::vector< PointGeom > m_origVerts
Vector of all points in the zone at initialisation.
Definition: Zones.h:135

References Nektar::SpatialDomains::ZoneBase::ClearBoundingBoxes(), Nektar::SpatialDomains::ZoneBase::m_origVerts, Nektar::SpatialDomains::ZoneBase::m_verts, m_xDeform, m_yDeform, and m_zDeform.

Member Data Documentation

◆ m_xDeform

LibUtilities::EquationSharedPtr Nektar::SpatialDomains::ZonePrescribe::m_xDeform
protected

Equation specifying prescribed motion in x-direction.

Definition at line 334 of file Zones.h.

Referenced by GetXDeform(), GetXDeformEquation(), and v_Move().

◆ m_yDeform

LibUtilities::EquationSharedPtr Nektar::SpatialDomains::ZonePrescribe::m_yDeform
protected

Equation specifying prescribed motion in y-direction.

Definition at line 336 of file Zones.h.

Referenced by GetYDeform(), GetYDeformEquation(), and v_Move().

◆ m_zDeform

LibUtilities::EquationSharedPtr Nektar::SpatialDomains::ZonePrescribe::m_zDeform
protected

Equation specifying prescribed motion in z-direction.

Definition at line 338 of file Zones.h.

Referenced by GetZDeform(), GetZDeformEquation(), and v_Move().