Nektar++
Loading...
Searching...
No Matches
Functions
Zones.cpp File Reference
#include <SpatialDomains/Movement/Zones.h>
#include <LibUtilities/Python/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Python/NekPyConfig.hpp>
#include <SpatialDomains/Python/SpatialDomains.h>

Go to the source code of this file.

Functions

ZoneRotateShPtr ZoneRotate_Init (int id, int domainID, const CompositeMap &domain, const int coordDim, const NekPoint< NekDouble > &origin, const DNekVec &axis, const LibUtilities::EquationSharedPtr &angularVelEqn, const NekDouble rampTime, const NekDouble sector, const Array< OneD, NekDouble > &base)
 
ZoneTranslateShPtr ZoneTranslate_Init (int id, int domainID, const CompositeMap &domain, const int coordDim, const Array< OneD, LibUtilities::EquationSharedPtr > &velocityEqns, const Array< OneD, LibUtilities::EquationSharedPtr > &displacementEqns)
 
ZoneFixedShPtr ZoneFixed_Init (int id, int domainID, const CompositeMap &domain, const int coordDim)
 
void export_Zones (py::module &m)
 

Function Documentation

◆ export_Zones()

void export_Zones ( py::module &  m)

Definition at line 71 of file Python/Zones.cpp.

72{
74
75 py::class_<ZoneBase, std::shared_ptr<ZoneBase>>(m, "ZoneBase")
76 .def("GetMovementType", &ZoneBase::GetMovementType,
77 py::return_value_policy::reference_internal)
78 .def("GetDomain", &ZoneBase::GetDomain,
79 py::return_value_policy::reference_internal)
80 .def("GetId", &ZoneBase::GetId, py::return_value_policy::copy)
81 .def("GetDomainID", &ZoneBase::GetDomainID,
82 py::return_value_policy::copy)
83 .def("Move", &ZoneBase::Move)
84 .def("GetElements", &ZoneBase::GetElements,
85 py::return_value_policy::reference_internal)
86 .def("GetMoved", &ZoneBase::GetMoved, py::return_value_policy::copy)
87 .def("ClearBoundingBoxes", &ZoneBase::ClearBoundingBoxes);
88
89 py::class_<ZoneRotate, ZoneBase, std::shared_ptr<ZoneRotate>>(m,
90 "ZoneRotate")
91 .def(py::init<>(&ZoneRotate_Init))
92 .def("GetAngualrVel", &ZoneRotate::GetAngularVel)
93 .def("GetOrigin", &ZoneRotate::GetOrigin, py::return_value_policy::copy)
94 .def("GetAxis", &ZoneRotate::GetAxis, py::return_value_policy::copy)
95 .def("GetAngularVelEqn", &ZoneRotate::GetAngularVelEqn);
96
97 py::class_<ZoneTranslate, ZoneBase, std::shared_ptr<ZoneTranslate>>(
98 m, "ZoneTranslate")
99 .def(py::init<>(&ZoneTranslate_Init))
100 .def("GetVelocityEquation", &ZoneTranslate::GetVelocityEquation)
101 .def("GetDisplacementEqn", &ZoneTranslate::GetDisplacementEquation);
102
103 py::class_<ZoneFixed, ZoneBase, std::shared_ptr<ZoneFixed>>(m, "ZoneFixed")
104 .def(py::init<>(&ZoneFixed_Init));
105}
#define NEKPY_WRAP_ENUM_STRING(MOD, ENUMNAME, MAPNAME)
ZoneRotateShPtr ZoneRotate_Init(int id, int domainID, const CompositeMap &domain, const int coordDim, const NekPoint< NekDouble > &origin, const DNekVec &axis, const LibUtilities::EquationSharedPtr &angularVelEqn, const NekDouble rampTime, const NekDouble sector, const Array< OneD, NekDouble > &base)
ZoneFixedShPtr ZoneFixed_Init(int id, int domainID, const CompositeMap &domain, const int coordDim)
ZoneTranslateShPtr ZoneTranslate_Init(int id, int domainID, const CompositeMap &domain, const int coordDim, const Array< OneD, LibUtilities::EquationSharedPtr > &velocityEqns, const Array< OneD, LibUtilities::EquationSharedPtr > &displacementEqns)
MovementType
Enum of zone movement type.
Definition Zones.h:48
const std::string MovementTypeStr[]
Map of zone movement type to movement type string.
Definition Zones.h:57
bool Move(NekDouble time)
Performs the movement of the zone at.
Definition Zones.h:95
void ClearBoundingBoxes()
Clears all bounding boxes associated with the zones elements.
CompositeMap GetDomain() const
Returns the domain the zone is on.
Definition Zones.h:77
bool & GetMoved()
Returns the flag which states if the zone has moved in this timestep.
Definition Zones.h:107
MovementType GetMovementType() const
Returns the type of movement.
Definition Zones.h:71
std::vector< Geometry * > const & GetElements() const
Returns all highest dimension elements in the zone.
Definition Zones.h:101
int & GetDomainID()
Returns the ID of the domain making up this Zone.
Definition Zones.h:89
int & GetId()
Returns the zone ID.
Definition Zones.h:83
LibUtilities::EquationSharedPtr GetAngularVelEqn() const
Returns the equation for the angular velocity of the rotation.
Definition Zones.h:227
NekDouble GetAngularVel(const NekDouble &time) const
Return the angular velocity of the zone at.
const DNekVec & GetAxis() const
Returns the axis the zone rotates about.
Definition Zones.h:221
const NekPoint< NekDouble > & GetOrigin() const
Returns the origin the zone rotates about.
Definition Zones.h:215
Array< OneD, LibUtilities::EquationSharedPtr > GetDisplacementEquation() const
Returns the equation for the displacement of the translation.
Definition Zones.h:314
Array< OneD, LibUtilities::EquationSharedPtr > GetVelocityEquation() const
Returns the equation for the velocity of the translation.
Definition Zones.h:307

