Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Shape opt] water drain response function #12830

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "custom_utilities/input_output/universal_file_io.h"
#include "custom_utilities/search_based_functions.h"
#include "custom_utilities/response_functions/face_angle_response_function_utility.h"
#include "custom_utilities/response_functions/water_drain_response_function_utility.h"

// ==============================================================================

Expand Down Expand Up @@ -294,6 +295,14 @@ void AddCustomUtilitiesToPython(pybind11::module& m)
.def("CalculateGradient", &FaceAngleResponseFunctionUtility::CalculateGradient)
;

py::class_<WaterDrainResponseFunctionUtility >(m, "WaterDrainResponseFunctionUtility")
.def(py::init<ModelPart&, Parameters>())
.def("Initialize", &WaterDrainResponseFunctionUtility::Initialize)
.def("InitializeSolutionStep", &WaterDrainResponseFunctionUtility::InitializeSolutionStep)
.def("CalculateValue", &WaterDrainResponseFunctionUtility::CalculateValue)
.def("CalculateGradient", &WaterDrainResponseFunctionUtility::CalculateGradient)
;

// ========================================================================
// Additional operations
// ========================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ PYBIND11_MODULE(KratosShapeOptimizationApplication, m)
KRATOS_REGISTER_IN_PYTHON_3D_VARIABLE_WITH_COMPONENTS(m, BACKGROUND_NORMAL);
KRATOS_REGISTER_IN_PYTHON_3D_VARIABLE_WITH_COMPONENTS(m, OUT_OF_PLANE_DELTA);

// For water drain response
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, WATER_LEVEL);
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, WATER_VOLUMES);

// For sensitivity heatmap
KRATOS_REGISTER_IN_PYTHON_3D_VARIABLE_WITH_COMPONENTS(m, HEATMAP_DF1DX);
KRATOS_REGISTER_IN_PYTHON_VARIABLE(m, HEATMAP_DF1DALPHA);
Expand Down
Loading
Loading