IBAMR
An adaptive and distributed-memory parallel implementation of the immersed boundary (IB) method
|
Class IBStandardInitializer is a concrete LInitStrategy that initializes the configuration of one or more Lagrangian structures from input files. More...
#include </home/runner/work/IBAMR/IBAMR/include/ibamr/IBStandardInitializer.h>
Public Member Functions | |
IBStandardInitializer (std::string object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db) | |
Constructor. | |
~IBStandardInitializer () | |
Destructor. | |
void | init () override |
Initialize structure specific configurations. | |
![]() | |
IBRedundantInitializer (std::string object_name, SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > input_db) | |
Constructor. | |
virtual | ~IBRedundantInitializer () |
Destructor. | |
void | registerLSiloDataWriter (SAMRAI::tbox::Pointer< IBTK::LSiloDataWriter > silo_writer) |
Register a Silo data writer with the IB initializer object. | |
bool | getLevelHasLagrangianData (int level_number, bool can_be_refined) const override |
Determine whether there are any Lagrangian nodes on the specified patch level. | |
bool | getIsAllLagrangianDataInDomain (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy) const override |
unsigned int | computeGlobalNodeCountOnPatchLevel (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool can_be_refined, bool initial_time) override |
Determine the number of global nodes on the specified patch level. | |
unsigned int | computeLocalNodeCountOnPatchLevel (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool can_be_refined, bool initial_time) override |
Determine the number of local nodes on the specified patch level. | |
void | registerInitStructureFunction (InitStructureOnLevel fcn, void *ctx=nullptr) |
void | registerInitSpringDataFunction (InitSpringDataOnLevel fcn, void *ctx=nullptr) |
Register a function to initialize spring data structures on a given level. | |
void | registerInitXSpringDataFunction (InitXSpringDataOnLevel fcn, void *ctx=nullptr) |
Register a function to initialize xspring data structures on a given level. | |
void | registerInitBeamDataFunction (InitBeamDataOnLevel fcn, void *ctx=nullptr) |
Register a function to initialize beam data structures on a given level. | |
void | registerInitDirectorAndRodFunction (InitDirectorAndRodOnLevel fcn, void *ctx=nullptr) |
Register a funcion to initialize director and rod data structures on a given level. | |
void | registerInitBoundaryMassFunction (InitBoundaryMassOnLevel fcn, void *ctx=nullptr) |
Register a function to initialize massive points on a given level. | |
void | registerInitTargetPtFunction (InitTargetPtOnLevel fcn, void *ctx=nullptr) |
Register a function to initialize target points on a given level. | |
void | registerInitAnchorPtFunction (InitAnchorPtOnLevel fcn, void *ctx=nullptr) |
Register a function to initialize anchor points on a given level. | |
void | registerInitInstrumentationFunction (InitInstrumentationOnLevel fcn, void *ctx=nullptr) |
Register a function to initialize instrumentation data on a given level. | |
void | registerInitSourceFunction (InitSourceOnLevel fcn, void *ctx=nullptr) |
Register a funciton to initialize source/sink data on a given level. | |
void | initializeStructureIndexingOnPatchLevel (std::map< int, std::string > &strct_id_to_strct_name_map, std::map< int, std::pair< int, int > > &strct_id_to_lag_idx_range_map, int level_number, double init_data_time, bool can_be_refined, bool initial_time, IBTK::LDataManager *l_data_manager) override |
Initialize the structure indexing information on the patch level. | |
unsigned int | initializeDataOnPatchLevel (int lag_node_index_idx, unsigned int global_index_offset, unsigned int local_index_offset, SAMRAI::tbox::Pointer< IBTK::LData > X_data, SAMRAI::tbox::Pointer< IBTK::LData > U_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool can_be_refined, bool initial_time, IBTK::LDataManager *l_data_manager) override |
Initialize the LNode and LData data needed to specify the configuration of the curvilinear mesh on the patch level. | |
unsigned int | initializeMassDataOnPatchLevel (unsigned int global_index_offset, unsigned int local_index_offset, SAMRAI::tbox::Pointer< IBTK::LData > M_data, SAMRAI::tbox::Pointer< IBTK::LData > K_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool can_be_refined, bool initial_time, IBTK::LDataManager *l_data_manager) override |
Initialize the LData needed to specify the mass and spring constant data required by the penalty IB method. | |
unsigned int | initializeDirectorDataOnPatchLevel (unsigned int global_index_offset, unsigned int local_index_offset, SAMRAI::tbox::Pointer< IBTK::LData > D_data, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double init_data_time, bool can_be_refined, bool initial_time, IBTK::LDataManager *l_data_manager) override |
Initialize the LNode data needed to specify director vectors required by some material models. | |
void | tagCellsForInitialRefinement (SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number, double error_data_time, int tag_index) override |
Tag cells for initial refinement. | |
void | setStructureNamesOnLevel (const int &level_num, const std::vector< std::string > &strct_names) |
Set the names of the structures on a given level. | |
![]() | |
LInitStrategy ()=default | |
Default constructor. | |
virtual | ~LInitStrategy ()=default |
Destructor. | |
Additional Inherited Members | |
![]() | |
using | InitStructureOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, int &num_vertices, std::vector< IBTK::Point > &vertex_posn, void *ctx) |
using | Edge = std::pair< int, int > |
using | InitSpringDataOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::multimap< int, Edge > &spring_map, std::map< Edge, SpringSpec, EdgeComp > &spring_spec, void *ctx) |
using | InitXSpringDataOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::multimap< int, Edge > &xspring_map, std::map< Edge, XSpringSpec, EdgeComp > xspring_spec, void *ctx) |
using | InitBeamDataOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::multimap< int, BeamSpec > &beam_spec, void *ctx) |
using | InitDirectorAndRodOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::vector< std::vector< double > > &director_spec, std::multimap< int, Edge > &rod_edge_map, std::map< Edge, RodSpec, EdgeComp > &rod_spec, void *ctx) |
using | InitBoundaryMassOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::multimap< int, BdryMassSpec > &bdry_mass_spec, void *ctx) |
using | InitTargetPtOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::multimap< int, TargetSpec > &tg_pt_spec, void *ctx) |
using | InitAnchorPtOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::multimap< int, AnchorSpec > &anchor_pt_spec, void *ctx) |
using | InitInstrumentationOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::vector< std::string > &instrument_name, std::map< int, std::pair< int, int > > &instrument_spec, void *ctx) |
using | InitSourceOnLevel = void(*)(const unsigned int &strct_num, const int &level_num, std::map< int, int > &source_spec, std::vector< std::string > &source_names, std::vector< double > &source_radii, void *ctx) |
![]() | |
IBRedundantInitializer () | |
Default constructor. | |
IBRedundantInitializer (const IBRedundantInitializer &from)=delete | |
Copy constructor. | |
IBRedundantInitializer & | operator= (const IBRedundantInitializer &that)=delete |
Assignment operator. | |
void | initializeLSiloDataWriter (int level_number) |
Configure the Lagrangian Silo data writer to plot the data associated with the specified level of the locally refined Cartesian grid. | |
void | initializeStructurePosition () |
Initialize vertex data programmatically. | |
void | initializeSprings () |
Initialize spring data programmatically. | |
void | initializeXSprings () |
Initialize xspring data programmatically. | |
void | initializeBeams () |
Initialize beam data programmatically. | |
void | initializeDirectorAndRods () |
Initialize director and rod data programmatically. | |
void | initializeBoundaryMass () |
Initialize massive point data programmatically. | |
void | initializeTargetPts () |
Initialize target point data programmatically. | |
void | initializeAnchorPts () |
Initialize anchor points programmatically. | |
void | initializeInstrumentationData () |
Initialize instrumentation data. | |
void | initializeSourceData () |
Initialize source/sink data. | |
void | getPatchVertices (std::vector< std::pair< int, int > > &point_indices, SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > > patch, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy) const |
Determine the indices of any vertices initially owned by the specified patch. | |
void | getPatchVerticesAtLevel (std::vector< std::pair< int, int > > &point_indices, SAMRAI::tbox::Pointer< SAMRAI::hier::Patch< NDIM > > patch, SAMRAI::tbox::Pointer< SAMRAI::hier::PatchHierarchy< NDIM > > hierarchy, int level_number) const |
Determine the indices of any vertices associated with a given level number initially located within the specified patch. | |
int | getCanonicalLagrangianIndex (const std::pair< int, int > &point_index, int level_number) const |
IBTK::Point | getVertexPosn (const std::pair< int, int > &point_index, int level_number) const |
IBTK::Point | getShiftedVertexPosn (const std::pair< int, int > &point_index, int level_number, const double *domain_x_lower, const double *domain_x_upper, const SAMRAI::hier::IntVector< NDIM > &periodic_shift) const |
const TargetSpec & | getVertexTargetSpec (const std::pair< int, int > &point_index, int level_number) const |
const AnchorSpec & | getVertexAnchorSpec (const std::pair< int, int > &point_index, int level_number) const |
const BdryMassSpec & | getVertexBdryMassSpec (const std::pair< int, int > &point_index, int level_number) const |
const std::vector< double > & | getVertexDirectors (const std::pair< int, int > &point_index, int level_number) const |
std::pair< int, int > | getVertexInstrumentationIndices (const std::pair< int, int > &point_index, int level_number) const |
int | getVertexSourceIndices (const std::pair< int, int > &point_index, int level_number) const |
void | getFromInput (SAMRAI::tbox::Pointer< SAMRAI::tbox::Database > db) |
![]() | |
std::string | d_object_name |
int | d_max_levels = -1 |
std::vector< bool > | d_level_is_initialized |
SAMRAI::tbox::Pointer< IBTK::LSiloDataWriter > | d_silo_writer |
std::vector< std::vector< std::string > > | d_base_filename |
double | d_length_scale_factor = 1.0 |
IBTK::Vector | d_posn_shift |
std::vector< std::vector< int > > | d_num_vertex |
std::vector< std::vector< int > > | d_vertex_offset |
std::vector< std::vector< std::vector< IBTK::Point > > > | d_vertex_posn |
std::vector< std::vector< std::multimap< int, Edge > > > | d_spring_edge_map |
std::vector< std::vector< std::map< Edge, SpringSpec, EdgeComp > > > | d_spring_spec_data |
std::vector< std::vector< std::multimap< int, Edge > > > | d_xspring_edge_map |
std::vector< std::vector< std::map< Edge, XSpringSpec, EdgeComp > > > | d_xspring_spec_data |
std::vector< std::vector< std::multimap< int, BeamSpec > > > | d_beam_spec_data |
std::vector< std::vector< std::multimap< int, Edge > > > | d_rod_edge_map |
std::vector< std::vector< std::map< Edge, RodSpec, EdgeComp > > > | d_rod_spec_data |
std::vector< std::vector< std::vector< TargetSpec > > > | d_target_spec_data |
std::vector< std::vector< std::vector< AnchorSpec > > > | d_anchor_spec_data |
std::vector< std::vector< std::vector< BdryMassSpec > > > | d_bdry_mass_spec_data |
std::vector< std::vector< std::vector< std::vector< double > > > > | d_directors |
std::vector< std::vector< std::map< int, std::pair< int, int > > > > | d_instrument_idx |
std::vector< std::vector< std::map< int, int > > > | d_source_idx |
std::vector< unsigned int > | d_global_index_offset |
bool | d_data_processed = false |
Class IBStandardInitializer is a concrete LInitStrategy that initializes the configuration of one or more Lagrangian structures from input files.
Vertex file format
Vertex input files end with the extension ".vertex"
and have the following format for two-dimensional models:
N # number of vertices in the file x_0 y_0 # (x,y)-coordinates of vertex 0 x_1 y_1 # (x,y)-coordinates of vertex 1 x_2 y_2 # (x,y)-coordinates of vertex 2 ...
Vertex input files end with the extension ".vertex"
and have the following format for three-dimensional models:
N # number of vertices in the file x_0 y_0 z_0 # (x,y,z)-coordinates of vertex 0 x_1 y_1 z_1 # (x,y,z)-coordinates of vertex 1 x_2 y_2 z_2 # (x,y,z)-coordinates of vertex 2 ...
Spring file format
Spring input files end with the extension ".spring"
and have the following format:
M # number of links in the file i_0 j_0 kappa_0 length_0 fcn_idx_0 # first vertex index, second vertex index, spring constant, rest length, spring function index i_1 j_1 kappa_1 length_1 fcn_idx_1 i_2 j_2 kappa_2 length_2 fcn_idx_2 ...
Crosslink spring file format
Crosslink spring ("x-spring") input files end with the extension ".xspring"
and have the following format:
M # number of links in the file i_0 j_0 kappa_0 length_0 fcn_idx_0 # first vertex index, second vertex index, spring constant, rest length, spring function index i_1 j_1 kappa_1 length_1 fcn_idx_1 i_2 j_2 kappa_2 length_2 fcn_idx_2 ...
Beam file format
Beam input files end with the extension ".beam"
and have the following format:
M # number of beams in the file i_0 j_0 k_0 kappa_0 # first vertex index, second vertex index, third vertex index, bending rigidity i_1 j_1 k_1 kappa_1 i_2 j_2 k_2 kappa_2 ...
Rod file format
Rod input files end with the extension ".rod"
and have the following format:
M # number of rods in the file i_0 j_0 ds_0 a1_0 a2_0 a3_0 b1_0 b2_0 b3_0 kappa1_0 kappa2_0 tau_0 # first vertex index, second vertex index, material parameters i_1 j_1 ds_1 a1_1 a2_1 a3_1 b1_1 b2_1 b3_1 kappa1_1 kappa2_1 tau_1 i_2 j_2 ds_2 a1_2 a2_2 a3_2 b1_2 b2_2 b3_2 kappa1_2 kappa2_2 tau_2 ...
Target point file format
Target point input files end with the extension ".target"
and have the following format:
M # number of target points in the file i_0 kappa_0 eta_0 # vertex index, penalty spring constant, penalty damping coefficient i_1 kappa_1 eta_1 i_2 kappa_2 eta_2 ...
Anchor point file format
Anchor point input files end with the extension ".anchor"
and have the following format:
M # number of anchor points in the file i_0 # vertex index i_1 i_2 ...
Mass point file format
Mass point input files end with the extension ".mass"
and have the following format:
M # number of mass points in the file i_0 mass_0 kappa_0 # vertex index, point mass, penalty spring constant i_1 mass_1 kappa_1 i_2 mass_2 kappa_2 ...
Instrumentation file format
Instrumentation input files (specifying the nodes employed to determine the time-dependent positions of flow meters and pressure gauges) end with the extension ".inst"
and have the following format:
M # number of instruments in the file meter_name_0 # meter names meter_name_1 meter_name_2 ... N # number of instrumentation points in the file i_0 meter_idx_0 meter_node_idx_0 # vertex index, meter index, node index within meter i_1 meter_idx_1 meter_node_idx_1 i_2 meter_idx_2 meter_node_idx_2 ...
Note that each meter may have a different number of nodes specifying its perimeter; however, the values of meter_node_idx associated with a particular meter must be a continuous range of integers, starting with index 0. E.g., the following is a valid input file:
2 # number of instruments in the file meter0 # meter names meter1 6 # number of instrumentation points in the file 0 0 0 # perimeter of meter 0 consists of vertices 0, 1, and 2 1 0 1 2 0 2 9 1 0 # perimeter of meter 1 consists of vertices 9, 10, and 11 10 1 1 11 1 2
Source/sink file format
Source/sink input files (specifying the nodes employed to determine the time-dependent positions of internal sources and sinks) end with the extension ".source"
and have the following format:
M # number of sources/sinks in the file source_name_0 # source/sink names source_name_1 source_name_2 ... source_radius_0 # source/sink radii source_radius_1 source_radius_2 ... N # number of source/sink points in the file i_0 source_idx_0 # vertex index, source/sink index i_1 source_idx_1 i_2 source_idx_2 ...
2 # number of sources/sinks in the file source0 # source/sink names source1 1.0 # source/sink radii 0.5 6 # number of source/sink points in the file 0 0 # position of source0 is determined from vertices 0, 1, and 2 1 0 2 0 9 1 # position of source1 is determined from vertices 9, 10, and 11 10 1 11 1
Director file format
Orthonormal director vector input files end with the extension ".director"
and have the following format, independent of spatial dimension:
N # number of triads in the file D0_x_0 D0_y_0 D0_z_0 # coordinates of director D0 associated with vertex 0 D1_x_0 D1_y_0 D1_z_0 # coordinates of director D1 associated with vertex 0 D2_x_0 D2_y_0 D2_z_0 # coordinates of director D2 associated with vertex 0 D0_x_1 D0_y_1 D0_z_1 # coordinates of director D0 associated with vertex 1 D1_x_1 D1_y_1 D1_z_1 # coordinates of director D1 associated with vertex 1 D2_x_1 D2_y_1 D2_z_1 # coordinates of director D2 associated with vertex 1 D0_x_2 D0_y_2 D0_z_2 # coordinates of director D0 associated with vertex 2 D1_x_2 D1_y_2 D1_z_2 # coordinates of director D1 associated with vertex 2 D2_x_2 D2_y_2 D2_z_2 # coordinates of director D2 associated with vertex 2 ...
|
overridevirtual |
Initialize structure specific configurations.
This function will attempt to load, in sequence, the vertex, spring, xspring, beam, rod, target point, anchor point, boundary mass, director, instrumentation, and source files. Of these, only the vertex files are required. The instrumentation and source files will only be loaded if both enable_instrumentation or enable_sources are enabled on the input database and the input files exist. The rest will only be loaded if files with matching suffixes (e.g., .beam
) are in the current working directory.
Reimplemented from IBAMR::IBRedundantInitializer.