svMultiPhysics
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
RobinBoundaryCondition Class Reference
Inheritance diagram for RobinBoundaryCondition:
[legend]

Public Member Functions

 RobinBoundaryCondition ()
 Default constructor - creates an empty RobinBoundaryCondition.
 
 RobinBoundaryCondition (const std::string &vtp_file_path, bool normal_only, const faceType &face, SimulationLogger &logger)
 Constructor - reads stiffness and damping from VTP file.
 
 RobinBoundaryCondition (double uniform_stiffness, double uniform_damping, bool normal_only, const faceType &face, SimulationLogger &logger)
 Constructor for uniform values.
 
bool normal_direction_only () const
 Apply only along normal direction (getter)
 
double get_stiffness (int node_id) const
 Get stiffness value for a specific node (convenience method)
 
double get_damping (int node_id) const
 Get damping value for a specific node (convenience method)
 
double assemble () const
 Assemble the Robin BC into the global residual vector and stiffness matrix Currently not implemented.
 
- Public Member Functions inherited from BoundaryCondition
 BoundaryCondition ()=default
 Default constructor - creates an empty BC.
 
 BoundaryCondition (const std::string &vtp_file_path, const std::vector< std::string > &array_names, const StringBoolMap &flags, const faceType &face, SimulationLogger &logger)
 Constructor - reads data from VTP file.
 
 BoundaryCondition (const StringDoubleMap &uniform_values, const StringBoolMap &flags, const faceType &face, SimulationLogger &logger)
 Constructor for uniform values.
 
 BoundaryCondition (const BoundaryCondition &other)
 Copy constructor.
 
BoundaryConditionoperator= (BoundaryCondition other)
 Unified assignment operator (handles both copy and move)
 
 BoundaryCondition (BoundaryCondition &&other) noexcept
 Move constructor.
 
virtual ~BoundaryCondition () noexcept=default
 Virtual destructor.
 
double get_value (const std::string &array_name, int node_id) const
 Get value for a specific array and node.
 
bool get_flag (const std::string &name) const
 Get a boolean flag by name.
 
std::string flags_to_string () const
 Get a string representation of the flags.
 
int get_global_num_nodes () const noexcept
 Get global number of nodes.
 
int get_local_num_nodes () const noexcept
 Get local number of nodes.
 
int get_local_index (int global_node_id) const
 Get local array index for a global node ID.
 
bool is_from_vtp () const noexcept
 Check if data is loaded from VTP file.
 
const std::string & get_vtp_path () const noexcept
 Get the VTP file path (empty if using uniform values)
 
bool is_initialized () const noexcept
 Check if this BC has been properly initialized with data.
 
void distribute (const ComMod &com_mod, const CmMod &cm_mod, const cmType &cm, const faceType &face)
 Distribute BC data from the master process to the slave processes.
 

Protected Member Functions

void validate_array_value (const std::string &array_name, double value) const override
 Validate array values for Robin BC.
 
- Protected Member Functions inherited from BoundaryCondition
StringArrayMap read_data_from_vtp_file (const std::string &vtp_file_path, const std::vector< std::string > &array_names)
 Read data from VTP file.
 
int find_vtp_point_index (double x, double y, double z, const Array< double > &vtp_points, double mesh_scale_factor) const
 Find index of a point in the VTP points array.
 
void distribute_metadata (const CmMod &cm_mod, const cmType &cm, bool is_slave)
 
void distribute_spatially_variable (const ComMod &com_mod, const CmMod &cm_mod, const cmType &cm, bool is_slave)
 
void distribute_uniform (const CmMod &cm_mod, const cmType &cm, bool is_slave)
 
void distribute_flags (const CmMod &cm_mod, const cmType &cm, bool is_slave)
 

Additional Inherited Members

- Static Public Attributes inherited from BoundaryCondition
static constexpr double POINT_MATCH_TOLERANCE = 1e-12
 Tolerance for point matching in VTP files.
 
- Protected Types inherited from BoundaryCondition
using StringArrayMap = std::map< std::string, Array< double > >
 Type alias for map of array names to array data.
 
using StringBoolMap = std::map< std::string, bool >
 
using StringDoubleMap = std::map< std::string, double >
 
- Protected Attributes inherited from BoundaryCondition
const faceTypeface_ = nullptr
 Data members for BC.
 
int global_num_nodes_ = 0
 Global number of nodes on the face.
 
int local_num_nodes_ = 0
 Local number of nodes on this processor.
 
std::vector< std::string > array_names_
 Names of arrays to read from VTP file.
 
StringArrayMap local_data_
 Local array values for each node on this processor.
 
StringArrayMap global_data_
 Global array values (only populated on master)
 
StringBoolMap flags_
 Named boolean flags for BC behavior.
 
bool spatially_variable = false
 Flag indicating if data is from VTP file.
 
std::string vtp_file_path_
 Path to VTP file (empty if uniform)
 
std::map< int, int > global_node_map_
 Maps global node IDs to local array indices.
 
std::unique_ptr< VtkVtpDatavtp_data_
 VTP data object.
 
const SimulationLoggerlogger_ = nullptr
 Logger for warnings/info (not owned by BoundaryCondition)
 

Constructor & Destructor Documentation

◆ RobinBoundaryCondition() [1/3]

RobinBoundaryCondition::RobinBoundaryCondition ( )
inline

Default constructor - creates an empty RobinBoundaryCondition.

◆ RobinBoundaryCondition() [2/3]

RobinBoundaryCondition::RobinBoundaryCondition ( const std::string &  vtp_file_path,
bool  normal_only,
const faceType face,
SimulationLogger logger 
)
inline

Constructor - reads stiffness and damping from VTP file.

Parameters
vtp_file_pathPath to VTP file containing Stiffness and Damping point arrays
normal_onlyFlag to apply only along normal direction
faceFace associated with the Robin BC
loggerSimulation logger used to write warnings
Exceptions
BoundaryConditionFileExceptionif file cannot be read
BoundaryConditionVtpArrayExceptionif arrays are missing
BoundaryConditionValidationExceptionif values are invalid

◆ RobinBoundaryCondition() [3/3]

RobinBoundaryCondition::RobinBoundaryCondition ( double  uniform_stiffness,
double  uniform_damping,
bool  normal_only,
const faceType face,
SimulationLogger logger 
)

Constructor for uniform values.

Parameters
uniform_stiffnessUniform stiffness value for all nodes
uniform_dampingUniform damping value for all nodes
normal_onlyFlag to apply only along normal direction
faceFace associated with the Robin BC
loggerSimulation logger used to write warnings
Exceptions
BoundaryConditionValidationExceptionif values are invalid

Member Function Documentation

◆ assemble()

double RobinBoundaryCondition::assemble ( ) const
inline

Assemble the Robin BC into the global residual vector and stiffness matrix Currently not implemented.

Returns
0

◆ get_damping()

double RobinBoundaryCondition::get_damping ( int  node_id) const
inline

Get damping value for a specific node (convenience method)

Parameters
node_idNode index on the face
Returns
Damping value for the node
Exceptions
BoundaryConditionArrayExceptionif "Damping" array not found
BoundaryConditionNodeIdExceptionif node_id is out of range

◆ get_stiffness()

double RobinBoundaryCondition::get_stiffness ( int  node_id) const
inline

Get stiffness value for a specific node (convenience method)

Parameters
node_idNode index on the face
Returns
Stiffness value for the node
Exceptions
BoundaryConditionArrayExceptionif "Stiffness" array not found
BoundaryConditionNodeIdExceptionif node_id is out of range

◆ normal_direction_only()

bool RobinBoundaryCondition::normal_direction_only ( ) const
inline

Apply only along normal direction (getter)

Returns
true if BC should be applied only along normal direction
Exceptions
BoundaryConditionFlagExceptionif "normal_direction_only" flag not found

◆ validate_array_value()

void RobinBoundaryCondition::validate_array_value ( const std::string &  array_name,
double  value 
) const
inlineoverrideprotectedvirtual

Validate array values for Robin BC.

Parameters
array_nameName of the array being validated
valueValue to validate
Exceptions
BoundaryConditionValidationExceptionif validation fails

Reimplemented from BoundaryCondition.


The documentation for this class was generated from the following files: