Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
e0b72ec
skip some tests if MeshMovingApplication is not found.
sunethwarna Dec 19, 2025
b9f841f
add properties variable TA
sunethwarna Dec 20, 2025
b6727b2
expose to python
sunethwarna Dec 20, 2025
e38e3d5
minor comment change in PropertiesVarTA
sunethwarna Dec 20, 2025
1c8e7ef
add unit test to PropertiesVarTA
sunethwarna Dec 20, 2025
fc6c076
update mass resp utils to TA
sunethwarna Dec 22, 2025
f238976
update linear strain energy resp utils to TA
sunethwarna Dec 22, 2025
262d261
fix resp utils python exposure
sunethwarna Dec 22, 2025
39b448b
add pGetContainer method for ContainerExps
sunethwarna Dec 22, 2025
517a801
update python linear strain energy resp to TA
sunethwarna Dec 22, 2025
29cad0c
update mass response to TA
sunethwarna Dec 22, 2025
c6bfa80
response utils minor update
sunethwarna Dec 22, 2025
a307c6e
update sigmoidal utils to TA
sunethwarna Dec 22, 2025
e3314b2
update sigmoidal python exp to TA
sunethwarna Dec 22, 2025
885f3bd
update sigmoidal proj utils tests to TA
sunethwarna Dec 22, 2025
e46673a
update opt_projection.py to TA
sunethwarna Dec 22, 2025
dca09bc
Merge remote-tracking branch 'origin/master' into optapp_siapp_tensor…
sunethwarna Dec 23, 2025
1a6cfc2
Merge remote-tracking branch 'origin/master' into optapp_siapp_tensor…
sunethwarna Dec 24, 2025
48582af
change explicit damping
sunethwarna Jan 30, 2026
9fe8fe9
explicit filter utils update
sunethwarna Jan 30, 2026
6272421
integrated nearest entity update
sunethwarna Jan 30, 2026
0e07e2a
undate nearest entity update
sunethwarna Jan 30, 2026
88f320a
Merge remote-tracking branch 'origin/master' into optapp_siapp_tensor…
sunethwarna Jan 30, 2026
3dee71b
bugfix
sunethwarna Jan 30, 2026
4195300
update explicit filter python to TA
sunethwarna Jan 30, 2026
6f44f3f
update filter utils to TA
sunethwarna Jan 30, 2026
48b2333
update texplicit filter test to TA
sunethwarna Jan 30, 2026
34862e4
minor
sunethwarna Jan 30, 2026
ad5339c
move TA to submodule
sunethwarna Jan 31, 2026
e4e9e89
adding nodal neighour count TA
sunethwarna Jan 31, 2026
c002b29
minor error fix
sunethwarna Jan 31, 2026
832326d
adding nodal_neighbour ta
sunethwarna Feb 2, 2026
0e2649a
exposing to python
sunethwarna Feb 2, 2026
a1d9a8e
adding unit tests
sunethwarna Feb 2, 2026
648e818
minor
sunethwarna Feb 2, 2026
aa0c967
add design var projection unit tests
sunethwarna Feb 2, 2026
bff24e5
add current changes
sunethwarna Feb 4, 2026
947d2a9
add more checks
sunethwarna Feb 4, 2026
13d677b
fix for the explicit filter tests
sunethwarna Feb 4, 2026
ae94241
fix implicit filters
sunethwarna Feb 4, 2026
0520276
fix geometric centroid deviation response
sunethwarna Feb 4, 2026
206c1b1
remove everything related to sloly to exps.
sunethwarna Feb 4, 2026
87ae858
update discrete value response
sunethwarna Feb 4, 2026
843cbf7
update mass resp
sunethwarna Feb 4, 2026
1561ebe
fix recursive CollectData calls
sunethwarna Feb 5, 2026
5c44707
update linear strain energy resp
sunethwarna Feb 5, 2026
97c0a2a
minor
sunethwarna Feb 5, 2026
a9d0d27
string changes
sunethwarna Feb 5, 2026
ff1c6f7
further string changes
sunethwarna Feb 5, 2026
1c3ec31
update response expressions
sunethwarna Feb 5, 2026
0a4d895
update implicit filter
sunethwarna Feb 5, 2026
cffcce8
update material properties control
sunethwarna Feb 5, 2026
23de83f
minor
sunethwarna Feb 5, 2026
94e96de
update simp control
sunethwarna Feb 5, 2026
ee16838
update shape control
sunethwarna Feb 6, 2026
7924e01
update shell thickness control
sunethwarna Feb 6, 2026
9eee672
remove unnecessary tests
sunethwarna Feb 6, 2026
eaa90ac
Revert "remove unnecessary tests"
sunethwarna Feb 6, 2026
1c9f83c
minor
sunethwarna Feb 6, 2026
686e9f2
update master control
sunethwarna Feb 6, 2026
5ff12ae
remove expression tests
sunethwarna Feb 6, 2026
0fb9f75
update kratos analysis execution policy
sunethwarna Feb 6, 2026
7e856b0
update optimization problem utilities
sunethwarna Feb 6, 2026
9304412
update response routine
sunethwarna Feb 6, 2026
0bb8c11
update line search to ta
sunethwarna Feb 7, 2026
288f21b
minor
sunethwarna Feb 9, 2026
9a20fd0
update std. obj
sunethwarna Feb 9, 2026
7c9d7a9
update steepest descent
sunethwarna Feb 9, 2026
98c1ce9
update std constraint
sunethwarna Feb 9, 2026
022462a
update algo grad projection
sunethwarna Feb 9, 2026
d64e8c7
update nestrov acc. algo
sunethwarna Feb 9, 2026
d5d67a8
update relaxed grad algo
sunethwarna Feb 9, 2026
cbf94e8
add clone
sunethwarna Feb 10, 2026
bb716f0
update momentum algo
sunethwarna Feb 10, 2026
f1d9bad
update steepest descent
sunethwarna Feb 10, 2026
da75bce
update mat prop control
sunethwarna Feb 10, 2026
868bf22
use clone in controls
sunethwarna Feb 10, 2026
6fe424c
minor
sunethwarna Feb 10, 2026
4c8f866
update external resp func
sunethwarna Feb 10, 2026
cd3c87e
update opt prob ascii output process test
sunethwarna Feb 10, 2026
caba02f
minor
sunethwarna Feb 10, 2026
8a5b95f
fix conv criterion
sunethwarna Feb 11, 2026
6bf20d1
fixing resp util bugs
sunethwarna Feb 13, 2026
095eadd
update linear and mass resps
sunethwarna Feb 13, 2026
d499be4
update combined resp func
sunethwarna Feb 13, 2026
25fe9db
update vtu output to ta
sunethwarna Feb 13, 2026
7df3131
update scipy algorithms
sunethwarna Feb 13, 2026
0c660bd
update NLOpt contraint and obj
sunethwarna Feb 13, 2026
339b915
minor opt app fixes
sunethwarna Feb 13, 2026
1936803
update NLOPT algo
sunethwarna Feb 13, 2026
9cf8f18
Merge remote-tracking branch 'origin/master' into optapp_siapp_tensor…
sunethwarna Feb 13, 2026
b9279e6
Merge remote-tracking branch 'origin/master' into optapp_siapp_tensor…
sunethwarna Feb 13, 2026
84b8c3b
remove ClipContainerExpression
sunethwarna Feb 13, 2026
dc72935
remove unused expression h
sunethwarna Feb 14, 2026
cc6ee55
update smooth clamper to TA
sunethwarna Feb 17, 2026
432412e
update sensor and sensorview
sunethwarna Feb 17, 2026
9a93ed7
update mask utils to TA
sunethwarna Feb 17, 2026
3ef65fd
update distancematrix to ta
sunethwarna Feb 17, 2026
637d4b2
update exp utils to ta utils
sunethwarna Feb 17, 2026
834a0a5
update data_values_control to TA
sunethwarna Feb 17, 2026
5c60818
update response to TA
sunethwarna Feb 17, 2026
8779b6d
Remove unused 'stride' parameter from lambdas
sunethwarna Feb 18, 2026
98e1ac8
Fix lambda capture in for_each loop
sunethwarna Feb 18, 2026
309ac19
add skip for VTU future
sunethwarna Feb 19, 2026
f6105c4
port vtu_output from future
sunethwarna Feb 20, 2026
2db0a09
fix python bindings
sunethwarna Feb 20, 2026
d4542bf
fix status_stream
sunethwarna Feb 20, 2026
737b733
port xml utils from future
sunethwarna Feb 20, 2026
17dd545
update test_xml_utils
sunethwarna Feb 20, 2026
6cee9af
fix order issue with the Configuration exposure
sunethwarna Feb 20, 2026
18fbd87
update vtu_output tests
sunethwarna Feb 20, 2026
3941cd7
move test files
sunethwarna Feb 20, 2026
b224d07
update vtu output tests
sunethwarna Feb 20, 2026
713954a
update opt_prob_vtu_output
sunethwarna Feb 20, 2026
5acea56
fix explicit filter outputs
sunethwarna Feb 20, 2026
1c64625
Merge remote-tracking branch 'origin/master' into optapp_siapp_tensor…
sunethwarna Feb 21, 2026
e590176
Merge remote-tracking branch 'origin/optapp_siapp_tensor_adaptor_upda…
sunethwarna Feb 21, 2026
d9090ef
minor
sunethwarna Feb 21, 2026
8a4dd82
Merge remote-tracking branch 'origin/optapp_siapp_tensor_adaptor_upda…
sunethwarna Feb 21, 2026
325b870
minor
sunethwarna Feb 23, 2026
c518b68
Merge remote-tracking branch 'origin/optapp_siapp_tensor_adaptor_upda…
sunethwarna Feb 23, 2026
5b32d64
fix crlf prob with win and unix
sunethwarna Feb 24, 2026
4a6bcc2
minor
sunethwarna Feb 24, 2026
63a10cf
add xml comparison
sunethwarna Feb 25, 2026
aaf485b
update to vtu comparison
sunethwarna Feb 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// license: OptimizationApplication/license.txt
//
// Main author: Reza Najian Asl
// Suneth Warnakulasuriya
//

// System includes
Expand All @@ -28,34 +29,14 @@
namespace Kratos {
namespace Python {

namespace detail
{
template <class TContainerType>
void AddSigmoidalProjectionUtils(pybind11::module& m)
void AddCustomControlUtilitiesToPython(pybind11::module& m)
{
namespace py = pybind11;

std::string container_type;
if constexpr(std::is_same_v<TContainerType, ModelPart::NodesContainerType>) {
container_type = "nodal_expression";
} else if constexpr(std::is_same_v<TContainerType, ModelPart::ConditionsContainerType>) {
container_type = "condition_expression";
} else {
container_type = "element_expression";
}

m.def("ProjectForward", &SigmoidalProjectionUtils::ProjectForward<TContainerType>, py::arg(container_type.c_str()), py::arg("x_values"), py::arg("y_values"), py::arg("beta"), py::arg("penalty_factor"));
m.def("ProjectBackward", &SigmoidalProjectionUtils::ProjectBackward<TContainerType>, py::arg(container_type.c_str()), py::arg("x_values"), py::arg("y_values"), py::arg("beta"), py::arg("penalty_factor"));
m.def("CalculateForwardProjectionGradient", &SigmoidalProjectionUtils::CalculateForwardProjectionGradient<TContainerType>, py::arg(container_type.c_str()), py::arg("x_values"), py::arg("y_values"), py::arg("beta"), py::arg("penalty_factor"));
}
} // namespace detail

void AddCustomControlUtilitiesToPython(pybind11::module& m)
{
auto module = m.def_submodule("SigmoidalProjectionUtils");
detail::AddSigmoidalProjectionUtils<ModelPart::NodesContainerType>(module);
detail::AddSigmoidalProjectionUtils<ModelPart::ConditionsContainerType>(module);
detail::AddSigmoidalProjectionUtils<ModelPart::ElementsContainerType>(module);
module.def("ProjectForward", &SigmoidalProjectionUtils::ProjectForward, py::arg("input_tensor_adaptor"), py::arg("x_values"), py::arg("y_values"), py::arg("beta"), py::arg("penalty_factor"));
module.def("ProjectBackward", &SigmoidalProjectionUtils::ProjectBackward, py::arg("input_tensor_adaptor"), py::arg("x_values"), py::arg("y_values"), py::arg("beta"), py::arg("penalty_factor"));
module.def("CalculateForwardProjectionGradient", &SigmoidalProjectionUtils::CalculateForwardProjectionGradient, py::arg("input_tensor_adaptor"), py::arg("x_values"), py::arg("y_values"), py::arg("beta"), py::arg("penalty_factor"));
}

} // namespace Python.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void AddExplicitDamping(

using explicit_damping_type = ExplicitDamping<TContainerType>;
py::class_<explicit_damping_type, typename explicit_damping_type::Pointer>(m, (rSuffix + "ExplicitDamping").c_str())
.def("SetRadius", &explicit_damping_type::SetRadius, py::arg("radius_expression"))
.def("SetRadius", &explicit_damping_type::SetRadius, py::arg("radius_tensor_adaptor"))
.def("GetRadius", &explicit_damping_type::GetRadius)
.def("GetStride", &explicit_damping_type::GetStride)
.def("GetDampedModelParts", &explicit_damping_type::GetDampedModelParts)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ void AddCustomResponseUtilitiesToPython(pybind11::module& m)
m.def_submodule("MassResponseUtils")
.def("Check", &MassResponseUtils::Check)
.def("CalculateValue", &MassResponseUtils::CalculateValue)
.def("CalculateGradient", &MassResponseUtils::CalculateGradient, py::arg("list_of_gradient_variables"), py::arg("list_of_gradient_required_model_parts"), py::arg("list_of_gradient_computed_model_parts"), py::arg("list_of_container_expressions"), py::arg("perturbation_size"))
.def("CalculateGradient", &MassResponseUtils::CalculateGradient, py::arg("physical_variable"), py::arg("value_influencing_model_part"), py::arg("combined_tensor_adaptor"), py::arg("perturbation_size"))
;

m.def_submodule("LinearStrainEnergyResponseUtils")
.def("CalculateValue", &LinearStrainEnergyResponseUtils::CalculateValue)
.def("CalculateGradient", &LinearStrainEnergyResponseUtils::CalculateGradient, py::arg("list_of_gradient_variables"), py::arg("list_of_gradient_required_model_parts"), py::arg("list_of_gradient_computed_model_parts"), py::arg("list_of_container_expressions"), py::arg("perturbation_size"))
.def("CalculateGradient", &LinearStrainEnergyResponseUtils::CalculateGradient, py::arg("physical_variable"), py::arg("value_influencing_model_part"), py::arg("combined_tensor_adaptor"), py::arg("perturbation_size"))
;

m.def_submodule("MaxOverhangAngleResponseUtils")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// license: OptimizationApplication/license.txt
//
// Main author: Suneth Warnakulasuriya
//

// System includes

// External includes
#include <pybind11/stl.h>

// Project includes

// Application includes
#include "custom_utilities/tensor_adaptors/properties_variable_tensor_adaptor.h"

// Include base h
#include "add_custom_tensor_adaptors_to_python.h"

namespace Kratos {
namespace Python {

void AddCustomTensorAdaptorsToPython(pybind11::module& m)
{
namespace py = pybind11;

auto tensor_adaptor_modules = m.def_submodule("TensorAdaptors");

py::class_<PropertiesVariableTensorAdaptor, PropertiesVariableTensorAdaptor::Pointer, PropertiesVariableTensorAdaptor::BaseType>(tensor_adaptor_modules, "PropertiesVariableTensorAdaptor")
.def(py::init<const PropertiesVariableTensorAdaptor::BaseType&, PropertiesVariableTensorAdaptor::VariablePointerType, const bool>(),
py::arg("tensor_adaptor"),
py::arg("variable"),
py::arg("copy") = true)
.def(py::init<ModelPart::ConditionsContainerType::Pointer, PropertiesVariableTensorAdaptor::VariablePointerType>(),
py::arg("container"),
py::arg("variable"))
.def(py::init<ModelPart::ConditionsContainerType::Pointer, PropertiesVariableTensorAdaptor::VariablePointerType, const std::vector<unsigned int>&>(),
py::arg("container"),
py::arg("variable"),
py::arg("data_shape"))
.def(py::init<ModelPart::ElementsContainerType::Pointer, PropertiesVariableTensorAdaptor::VariablePointerType>(),
py::arg("container"),
py::arg("variable"))
.def(py::init<ModelPart::ElementsContainerType::Pointer, PropertiesVariableTensorAdaptor::VariablePointerType, const std::vector<unsigned int>&>(),
py::arg("container"),
py::arg("variable"),
py::arg("data_shape"))
;
}

} // namespace Python.
} // Namespace Kratos

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// license: OptimizationApplication/license.txt
//
// Main author: Suneth Warnakulasuriya
//

#pragma once

// System includes

// External includes

// Project includes
#include "includes/define_python.h"

namespace Kratos {
namespace Python {

void AddCustomTensorAdaptorsToPython(pybind11::module& m);

} // namespace Python.
} // namespace Kratos.
Loading
Loading