Skip to content

Commit 4c17dee

Browse files
Replace Robin_vtp_file_path with Spatial_values_file_path. Also, add warning if RobinBoundaryCondition is constructed with 0 stiffness and 0 damping
1 parent 277dd06 commit 4c17dee

File tree

7 files changed

+16
-8
lines changed

7 files changed

+16
-8
lines changed

Code/Source/solver/Parameters.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,6 @@ BoundaryConditionParameters::BoundaryConditionParameters()
443443
set_parameter("Spatial_profile_file_path", "", !required, spatial_profile_file_path);
444444
set_parameter("Spatial_values_file_path", "", !required, spatial_values_file_path);
445445
set_parameter("Stiffness", 1.0, !required, stiffness);
446-
set_parameter("Robin_vtp_file_path", "", !required, robin_vtp_file_path);
447446
set_parameter("svZeroDSolver_block", "", !required, svzerod_solver_block);
448447

449448
set_parameter("Temporal_and_spatial_values_file_path", "", !required, temporal_and_spatial_values_file_path);

Code/Source/solver/Parameters.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,6 @@ class BoundaryConditionParameters : public ParameterLists
806806
Parameter<std::string> spatial_profile_file_path;
807807
Parameter<std::string> spatial_values_file_path;
808808
Parameter<double> stiffness;
809-
Parameter<std::string> robin_vtp_file_path;
810809
Parameter<std::string> svzerod_solver_block;
811810

812811
Parameter<std::string> temporal_and_spatial_values_file_path;

Code/Source/solver/RobinBoundaryCondition.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@
2929
*/
3030

3131
#include "RobinBoundaryCondition.h"
32+
#include <iostream>
3233

3334
#define n_debug_robin_bc
3435

36+
RobinBoundaryCondition::RobinBoundaryCondition(double uniform_stiffness, double uniform_damping, bool normal_only, const faceType& face)
37+
: BoundaryCondition({{"Stiffness", uniform_stiffness}, {"Damping", uniform_damping}}, StringBoolMap{{"normal_direction_only", normal_only}}, face)
38+
{
39+
// Warning if both stiffness and damping are zero
40+
if (uniform_stiffness == 0.0 && uniform_damping == 0.0) {
41+
std::cout << "WARNING: Robin boundary condition has both stiffness and damping values set to zero. "
42+
<< "This will result in effectively no boundary condition being applied." << std::endl;
43+
}
44+
}
45+

Code/Source/solver/RobinBoundaryCondition.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ class RobinBoundaryCondition : public BoundaryCondition {
8383
/// @param normal_only Flag to apply only along normal direction
8484
/// @param face Face associated with the Robin BC
8585
/// @throws BoundaryConditionValidationException if values are invalid
86-
RobinBoundaryCondition(double uniform_stiffness, double uniform_damping, bool normal_only, const faceType& face)
87-
: BoundaryCondition({{"Stiffness", uniform_stiffness}, {"Damping", uniform_damping}}, StringBoolMap{{"normal_direction_only", normal_only}}, face) {}
86+
RobinBoundaryCondition(double uniform_stiffness, double uniform_damping, bool normal_only, const faceType& face);
8887

8988
/// @brief Apply only along normal direction (getter)
9089
/// @return true if BC should be applied only along normal direction

Code/Source/solver/read_files.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ void read_bc(Simulation* simulation, EquationParameters* eq_params, eqType& lEq,
394394
if (utils::btest(lBc.bType, enum_int(BoundaryConditionType::bType_Robin))) {
395395

396396
// Read VTP file path for per-node stiffness and damping (optional)
397-
if (bc_params->robin_vtp_file_path.defined()) {
398-
lBc.robin_bc = RobinBoundaryCondition(bc_params->robin_vtp_file_path.value(),
397+
if (bc_params->spatial_values_file_path.defined()) {
398+
lBc.robin_bc = RobinBoundaryCondition(bc_params->spatial_values_file_path.value(),
399399
bc_params->apply_along_normal_direction.value(),
400400
com_mod.msh[lBc.iM].fa[lBc.iFa]);
401401
} else {

tests/cases/struct/spatially_variable_robin/solver.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132

133133
<Add_BC name="Y0" >
134134
<Type> Robin </Type>
135-
<Robin_vtp_file_path> Y0_spatially_varying_robin.vtp </Robin_vtp_file_path>
135+
<Spatial_values_file_path> Y0_spatially_varying_robin.vtp </Spatial_values_file_path>
136136
<Apply_along_normal_direction> false </Apply_along_normal_direction>
137137
</Add_BC>
138138

tests/cases/ustruct/spatially_variable_robin/solver.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134

135135
<Add_BC name="Y0" >
136136
<Type> Robin </Type>
137-
<Robin_vtp_file_path> Y0_spatially_varying_robin.vtp </Robin_vtp_file_path>
137+
<Spatial_values_file_path> Y0_spatially_varying_robin.vtp </Spatial_values_file_path>
138138
</Add_BC>
139139

140140
<Add_BC name="Y1" >

0 commit comments

Comments
 (0)