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

[OptApp] Add filtering factory #12142

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
0450d63
add filter interface
sunethwarna Feb 29, 2024
403f6a5
add damping to entity point
sunethwarna Feb 29, 2024
96b4ccd
update explicit filtering
sunethwarna Feb 29, 2024
f910756
removing damping functions
sunethwarna Feb 29, 2024
178421a
python exposure
sunethwarna Feb 29, 2024
eb34504
expand union utilities
sunethwarna Feb 29, 2024
8256f77
add filtering factory
sunethwarna Feb 29, 2024
3c213a6
update shell thickness control
sunethwarna Feb 29, 2024
8185ffa
update surface control
sunethwarna Feb 29, 2024
e20251e
Merge remote-tracking branch 'origin/master' into optapp/filtering/cr…
sunethwarna Feb 29, 2024
f0c2f0b
revert entity point changes
sunethwarna Feb 29, 2024
4bb5808
revert some other files changes
sunethwarna Feb 29, 2024
77a62b0
fix cpp
sunethwarna Mar 1, 2024
19597be
move filter factory
sunethwarna Mar 1, 2024
fae03ca
introduce explicit_vertex_morphing
sunethwarna Mar 1, 2024
5b5eb89
update surface control
sunethwarna Mar 1, 2024
d75c338
update shell thickness control
sunethwarna Mar 1, 2024
e627678
fix filter functions
sunethwarna Mar 5, 2024
6da69e3
fix existing tests
sunethwarna Mar 5, 2024
e7138b4
add methods
sunethwarna Mar 5, 2024
e5328b7
update explicit vertex morphing
sunethwarna Mar 5, 2024
9a4b1fd
fix interface
sunethwarna Mar 5, 2024
96fe1d0
add tests
sunethwarna Mar 5, 2024
8d83fc6
minor
sunethwarna Mar 5, 2024
dac3b80
add tests for all filters
sunethwarna Mar 5, 2024
172e096
fixes for tests
sunethwarna Mar 5, 2024
f0c2c4e
revert base changes
sunethwarna Mar 5, 2024
8b590ad
introduce explicit vm thickness control
sunethwarna Mar 5, 2024
ffa86a9
introduce explicit vm shape control
sunethwarna Mar 5, 2024
273cc4e
add data container to filter factory
sunethwarna Mar 5, 2024
e2f1c2b
fix old vm shape control
sunethwarna Mar 5, 2024
119f3c1
update tests
sunethwarna Mar 5, 2024
4737f8c
move mdpa
sunethwarna Mar 5, 2024
582c929
fix data view
sunethwarna Mar 5, 2024
3d4323e
minor
sunethwarna Mar 5, 2024
5296021
add explicit vm shape control test
sunethwarna Mar 5, 2024
0765c63
remove outputs
sunethwarna Mar 5, 2024
acdc240
fix and add shell thick control tests
sunethwarna Mar 5, 2024
8c515af
fix existing tests
sunethwarna Mar 5, 2024
c1cbe8c
add tests
sunethwarna Mar 5, 2024
a0815f9
Update applications/OptimizationApplication/custom_utilities/filterin…
sunethwarna Mar 6, 2024
bce64f8
minor
sunethwarna Mar 6, 2024
d4fea72
minor
sunethwarna Mar 6, 2024
fca34e4
change cpp order
sunethwarna Mar 6, 2024
e62a298
move common files
sunethwarna Mar 6, 2024
04c3035
space change
sunethwarna Mar 6, 2024
afd1d7d
remove addition vtu output
sunethwarna Mar 6, 2024
f7fedfb
minor
sunethwarna Mar 6, 2024
60eed56
finixng nlopt test
Mar 6, 2024
966f833
revert cmake chaneg
sunethwarna Mar 6, 2024
9f1cf77
fix clang unity build issue
sunethwarna Mar 6, 2024
f6d0a8a
minor unused import removal
sunethwarna Mar 6, 2024
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 @@ -17,6 +17,7 @@
// Project includes