References Nektar::SpatialDomains::ZoneBase::ClearBoundingBoxes(), Nektar::SpatialDomains::ZoneRotate::GetAngularVel(), Nektar::SpatialDomains::ZoneRotate::GetAngularVelEqn(), Nektar::SpatialDomains::ZoneRotate::GetAxis(), Nektar::SpatialDomains::ZoneTranslate::GetDisplacementEquation(), Nektar::SpatialDomains::ZoneBase::GetDomain(), Nektar::SpatialDomains::ZoneBase::GetDomainID(), Nektar::SpatialDomains::ZoneBase::GetElements(), Nektar::SpatialDomains::ZoneBase::GetId(), Nektar::SpatialDomains::ZoneBase::GetMoved(), Nektar::SpatialDomains::ZoneBase::GetMovementType(), Nektar::SpatialDomains::ZoneRotate::GetOrigin(), Nektar::SpatialDomains::ZoneTranslate::GetVelocityEquation(), Nektar::SpatialDomains::ZoneBase::Move(), Nektar::SpatialDomains::MovementTypeStr, NEKPY_WRAP_ENUM_STRING, ZoneFixed_Init(), ZoneRotate_Init(), and ZoneTranslate_Init().

Referenced by PYBIND11_MODULE().

◆ ZoneFixed_Init()

ZoneFixedShPtr ZoneFixed_Init ( int  id,
int  domainID,
const CompositeMap domain,
const int  coordDim 
)

Definition at line 65 of file Python/Zones.cpp.

67{
68 return std::make_shared<ZoneFixed>(id, domainID, domain, coordDim);
69}

Referenced by export_Zones().

◆ ZoneRotate_Init()

ZoneRotateShPtr ZoneRotate_Init ( int  id,
int  domainID,
const CompositeMap domain,
const int  coordDim,
const NekPoint< NekDouble > &  origin,
const DNekVec axis,
const LibUtilities::EquationSharedPtr angularVelEqn,
const NekDouble  rampTime,
const NekDouble  sector,
const Array< OneD, NekDouble > &  base 
)

Definition at line 44 of file Python/Zones.cpp.

50{
51 return std::make_shared<ZoneRotate>(id, domainID, domain, coordDim, origin,
52 axis, angularVelEqn, rampTime, sector,
53 base);
54}

Referenced by export_Zones().

◆ ZoneTranslate_Init()

ZoneTranslateShPtr ZoneTranslate_Init ( int  id,
int  domainID,
const CompositeMap domain,
const int  coordDim,
const Array< OneD, LibUtilities::EquationSharedPtr > &  velocityEqns,
const Array< OneD, LibUtilities::EquationSharedPtr > &  displacementEqns 
)

Definition at line 56 of file Python/Zones.cpp.

60{
61 return std::make_shared<ZoneTranslate>(id, domainID, domain, coordDim,
62 velocityEqns, displacementEqns);
63}

Referenced by export_Zones().