diff --git a/Code/Source/solver/Parameters.cpp b/Code/Source/solver/Parameters.cpp index 02cffa0a4..a818ab9c6 100644 --- a/Code/Source/solver/Parameters.cpp +++ b/Code/Source/solver/Parameters.cpp @@ -443,7 +443,6 @@ BoundaryConditionParameters::BoundaryConditionParameters() set_parameter("Spatial_profile_file_path", "", !required, spatial_profile_file_path); set_parameter("Spatial_values_file_path", "", !required, spatial_values_file_path); set_parameter("Stiffness", 1.0, !required, stiffness); - set_parameter("Robin_vtp_file_path", "", !required, robin_vtp_file_path); set_parameter("svZeroDSolver_block", "", !required, svzerod_solver_block); set_parameter("Temporal_and_spatial_values_file_path", "", !required, temporal_and_spatial_values_file_path); diff --git a/Code/Source/solver/Parameters.h b/Code/Source/solver/Parameters.h index e9fd424d1..b70b72246 100644 --- a/Code/Source/solver/Parameters.h +++ b/Code/Source/solver/Parameters.h @@ -806,7 +806,6 @@ class BoundaryConditionParameters : public ParameterLists Parameter spatial_profile_file_path; Parameter spatial_values_file_path; Parameter stiffness; - Parameter robin_vtp_file_path; Parameter svzerod_solver_block; Parameter temporal_and_spatial_values_file_path; diff --git a/Code/Source/solver/RobinBoundaryCondition.cpp b/Code/Source/solver/RobinBoundaryCondition.cpp index dd16a9f2b..48bceaf73 100644 --- a/Code/Source/solver/RobinBoundaryCondition.cpp +++ b/Code/Source/solver/RobinBoundaryCondition.cpp @@ -29,6 +29,17 @@ */ #include "RobinBoundaryCondition.h" +#include #define n_debug_robin_bc +RobinBoundaryCondition::RobinBoundaryCondition(double uniform_stiffness, double uniform_damping, bool normal_only, const faceType& face) + : BoundaryCondition({{"Stiffness", uniform_stiffness}, {"Damping", uniform_damping}}, StringBoolMap{{"normal_direction_only", normal_only}}, face) +{ + // Warning if both stiffness and damping are zero + if (uniform_stiffness == 0.0 && uniform_damping == 0.0) { + std::cout << "WARNING: Robin boundary condition has both stiffness and damping values set to zero. " + << "This will result in effectively no boundary condition being applied." << std::endl; + } +} + diff --git a/Code/Source/solver/RobinBoundaryCondition.h b/Code/Source/solver/RobinBoundaryCondition.h index 13b53241c..0b46001f0 100644 --- a/Code/Source/solver/RobinBoundaryCondition.h +++ b/Code/Source/solver/RobinBoundaryCondition.h @@ -83,8 +83,7 @@ class RobinBoundaryCondition : public BoundaryCondition { /// @param normal_only Flag to apply only along normal direction /// @param face Face associated with the Robin BC /// @throws BoundaryConditionValidationException if values are invalid - RobinBoundaryCondition(double uniform_stiffness, double uniform_damping, bool normal_only, const faceType& face) - : BoundaryCondition({{"Stiffness", uniform_stiffness}, {"Damping", uniform_damping}}, StringBoolMap{{"normal_direction_only", normal_only}}, face) {} + RobinBoundaryCondition(double uniform_stiffness, double uniform_damping, bool normal_only, const faceType& face); /// @brief Apply only along normal direction (getter) /// @return true if BC should be applied only along normal direction diff --git a/Code/Source/solver/read_files.cpp b/Code/Source/solver/read_files.cpp index 8ec89f3b2..cb169863c 100644 --- a/Code/Source/solver/read_files.cpp +++ b/Code/Source/solver/read_files.cpp @@ -394,8 +394,8 @@ void read_bc(Simulation* simulation, EquationParameters* eq_params, eqType& lEq, if (utils::btest(lBc.bType, enum_int(BoundaryConditionType::bType_Robin))) { // Read VTP file path for per-node stiffness and damping (optional) - if (bc_params->robin_vtp_file_path.defined()) { - lBc.robin_bc = RobinBoundaryCondition(bc_params->robin_vtp_file_path.value(), + if (bc_params->spatial_values_file_path.defined()) { + lBc.robin_bc = RobinBoundaryCondition(bc_params->spatial_values_file_path.value(), bc_params->apply_along_normal_direction.value(), com_mod.msh[lBc.iM].fa[lBc.iFa]); } else { diff --git a/tests/cases/struct/spatially_variable_robin/solver.xml b/tests/cases/struct/spatially_variable_robin/solver.xml index 546863d89..6b26a3309 100644 --- a/tests/cases/struct/spatially_variable_robin/solver.xml +++ b/tests/cases/struct/spatially_variable_robin/solver.xml @@ -132,7 +132,7 @@ Robin - Y0_spatially_varying_robin.vtp + Y0_spatially_varying_robin.vtp false diff --git a/tests/cases/ustruct/spatially_variable_robin/solver.xml b/tests/cases/ustruct/spatially_variable_robin/solver.xml index 2a1a7bee5..57ac72dea 100644 --- a/tests/cases/ustruct/spatially_variable_robin/solver.xml +++ b/tests/cases/ustruct/spatially_variable_robin/solver.xml @@ -134,7 +134,7 @@ Robin - Y0_spatially_varying_robin.vtp + Y0_spatially_varying_robin.vtp