// Application includes
#include "custom_utilities/filtering/filter_utils.h"
#include "custom_utilities/filtering/explicit_filter.h"

// Include base h
Expand All @@ -37,10 +38,12 @@ void AddExplicitFilter(

py::class_<ExplicitFilter<TContainerType>, typename ExplicitFilter<TContainerType>::Pointer>(m, rName.c_str())
.def(py::init<const ModelPart&, const std::string&, const std::size_t>(), py::arg("model_part"), py::arg("kernel_function_type"), py::arg("max_number_of_neighbours"))
.def(py::init<const ModelPart&, const ModelPart&, const std::string&, const std::string&, const std::size_t>(), py::arg("model_part"), py::arg("fixed_model_part"), py::arg("kernel_function_type"), py::arg("damping_function_type"), py::arg("max_number_of_neighbours"))
.def("SetFilterRadius", &ExplicitFilter<TContainerType>::SetFilterRadius, py::arg("filter_radius"))
.def("SetDampingCoefficients", &ExplicitFilter<TContainerType>::SetDampingCoefficients, py::arg("damping_coefficients"))
.def("FilterField", &ExplicitFilter<TContainerType>::FilterField, py::arg("unfiltered_field"))
.def("FilterIntegratedField", &ExplicitFilter<TContainerType>::FilterIntegratedField, py::arg("filtered_field"))
.def("GetFilterRadius", &ExplicitFilter<TContainerType>::GetFilterRadius)
.def("GetDampingCoefficients", &ExplicitFilter<TContainerType>::GetDampingCoefficients)
.def("GetIntegrationWeights", &ExplicitFilter<TContainerType>::GetIntegrationWeights, py::arg("integration_weight_field"))
.def("Update", &ExplicitFilter<TContainerType>::Update)
.def("__str__", &ExplicitFilter<TContainerType>::Info)
Expand All @@ -51,6 +54,33 @@ void AddExplicitFilter(

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

auto filter_utils = m.def_submodule("FilterUtils");
filter_utils.def("GetComponentWiseDampedModelParts", &FilterUtils::GetComponentWiseDampedModelParts,
py::arg("model"),
py::arg("parameters"),
py::arg("number_of_components"),
py::return_value_policy::reference);
filter_utils.def("ComputeDampingCoefficientsBasedOnNearestEntity", &FilterUtils::ComputeDampingCoefficientsBasedOnNearestEntity<ModelPart::NodesContainerType>,
py::arg("damping_radius_nodal_expression"),
py::arg("lists_of_model_parts_for_components"),
py::arg("shape_of_the_damping_variable"),
py::arg("damping_function_type"),
py::arg("bucket_size"));
filter_utils.def("ComputeDampingCoefficientsBasedOnNearestEntity", &FilterUtils::ComputeDampingCoefficientsBasedOnNearestEntity<ModelPart::ConditionsContainerType>,
py::arg("damping_radius_condition_expression"),
py::arg("lists_of_model_parts_for_components"),
py::arg("shape_of_the_damping_variable"),
py::arg("damping_function_type"),
py::arg("bucket_size"));
filter_utils.def("ComputeDampingCoefficientsBasedOnNearestEntity", &FilterUtils::ComputeDampingCoefficientsBasedOnNearestEntity<ModelPart::ElementsContainerType>,
py::arg("damping_radius_element_expression"),
py::arg("lists_of_model_parts_for_components"),
py::arg("shape_of_the_damping_variable"),
py::arg("damping_function_type"),
py::arg("bucket_size"));

Detail::AddExplicitFilter<ModelPart::NodesContainerType>(m, "NodalExplicitFilter");
Detail::AddExplicitFilter<ModelPart::ConditionsContainerType>(m, "ConditionExplicitFilter");
Detail::AddExplicitFilter<ModelPart::ElementsContainerType>(m, "ElementExplicitFilter");
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading