Skip to content
Snippets Groups Projects
Commit 1f827a57 authored by Sven Marcus's avatar Sven Marcus
Browse files

Adds State class to geometry Python module

parent d6f0eceb
No related branches found
No related tags found
No related merge requests found
from pyfluids import Simulation from pyfluids import Simulation
from pyfluids.boundaryconditions import NoSlipBCAdapter, NoSlipBCAlgorithm from pyfluids.boundaryconditions import NoSlipBCAdapter, NoSlipBCAlgorithm
from pyfluids.geometry import GbCuboid3D from pyfluids.geometry import GbCuboid3D, State
from pyfluids.kernel import LBMKernel, KernelType from pyfluids.kernel import LBMKernel, KernelType
from pyfluids.parameters import SimulationParameters, GridParameters, PhysicalParameters from pyfluids.parameters import SimulationParameters, GridParameters, PhysicalParameters
from pyfluids.writer import Writer, WriterType from pyfluids.writer import Writer, WriterType
...@@ -56,7 +56,7 @@ def run_simulation(physical_params=physical_params, grid_params=grid_params, sim ...@@ -56,7 +56,7 @@ def run_simulation(physical_params=physical_params, grid_params=grid_params, sim
g_max_x2 + block_length, g_max_x2 + block_length,
g_min_x3), g_min_x3),
no_slip_adapter, no_slip_adapter,
1, "/geo/addWallZMin") State.SOLID, "/geo/addWallZMin")
simulation.add_object( simulation.add_object(
GbCuboid3D(g_min_x1 - block_length, GbCuboid3D(g_min_x1 - block_length,
...@@ -66,7 +66,7 @@ def run_simulation(physical_params=physical_params, grid_params=grid_params, sim ...@@ -66,7 +66,7 @@ def run_simulation(physical_params=physical_params, grid_params=grid_params, sim
g_max_x2 + block_length, g_max_x2 + block_length,
g_max_x3 + block_length), g_max_x3 + block_length),
no_slip_adapter, no_slip_adapter,
1, "/geo/addWallZMax") State.SOLID, "/geo/addWallZMax")
simulation.run_simulation() simulation.run_simulation()
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <geometry3d/GbObject3D.h> #include <geometry3d/GbObject3D.h>
#include <geometry3d/GbCuboid3D.h> #include <geometry3d/GbCuboid3D.h>
#include <geometry3d/GbLine3D.h> #include <geometry3d/GbLine3D.h>
#include <Interactors/Interactor3D.h>
namespace py = pybind11; namespace py = pybind11;
...@@ -63,4 +64,13 @@ void makeGeometryModule(py::module &parentModule) ...@@ -63,4 +64,13 @@ void makeGeometryModule(py::module &parentModule)
<< "point2: " << GbPoint3D_repr_(instance.getPoint2()) << ">"; << "point2: " << GbPoint3D_repr_(instance.getPoint2()) << ">";
return stream.str(); return stream.str();
}); });
py::class_<Interactor3D, std::shared_ptr<Interactor3D>>(geometry, "State")
.def_readonly_static("SOLID", &Interactor3D::SOLID)
.def_readonly_static("INVERSESOLID", &Interactor3D::INVERSESOLID)
.def_readonly_static("TIMEDEPENDENT", &Interactor3D::TIMEDEPENDENT)
.def_readonly_static("FLUID", &Interactor3D::FLUID)
.def_readonly_static("MOVEABLE", &Interactor3D::MOVEABLE)
.def_readonly_static("CHANGENOTNECESSARY", &Interactor3D::CHANGENOTNECESSARY);
} }
\ No newline at end of file
...@@ -30,4 +30,5 @@ void makeParametersModule(py::module &parentModule) ...@@ -30,4 +30,5 @@ void makeParametersModule(py::module &parentModule)
.def_readwrite("number_of_timesteps", &SimulationParameters::numberOfTimeSteps) .def_readwrite("number_of_timesteps", &SimulationParameters::numberOfTimeSteps)
.def_readwrite("timestep_log_interval", &SimulationParameters::timeStepLogInterval) .def_readwrite("timestep_log_interval", &SimulationParameters::timeStepLogInterval)
.def_readwrite("number_of_threads", &SimulationParameters::numberOfThreads); .def_readwrite("number_of_threads", &SimulationParameters::numberOfThreads);
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment