Nektar++
Python/Zones.cpp
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////////////
2//
3// File: Zones.cpp
4//
5// For more information, please see: http://www.nektar.info/
6//
7// The MIT License
8//
9// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10// Department of Aeronautics, Imperial College London (UK), and Scientific
11// Computing and Imaging Institute, University of Utah (USA).
12//
13// Permission is hereby granted, free of charge, to any person obtaining a
14// copy of this software and associated documentation files (the "Software"),
15// to deal in the Software without restriction, including without limitation
16// the rights to use, copy, modify, merge, publish, distribute, sublicense,
17// and/or sell copies of the Software, and to permit persons to whom the
18// Software is furnished to do so, subject to the following conditions:
19//
20// The above copyright notice and this permission notice shall be included
21// in all copies or substantial portions of the Software.
22//
23// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29// DEALINGS IN THE SOFTWARE.
30//
31// Description: Python wrapper for Zones.
32//
33////////////////////////////////////////////////////////////////////////////////
34
36
40
41using namespace Nektar;
42using namespace Nektar::SpatialDomains;
43
44ZoneRotateShPtr ZoneRotate_Init(int id, int domainID,
45 const CompositeMap &domain, const int coordDim,
47 const DNekVec &axis,
49{
50 return std::make_shared<ZoneRotate>(id, domainID, domain, coordDim, origin,
51 axis, angularVelEqn);
52}
53
55 int id, int domainID, const CompositeMap &domain, const int coordDim,
58{
59 return std::make_shared<ZoneTranslate>(id, domainID, domain, coordDim,
60 velocityEqns, displacementEqns);
61}
62
63ZoneFixedShPtr ZoneFixed_Init(int id, int domainID, const CompositeMap &domain,
64 const int coordDim)
65{
66 return std::make_shared<ZoneFixed>(id, domainID, domain, coordDim);
67}
68
69void export_Zones(py::module &m)
70{
72
73 py::class_<ZoneBase, std::shared_ptr<ZoneBase>>(m, "ZoneBase")
74 .def("GetMovementType", &ZoneBase::GetMovementType,
75 py::return_value_policy::reference_internal)
76 .def("GetDomain", &ZoneBase::GetDomain,
77 py::return_value_policy::reference_internal)
78 .def("GetId", &ZoneBase::GetId, py::return_value_policy::copy)
79 .def("GetDomainID", &ZoneBase::GetDomainID,
81 .def("Move", &ZoneBase::Move)
82 .def("GetElements", &ZoneBase::GetElements,
83 py::return_value_policy::reference_internal)
84 .def("GetMoved", &ZoneBase::GetMoved, py::return_value_policy::copy)
85 .def("ClearBoundingBoxes", &ZoneBase::ClearBoundingBoxes);
86
87 py::class_<ZoneRotate, ZoneBase, std::shared_ptr<ZoneRotate>>(m,
88 "ZoneRotate")
89 .def(py::init<>(&ZoneRotate_Init))
90 .def("GetAngualrVel", &ZoneRotate::GetAngularVel)
91 .def("GetOrigin", &ZoneRotate::GetOrigin, py::return_value_policy::copy)
92 .def("GetAxis", &ZoneRotate::GetAxis, py::return_value_policy::copy)
93 .def("GetAngularVelEqn", &ZoneRotate::GetAngularVelEqn);
94
95 py::class_<ZoneTranslate, ZoneBase, std::shared_ptr<ZoneTranslate>>(
96 m, "ZoneTranslate")
97 .def(py::init<>(&ZoneTranslate_Init))
98 .def("GetVelocityEquation", &ZoneTranslate::GetVelocityEquation)
99 .def("GetDisplacementEqn", &ZoneTranslate::GetDisplacementEquation);
100
101 py::class_<ZoneFixed, ZoneBase, std::shared_ptr<ZoneFixed>>(m, "ZoneFixed")
102 .def(py::init<>(&ZoneFixed_Init));
103}
104
105//
#define NEKPY_WRAP_ENUM_STRING(MOD, ENUMNAME, MAPNAME)
Definition: NekPyConfig.hpp:62
void export_Zones(py::module &m)
ZoneRotateShPtr ZoneRotate_Init(int id, int domainID, const CompositeMap &domain, const int coordDim, const NekPoint< NekDouble > &origin, const DNekVec &axis, LibUtilities::EquationSharedPtr &angularVelEqn)
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)
def copy(self)
Definition: pycml.py:2663
std::shared_ptr< Equation > EquationSharedPtr
Definition: Equation.h:125
const NekPoint< NekDouble > origin
std::shared_ptr< ZoneTranslate > ZoneTranslateShPtr
Definition: Zones.h:314
std::shared_ptr< ZoneRotate > ZoneRotateShPtr
Definition: Zones.h:313
MovementType
Enum of zone movement type.
Definition: Zones.h:48
std::shared_ptr< ZoneFixed > ZoneFixedShPtr
Definition: Zones.h:315
const std::string MovementTypeStr[]
Map of zone movement type to movement type string.
Definition: Zones.h:57
std::map< int, CompositeSharedPtr > CompositeMap
Definition: MeshGraph.h:136