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

Go to the source code of this file.

Functions

void export_Geometry (py::module &m)
 
void export_Curve (py::module &m)
 
void export_MeshGraph (py::module &m)
 MeshGraph exports.
 
void export_MeshGraphIO (py::module &m)
 
void export_GeomElements (py::module &m)
 
void export_Zones (py::module &m)
 
void export_Interfaces (py::module &m)
 
void export_Movement (py::module &m)
 
 PYBIND11_MODULE (_SpatialDomains, m)
 

Function Documentation

◆ export_Curve()

void export_Curve ( py::module &  m)

Definition at line 61 of file Curve.cpp.

62{
63 py::class_<Curve, std::shared_ptr<Curve>>(m, "Curve")
64
65 .def(py::init<int, LibUtilities::PointsType>())
66
67 .def_readwrite("curveID", &Curve::m_curveID)
68 .def_readwrite("ptype", &Curve::m_ptype)
69 .def_property("points", &Curve_GetPoints, &Curve_SetPoints);
70}
py::list Curve_GetPoints(CurveSharedPtr curve)
Definition Curve.cpp:41
void Curve_SetPoints(CurveSharedPtr curve, py::list &pts)
Definition Curve.cpp:51
LibUtilities::PointsType m_ptype
Points distribution of this curve.
Definition Curve.hpp:57
int m_curveID
ID of the edge or face that is curved.
Definition Curve.hpp:55

References Curve_GetPoints(), Curve_SetPoints(), Nektar::SpatialDomains::Curve::m_curveID, and Nektar::SpatialDomains::Curve::m_ptype.

Referenced by PYBIND11_MODULE().

◆ export_GeomElements()

void export_GeomElements ( py::module &  m)

Definition at line 142 of file GeomElements.cpp.

143{
144 // Geometry dimensioned base classes
145 py::classh<Geometry1D, Geometry>(m, "Geometry1D");
146 py::classh<Geometry2D, Geometry>(m, "Geometry2D")
147 .def("GetCurve", &Geometry2D::GetCurve,
148 py::return_value_policy::reference);
149 py::classh<Geometry3D, Geometry>(m, "Geometry3D");
150
151 // Point geometries
152 py::classh<PointGeom, Geometry>(m, "PointGeom")
153 .def(py::init<>(&PointGeom_Init), py::arg("coordim"), py::arg("id"),
154 py::arg("x"), py::arg("y"), py::arg("z"))
155 .def("GetCoordinates", &PointGeom_GetCoordinates);
156
157 // Segment geometries
158 py::classh<SegGeom, Geometry>(m, "SegGeom")
159 .def(py::init<>(&SegGeom_Init), py::arg("id"), py::arg("coordim"),
160 py::arg("points") = py::list(),
161 py::arg("curve") = CurveSharedPtr())
162 .def("GetCurve", &SegGeom::GetCurve);
163
164 export_Geom_2d<TriGeom, SegGeom>(m, "TriGeom");
165 export_Geom_2d<QuadGeom, SegGeom>(m, "QuadGeom");
166 export_Geom_3d<TetGeom, TriGeom>(m, "TetGeom");
167 export_Geom_3d<PrismGeom, Geometry2D>(m, "PrismGeom");
168 export_Geom_3d<PyrGeom, Geometry2D>(m, "PyrGeom");
169 export_Geom_3d<HexGeom, QuadGeom>(m, "HexGeom");
170}
py::tuple PointGeom_GetCoordinates(const PointGeom &self)
unique_ptr_objpool< SegGeom > SegGeom_Init(int id, int coordim, py::list &points, CurveSharedPtr curve)
unique_ptr_objpool< PointGeom > PointGeom_Init(int coordim, int id, NekDouble x, NekDouble y, NekDouble z)
CurveSharedPtr GetCurve()
Definition SegGeom.h:80
std::shared_ptr< Curve > CurveSharedPtr
Definition Curve.hpp:60

References Nektar::SpatialDomains::Geometry2D::GetCurve(), Nektar::SpatialDomains::SegGeom::GetCurve(), PointGeom_GetCoordinates(), PointGeom_Init(), and SegGeom_Init().

Referenced by PYBIND11_MODULE().

◆ export_Geometry()

void export_Geometry ( py::module &  m)

Definition at line 64 of file Python/Geometry.cpp.

65{
66 py::classh<Geometry>(m, "Geometry")
67 .def("GetCoordim", &Geometry::GetCoordim)
68 .def("GetGlobalID", &Geometry::GetGlobalID)
69 .def("SetGlobalID", &Geometry::SetGlobalID)
70
71 .def("Setup", &Geometry::Setup)
72 .def("FillGeom", &Geometry::FillGeom)
73 .def("GenGeomFactors", &Geometry_GenGeomFactors)
74 .def("IsValid", &Geometry_IsValid)
75
76 .def("ContainsPoint", &Geometry_ContainsPoint)
77
78 .def("GetVertex", &Geometry::GetVertex,
79 py::return_value_policy::reference)
80 .def("GetEdge", &Geometry::GetEdge, py::return_value_policy::reference)
81 .def("GetFace", &Geometry::GetFace, py::return_value_policy::reference)
82 .def("GetVid", &Geometry::GetVid)
83 .def("GetEid", &Geometry::GetEid)
84 .def("GetFid", &Geometry::GetFid)
85 .def("GetTid", &Geometry::GetTid)
86
87 .def("GetNumVerts", &Geometry::GetNumVerts)
88 .def("GetNumEdges", &Geometry::GetNumEdges)
89 .def("GetNumFaces", &Geometry::GetNumFaces)
90 .def("GetShapeDim", &Geometry::GetShapeDim)
91 .def("GetShapeType", &Geometry::GetShapeType)
92 .def("GetEorient", &Geometry::GetEorient)
93 .def("GetForient", &Geometry::GetForient)
94
95 .def("GetXmap", &Geometry::GetXmap)
96 .def("GetCoeffs", &Geometry::GetCoeffs);
97}
bool Geometry_ContainsPoint(Geometry *geom, const Array< OneD, const NekDouble > &gloCoord)
void Geometry_GenGeomFactors(Geometry *geom)
bool Geometry_IsValid(Geometry *geom)
LibUtilities::ShapeType GetShapeType(void)
Get the geometric shape type of this object.
Definition Geometry.h:314
void SetGlobalID(int globalid)
Set the ID of this object.
Definition Geometry.h:330
int GetNumFaces() const
Get the number of faces of this object.
Definition Geometry.h:419
int GetShapeDim() const
Get the object's shape dimension.
Definition Geometry.h:430
int GetVid(int i) const
Returns global id of vertex i of this object.
Definition Geometry.h:353
const Array< OneD, const NekDouble > & GetCoeffs(const int i) const
Return the coefficients of the transformation Geometry::m_xmap in coordinate direction i.
Definition Geometry.h:448
int GetGlobalID(void) const
Get the ID of this object.
Definition Geometry.h:322
PointGeom * GetVertex(int i) const
Returns vertex i of this object.
Definition Geometry.h:361
int GetCoordim() const
Return the coordinate dimension of this object (i.e. the dimension of the space in which this object ...
Definition Geometry.h:279
int GetFid(int i) const
Get the ID of face i of this object.
Definition Geometry.cpp:118
void FillGeom()
Populate the coordinate mapping Geometry::m_coeffs information from any children geometry elements.
Definition Geometry.h:460
StdRegions::StdExpansionSharedPtr GetXmap() const
Return the mapping object Geometry::m_xmap that represents the coordinate transformation from standar...
Definition Geometry.h:439
int GetNumEdges() const
Get the number of edges of this object.
Definition Geometry.h:411
int GetNumVerts() const
Get the number of vertices of this object.
Definition Geometry.h:403
Geometry1D * GetEdge(int i) const
Returns edge i of this object.
Definition Geometry.h:369
Geometry2D * GetFace(int i) const
Returns face i of this object.
Definition Geometry.h:377
StdRegions::Orientation GetEorient(const int i) const
Returns the orientation of edge i with respect to the ordering of edges in the standard element.
Definition Geometry.h:386
int GetTid(int i) const
Get the ID of trace i of this object.
Definition Geometry.h:341
int GetEid(int i) const
Get the ID of edge i of this object.
Definition Geometry.cpp:110
StdRegions::Orientation GetForient(const int i) const
Returns the orientation of face i with respect to the ordering of faces in the standard element.
Definition Geometry.h:395

References Nektar::SpatialDomains::Geometry::FillGeom(), Geometry_ContainsPoint(), Geometry_GenGeomFactors(), Geometry_IsValid(), Nektar::SpatialDomains::Geometry::GetCoeffs(), Nektar::SpatialDomains::Geometry::GetCoordim(), Nektar::SpatialDomains::Geometry::GetEdge(), Nektar::SpatialDomains::Geometry::GetEid(), Nektar::SpatialDomains::Geometry::GetEorient(), Nektar::SpatialDomains::Geometry::GetFace(), Nektar::SpatialDomains::Geometry::GetFid(), Nektar::SpatialDomains::Geometry::GetForient(), Nektar::SpatialDomains::Geometry::GetGlobalID(), Nektar::SpatialDomains::Geometry::GetNumEdges(), Nektar::SpatialDomains::Geometry::GetNumFaces(), Nektar::SpatialDomains::Geometry::GetNumVerts(), Nektar::SpatialDomains::Geometry::GetShapeDim(), Nektar::SpatialDomains::Geometry::GetShapeType(), Nektar::SpatialDomains::Geometry::GetTid(), Nektar::SpatialDomains::Geometry::GetVertex(), Nektar::SpatialDomains::Geometry::GetVid(), Nektar::SpatialDomains::Geometry::GetXmap(), Nektar::SpatialDomains::Geometry::SetGlobalID(), and Nektar::SpatialDomains::Geometry::Setup().

Referenced by PYBIND11_MODULE().

◆ export_Interfaces()

void export_Interfaces ( py::module &  m)

Definition at line 54 of file Interfaces.cpp.

55{
56 py::bind_vector<std::vector<unsigned int>>(m, "UIntList");
57
58 py::class_<Interface, std::shared_ptr<Interface>>(m, "Interface")
59 .def(py::init<>(&Interface_Init))
60 .def<const std::map<int, Geometry *> &(Interface::*)() const>(
61 "GetEdge", &Interface::GetEdge,
62 py::return_value_policy::reference_internal)
63 .def("IsEmpty", &Interface::IsEmpty)
64 .def("GetId", &Interface::GetId, py::return_value_policy::copy)
65 .def("GetOppInterace", &Interface::GetOppInterface,
66 py::return_value_policy::reference_internal)
67 .def("GetCompositeIDs", &Interface::GetCompositeIDs,
68 py::return_value_policy::copy);
69
70 py::class_<InterfacePair, std::shared_ptr<InterfacePair>>(m,
71 "InterfacePair")
72 .def(py::init<>(&InterfacePair_Init))
73 .def("GetLeftInterface", &InterfacePair::GetLeftInterface,
74 py::return_value_policy::copy)
75 .def("GetRightInterface", &InterfacePair::GetRightInterface,
76 py::return_value_policy::copy);
77}
std::shared_ptr< InterfacePair > InterfacePair_Init(const InterfaceShPtr &leftInterface, const InterfaceShPtr &rightInterface)
std::shared_ptr< Interface > Interface_Init(int indx, const CompositeMap &edge, bool skipCoordCheck)
A interface which is a single edge on a zone for handling non-conformality.
const InterfaceShPtr & GetRightInterface() const
Return the 'right' interface from the interface pair.
const InterfaceShPtr & GetLeftInterface() const
Return the 'left' interface from the interface pair.

References Nektar::SpatialDomains::Interface::GetCompositeIDs(), Nektar::SpatialDomains::Interface::GetEdge(), Nektar::SpatialDomains::Interface::GetId(), Nektar::SpatialDomains::InterfacePair::GetLeftInterface(), Nektar::SpatialDomains::Interface::GetOppInterface(), Nektar::SpatialDomains::InterfacePair::GetRightInterface(), Interface_Init(), InterfacePair_Init(), and Nektar::SpatialDomains::Interface::IsEmpty().

Referenced by PYBIND11_MODULE().

◆ export_MeshGraph()

void export_MeshGraph ( py::module &  m)

MeshGraph exports.

Definition at line 116 of file Python/MeshGraph.cpp.

117{
118 py::bind_map<LibUtilities::FieldMetaDataMap>(m, "FieldMetaDataMap");
119 py::bind_vector<std::vector<Geometry *>>(m, "GeometryList");
120
121 py::class_<Composite, std::shared_ptr<Composite>>(m, "Composite")
122 .def(py::init<>())
123 .def(py::init<>(&Composite_Init))
124 .def_readwrite("geometries", &Composite::m_geomVec);
125
126 py::bind_map<CurveMap>(m, "CurveMap");
127 py::bind_map<CompositeMap>(m, "CompositeMap");
128 py::bind_map<std::map<int, CompositeMap>>(m, "DomainMap");
129
130 MeshGraph_GeomMapView<PointGeom>(m, "PointGeomView");
131 MeshGraph_GeomMapView<SegGeom>(m, "SegGeomView");
132 MeshGraph_GeomMapView<TriGeom>(m, "TriGeomView");
133 MeshGraph_GeomMapView<QuadGeom>(m, "QuadGeomView");
134 MeshGraph_GeomMapView<TetGeom>(m, "TetGeomView");
135 MeshGraph_GeomMapView<PyrGeom>(m, "PyrGeomView");
136 MeshGraph_GeomMapView<PrismGeom>(m, "PrismGeomView");
137 MeshGraph_GeomMapView<HexGeom>(m, "HexGeomView");
138
139 py::class_<MeshGraph, std::shared_ptr<MeshGraph>>(m, "MeshGraph")
140 .def(py::init<>())
141
142 .def("Empty", &MeshGraph::Empty)
143
144 .def("GetMeshDimension", &MeshGraph::GetMeshDimension)
145 .def("GetSpaceDimension", &MeshGraph::GetSpaceDimension)
146 .def("SetMeshDimension", &MeshGraph::SetMeshDimension)
147 .def("SetSpaceDimension", &MeshGraph::SetSpaceDimension)
148
149 .def_property_readonly("points", &MeshGraph::GetGeomMap<PointGeom>,
150 py::return_value_policy::reference_internal)
151 .def_property_readonly("segments", &MeshGraph::GetGeomMap<SegGeom>,
152 py::return_value_policy::reference_internal)
153 .def_property_readonly("quads", &MeshGraph::GetGeomMap<QuadGeom>,
154 py::return_value_policy::reference_internal)
155 .def_property_readonly("tris", &MeshGraph::GetGeomMap<TriGeom>,
156 py::return_value_policy::reference_internal)
157 .def_property_readonly("tets", &MeshGraph::GetGeomMap<TetGeom>,
158 py::return_value_policy::reference_internal)
159 .def_property_readonly("pyrs", &MeshGraph::GetGeomMap<PyrGeom>,
160 py::return_value_policy::reference_internal)
161 .def_property_readonly("prisms", &MeshGraph::GetGeomMap<PrismGeom>,
162 py::return_value_policy::reference_internal)
163 .def_property_readonly("hexes", &MeshGraph::GetGeomMap<HexGeom>,
164 py::return_value_policy::reference_internal)
165
166 .def("AddGeom", &MeshGraph_AddGeom<PointGeom>)
167 .def("AddGeom", &MeshGraph_AddGeom<SegGeom>)
168 .def("AddGeom", &MeshGraph_AddGeom<TriGeom>)
169 .def("AddGeom", &MeshGraph_AddGeom<QuadGeom>)
170
171 .def("GetVertex", &MeshGraph::GetPointGeom,
172 py::return_value_policy::reference_internal)
173 .def("GetPointGeom", &MeshGraph::GetPointGeom,
174 py::return_value_policy::reference_internal)
175 .def("GetSegGeom", &MeshGraph::GetSegGeom,
176 py::return_value_policy::reference_internal)
177 .def("GetTriGeom", &MeshGraph::GetTriGeom,
178 py::return_value_policy::reference_internal)
179 .def("GetQuadGeom", &MeshGraph::GetQuadGeom,
180 py::return_value_policy::reference_internal)
181 .def("GetHexGeom", &MeshGraph::GetHexGeom,
182 py::return_value_policy::reference_internal)
183 .def("GetPrismGeom", &MeshGraph::GetPrismGeom,
184 py::return_value_policy::reference_internal)
185 .def("GetTetGeom", &MeshGraph::GetTetGeom,
186 py::return_value_policy::reference_internal)
187 .def("GetPyrGeom", &MeshGraph::GetPyrGeom,
188 py::return_value_policy::reference_internal)
189
190 //.def("AddGeom", &MeshGraph::AddGeom<PointGeom>)
191 .def("GetCurvedEdges", &MeshGraph::GetCurvedEdges,
192 py::return_value_policy::reference_internal)
193 .def("GetCurvedFaces", &MeshGraph::GetCurvedFaces,
194 py::return_value_policy::reference_internal)
195 .def("GetComposites", &MeshGraph::GetComposites,
196 py::return_value_policy::reference_internal)
197 .def<std::map<int, CompositeMap> &(MeshGraph::*)()>(
198 "GetDomain", &MeshGraph::GetDomain,
199 py::return_value_policy::reference_internal)
200
201 .def("GetMovement", &MeshGraph::GetMovement,
202 py::return_value_policy::reference_internal)
203
204 .def("GetNumElements", &MeshGraph::GetNumElements)
205
206 .def("SetExpansionInfosToEvenlySpacedPoints",
208 .def("SetExpansionInfosToPolyOrder",
210 .def("SetExpansionInfosToPointOrder",
212}
CompositeSharedPtr Composite_Init(py::list geometries)
Base class for a spectral/hp element mesh.
Definition MeshGraph.h:290
TriGeom * GetTriGeom(int id)
Returns triangle id from the MeshGraph.
Definition MeshGraph.h:506
int GetMeshDimension()
Dimension of the mesh (can be a 1D curve in 3D space).
Definition MeshGraph.h:317
std::map< int, std::map< int, CompositeSharedPtr > > & GetDomain()
Definition MeshGraph.h:383
void SetExpansionInfoToEvenlySpacedPoints(int npoints=0)
Sets expansions to have equispaced points.
std::map< int, CompositeSharedPtr > & GetComposites()
Definition MeshGraph.h:373
PrismGeom * GetPrismGeom(int id)
Returns prism id from the MeshGraph.
Definition MeshGraph.h:538
SegGeom * GetSegGeom(int id)
Returns segment id from the MeshGraph.
Definition MeshGraph.h:498
void SetExpansionInfoToPointOrder(int npts)
Reset expansion to have specified point order npts.
void Empty(int dim, int space)
Definition MeshGraph.h:295
HexGeom * GetHexGeom(int id)
Returns hex id from the MeshGraph.
Definition MeshGraph.h:546
int GetSpaceDimension()
Dimension of the space (can be a 1D curve in 3D space).
Definition MeshGraph.h:323
PyrGeom * GetPyrGeom(int id)
Returns pyramid id from the MeshGraph.
Definition MeshGraph.h:530
void SetExpansionInfoToNumModes(int nmodes)
Reset expansion to have specified polynomial order nmodes.
MovementSharedPtr & GetMovement()
Definition MeshGraph.h:789
PointGeom * GetPointGeom(int id)
Returns vertex id from the MeshGraph.
Definition MeshGraph.h:490
QuadGeom * GetQuadGeom(int id)
Returns quadrilateral id from the MeshGraph.
Definition MeshGraph.h:514
TetGeom * GetTetGeom(int id)
Returns tetrahedron id from the MeshGraph.
Definition MeshGraph.h:522
std::vector< Geometry * > m_geomVec
Definition MeshGraph.h:175

References Composite_Init(), Nektar::SpatialDomains::MeshGraph::Empty(), Nektar::SpatialDomains::MeshGraph::GetComposites(), Nektar::SpatialDomains::MeshGraph::GetCurvedEdges(), Nektar::SpatialDomains::MeshGraph::GetCurvedFaces(), Nektar::SpatialDomains::MeshGraph::GetDomain(), Nektar::SpatialDomains::MeshGraph::GetHexGeom(), Nektar::SpatialDomains::MeshGraph::GetMeshDimension(), Nektar::SpatialDomains::MeshGraph::GetMovement(), Nektar::SpatialDomains::MeshGraph::GetNumElements(), Nektar::SpatialDomains::MeshGraph::GetPointGeom(), Nektar::SpatialDomains::MeshGraph::GetPrismGeom(), Nektar::SpatialDomains::MeshGraph::GetPyrGeom(), Nektar::SpatialDomains::MeshGraph::GetQuadGeom(), Nektar::SpatialDomains::MeshGraph::GetSegGeom(), Nektar::SpatialDomains::MeshGraph::GetSpaceDimension(), Nektar::SpatialDomains::MeshGraph::GetTetGeom(), Nektar::SpatialDomains::MeshGraph::GetTriGeom(), Nektar::SpatialDomains::Composite::m_geomVec, Nektar::SpatialDomains::MeshGraph::SetExpansionInfoToEvenlySpacedPoints(), Nektar::SpatialDomains::MeshGraph::SetExpansionInfoToNumModes(), Nektar::SpatialDomains::MeshGraph::SetExpansionInfoToPointOrder(), Nektar::SpatialDomains::MeshGraph::SetMeshDimension(), and Nektar::SpatialDomains::MeshGraph::SetSpaceDimension().

Referenced by PYBIND11_MODULE().

◆ export_MeshGraphIO()

void export_MeshGraphIO ( py::module &  m)

Definition at line 58 of file Python/MeshGraphIO.cpp.

59{
60 py::class_<MeshGraphIO, std::shared_ptr<MeshGraphIO>>(m, "MeshGraphIO")
61
62 .def("Write", &MeshGraphIO::WriteGeometry, py::arg("outfile"),
63 py::arg("defaultExp") = false,
64 py::arg("metadata") = LibUtilities::NullFieldMetaDataMap)
65
66 .def("SetMeshGraph", &MeshGraphIO::SetMeshGraph)
67
68 .def_static("Read", MeshGraphIO_Read)
69 .def_static("Create", MeshGraphIO_Create);
70}
MeshGraphSharedPtr MeshGraphIO_Read(const LibUtilities::SessionReaderSharedPtr &session)
MeshGraphIOSharedPtr MeshGraphIO_Create(std::string ioType)
void WriteGeometry(const std::string &outfilename, bool defaultExp=false, const LibUtilities::FieldMetaDataMap &metadata=LibUtilities::NullFieldMetaDataMap)
Definition MeshGraphIO.h:64
void SetMeshGraph(MeshGraphSharedPtr &meshGraph)
Definition MeshGraphIO.h:59
static FieldMetaDataMap NullFieldMetaDataMap
Definition FieldIO.h:51

References MeshGraphIO_Create(), MeshGraphIO_Read(), Nektar::LibUtilities::NullFieldMetaDataMap, Nektar::SpatialDomains::MeshGraphIO::SetMeshGraph(), and Nektar::SpatialDomains::MeshGraphIO::WriteGeometry().

Referenced by PYBIND11_MODULE().

◆ export_Movement()

void export_Movement ( py::module &  m)

Definition at line 61 of file Python/Movement.cpp.

62{
63 py::bind_map<std::map<int, ZoneBaseShPtr>>(m, "ZoneMap");
64
65 py::class_<Movement, std::shared_ptr<Movement>>(m, "Movement")
66 .def(py::init<>(&Movement_Init))
67 .def("GetInterfaces", &GetInterfaces_wrapper)
68 .def("GetZones", &Movement::GetZones, py::return_value_policy::copy)
69 .def("PerformMovement", &Movement::PerformMovement)
70 .def("AddZone", &Movement::AddZone)
71 .def("AddInterface", &Movement::AddInterface);
72}
py::dict GetInterfaces_wrapper(MovementSharedPtr movement)
MovementSharedPtr Movement_Init()
const std::map< int, ZoneBaseShPtr > & GetZones() const
Definition Movement.h:74
void PerformMovement(NekDouble timeStep)
void AddInterface(std::string name, InterfaceShPtr left, InterfaceShPtr right)
Add pair of interfaces to this data.
void AddZone(ZoneBaseShPtr zone)
Add a zone object to this Movement data.

References Nektar::SpatialDomains::Movement::AddInterface(), Nektar::SpatialDomains::Movement::AddZone(), GetInterfaces_wrapper(), Nektar::SpatialDomains::Movement::GetZones(), Movement_Init(), and Nektar::SpatialDomains::Movement::PerformMovement().

Referenced by PYBIND11_MODULE().

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

◆ PYBIND11_MODULE()

PYBIND11_MODULE ( _SpatialDomains  ,
 
)

Definition at line 47 of file SpatialDomains.cpp.

48{
50 export_Curve(m);
54 export_Zones(m);
57}
void export_Zones(py::module &m)
void export_Movement(py::module &m)
void export_MeshGraph(py::module &m)
MeshGraph exports.
void export_Curve(py::module &m)
Definition Curve.cpp:61
void export_GeomElements(py::module &m)
void export_Interfaces(py::module &m)
void export_Geometry(py::module &m)
void export_MeshGraphIO(py::module &m)

References export_Curve(), export_GeomElements(), export_Geometry(), export_Interfaces(), export_MeshGraph(), export_MeshGraphIO(), export_Movement(), and export_Zones().