Public Types | |
enum | { MASTER = 0 , SLAVE , SOLID , FLUID } |
Enumerator for solid/fluid, master/slave. More... | |
Public Member Functions | |
DeformMeshRemap (Interface *impl, ParallelComm *master=NULL, ParallelComm *slave=NULL) | |
Constructor If master is NULL, the MOAB part is run in serial; If slave is NULL but the master isn't, the slave is copied from the master Create communicators using moab::ParallelComm::get_pcomm. More... | |
~DeformMeshRemap () | |
Destructor. More... | |
ErrorCode | execute () |
Execute the deformed mesh process. More... | |
ErrorCode | add_set_no (int m_or_s, int fluid_or_solid, int set_no) |
Add a set number. More... | |
ErrorCode | remove_set_no (int m_or_s, int fluid_or_solid, int set_no) |
Remove a set number. More... | |
ErrorCode | get_set_nos (int m_or_s, int fluid_or_solid, set< int > &set_nos) const |
Get the set numbers. More... | |
Tag | x_new () const |
Get the xNew tag handle. More... | |
string | x_new_name () const |
Get the tag name. More... | |
void | x_new_name (const string &name) |
Set the tag name. More... | |
string | get_file_name (int m_or_s) const |
Get/set the file name. More... | |
void | set_file_name (int m_or_s, const string &name) |
Get/set the file name. More... | |
string | xdisp_name (int idx=0) |
Get/set the x displacement tag names. More... | |
void | xdisp_name (const string &nm, int idx=0) |
Private Member Functions | |
ErrorCode | deform_master (Range &fluid_elems, Range &solid_elems, const char *tag_name=NULL) |
Apply a known deformation to the solid elements, putting the results in the xNew tag; also write current coordinates to the xNew tag for fluid elements. More... | |
ErrorCode | read_file (int m_or_s, string &fname, EntityHandle &seth) |
Read a file and establish proper ranges. More... | |
ErrorCode | write_to_coords (Range &elems, Tag tagh, Tag tmp_tag=0) |
Write the input tag to the coordinates for the vertices in the input elems If non-zero tmp_tag is input, save coords to tmp_tag before over-writing with tag value. More... | |
ErrorCode | write_and_save (Range &ents, EntityHandle seth, Tag tagh, const char *filename, bool restore_coords=false) |
Write the tag to the vertices, then save to the specified file If restore_coords is true, coords are restored to their initial state after file is written. More... | |
ErrorCode | find_other_sets (int m_or_s, EntityHandle file_set) |
Find fluid/solid sets from complement of solid/fluid sets. More... | |
Private Attributes | |
Interface * | mbImpl |
moab interface More... | |
set< int > | fluidSetNos [2] |
Material set numbers for fluid materials, for master/slave. More... | |
set< int > | solidSetNos [2] |
Material set numbers for solid materials, for master/slave. More... | |
EntityHandle | masterSet |
Sets defining master/slave meshes. More... | |
EntityHandle | slaveSet |
Range | fluidSets [2] |
Sets in master/slave meshes. More... | |
Range | solidSets [2] |
Range | fluidElems [2] |
Elements in master/slave meshes. More... | |
Range | solidElems [2] |
string | masterFileName |
Filenames for master/slave meshes. More... | |
string | slaveFileName |
Tag | xDisp [3] |
Tag from file, might be 3. More... | |
Tag | xNew |
Tag used for new positions. More... | |
string | xDispNames [3] |
Tag name used to read disps from file. More... | |
string | xNewName |
Tag name used for new positions. More... | |
Definition at line 56 of file DeformMeshRemap.cpp.
anonymous enum |
DeformMeshRemap::DeformMeshRemap | ( | Interface * | impl, |
ParallelComm * | master = NULL , |
||
ParallelComm * | slave = NULL |
||
) |
Constructor If master is NULL, the MOAB part is run in serial; If slave is NULL but the master isn't, the slave is copied from the master Create communicators using moab::ParallelComm::get_pcomm.
Definition at line 417 of file DeformMeshRemap.cpp.
References xDisp.
DeformMeshRemap::~DeformMeshRemap | ( | ) |
|
inline |
Add a set number.
Definition at line 180 of file DeformMeshRemap.cpp.
References MB_INDEX_OUT_OF_RANGE, MB_SUCCESS, and SOLID.
Referenced by main().
|
private |
Apply a known deformation to the solid elements, putting the results in the xNew tag; also write current coordinates to the xNew tag for fluid elements.
Definition at line 563 of file DeformMeshRemap.cpp.
References moab::BoundBox::bMax, moab::BoundBox::bMin, debug, deform_func(), ErrorCode, fluidElems, moab::Interface::get_adjacencies(), moab::Interface::get_coords(), moab::CartVect::length_squared(), MASTER, masterSet, MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_DOUBLE, mbImpl, moab::Range::merge(), moab::Range::size(), solidElems, moab::subtract(), moab::Interface::tag_get_data(), moab::Interface::tag_get_handle(), moab::Interface::tag_set_data(), moab::BoundBox::update(), write_and_save(), xDisp, xDispNames, and xNew.
ErrorCode DeformMeshRemap::execute | ( | ) |
Execute the deformed mesh process.
Definition at line 266 of file DeformMeshRemap.cpp.
References moab::debug, deform_master(), ErrorCode, moab::Skinner::find_skin(), moab::SpatialLocator::get_tree(), moab::DataCoupler::interpolate(), moab::SpatialLocator::local_num_located(), moab::DataCoupler::locate_points(), MB_CHK_ERR, MB_CHK_SET_ERR, MB_SUCCESS, moab::Range::merge(), MESHSET_SET, moab::LloydSmoother::num_its(), moab::LloydSmoother::perform_smooth(), moab::TreeStats::print(), read_file(), moab::Range::size(), moab::DataCoupler::spatial_locator(), moab::Tree::tree_stats(), moab::Interface::UNION, moab::DataCoupler::VOLUME, and write_to_coords().
Referenced by main().
|
private |
Find fluid/solid sets from complement of solid/fluid sets.
Definition at line 743 of file DeformMeshRemap.cpp.
References debug, dim, moab::Interface::dimension_from_handle(), moab::Range::empty(), ErrorCode, fluidElems, fluidSets, moab::Interface::get_entities_by_handle(), moab::Interface::get_entities_by_type_and_tag(), MASTER, MATERIAL_SET_TAG_NAME, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, MBENTITYSET, mbImpl, moab::Range::rbegin(), solidElems, solidSets, moab::Range::subset_by_dimension(), moab::subtract(), and moab::Interface::tag_get_handle().
string DeformMeshRemap::get_file_name | ( | int | m_or_s | ) | const |
Get/set the file name.
Definition at line 388 of file DeformMeshRemap.cpp.
|
inline |
Get the set numbers.
Definition at line 233 of file DeformMeshRemap.cpp.
References MB_INDEX_OUT_OF_RANGE, MB_SUCCESS, and SOLID.
|
private |
Read a file and establish proper ranges.
Definition at line 657 of file DeformMeshRemap.cpp.
References moab::Range::clear(), moab::Interface::create_meshset(), debug, dim, moab::Interface::dimension_from_handle(), moab::Range::empty(), moab::Range::end(), ErrorCode, fluidElems, fluidSetNos, fluidSets, moab::Interface::get_entities_by_handle(), moab::Interface::get_entities_by_type_and_tag(), moab::ParallelComm::get_id(), moab::Interface::load_file(), MASTER, MATERIAL_SET_TAG_NAME, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, MBENTITYSET, mbImpl, moab::Range::merge(), moab::Range::rbegin(), moab::Range::size(), moab::ParallelComm::size(), solidElems, solidSetNos, solidSets, moab::Range::subset_by_dimension(), and moab::Interface::tag_get_handle().
|
inline |
Remove a set number.
Definition at line 205 of file DeformMeshRemap.cpp.
References MB_INDEX_OUT_OF_RANGE, MB_SUCCESS, and SOLID.
void DeformMeshRemap::set_file_name | ( | int | m_or_s, |
const string & | name | ||
) |
Get/set the file name.
Definition at line 402 of file DeformMeshRemap.cpp.
Referenced by main().
|
private |
Write the tag to the vertices, then save to the specified file If restore_coords is true, coords are restored to their initial state after file is written.
Definition at line 504 of file DeformMeshRemap.cpp.
References ErrorCode, MB_CHK_ERR, MB_TAG_CREAT, MB_TAG_DENSE, MB_TYPE_DOUBLE, mbImpl, moab::Interface::tag_delete(), moab::Interface::tag_get_handle(), moab::Interface::write_file(), and write_to_coords().
Referenced by deform_master().
Write the input tag to the coordinates for the vertices in the input elems If non-zero tmp_tag is input, save coords to tmp_tag before over-writing with tag value.
Definition at line 525 of file DeformMeshRemap.cpp.
References ErrorCode, moab::Interface::get_adjacencies(), moab::Interface::get_coords(), MB_CHK_SET_ERR, MB_SUCCESS, mbImpl, moab::Interface::set_coords(), moab::Range::size(), moab::Interface::tag_get_data(), and moab::Interface::tag_set_data().
Referenced by write_and_save().
|
inline |
Get the xNew tag handle.
Definition at line 90 of file DeformMeshRemap.cpp.
|
inline |
|
inline |
Set the tag name.
Definition at line 102 of file DeformMeshRemap.cpp.
void DeformMeshRemap::xdisp_name | ( | const string & | nm, |
int | idx = 0 |
||
) |
Definition at line 261 of file DeformMeshRemap.cpp.
|
inline |
Get/set the x displacement tag names.
Definition at line 256 of file DeformMeshRemap.cpp.
Referenced by main().
|
private |
Elements in master/slave meshes.
Definition at line 161 of file DeformMeshRemap.cpp.
Referenced by deform_master(), find_other_sets(), and read_file().
|
private |
Material set numbers for fluid materials, for master/slave.
Definition at line 149 of file DeformMeshRemap.cpp.
Referenced by read_file().
|
private |
Sets in master/slave meshes.
Definition at line 158 of file DeformMeshRemap.cpp.
Referenced by find_other_sets(), and read_file().
|
private |
Filenames for master/slave meshes.
Definition at line 164 of file DeformMeshRemap.cpp.
|
private |
Sets defining master/slave meshes.
Definition at line 155 of file DeformMeshRemap.cpp.
Referenced by deform_master().
|
private |
moab interface
Definition at line 141 of file DeformMeshRemap.cpp.
Referenced by deform_master(), find_other_sets(), read_file(), write_and_save(), and write_to_coords().
|
private |
Definition at line 164 of file DeformMeshRemap.cpp.
|
private |
Definition at line 155 of file DeformMeshRemap.cpp.
|
private |
Definition at line 161 of file DeformMeshRemap.cpp.
Referenced by deform_master(), find_other_sets(), and read_file().
|
private |
Material set numbers for solid materials, for master/slave.
Definition at line 152 of file DeformMeshRemap.cpp.
Referenced by read_file().
|
private |
Definition at line 158 of file DeformMeshRemap.cpp.
Referenced by find_other_sets(), and read_file().
|
private |
Tag from file, might be 3.
Definition at line 167 of file DeformMeshRemap.cpp.
Referenced by deform_master(), and DeformMeshRemap().
|
private |
Tag name used to read disps from file.
Definition at line 173 of file DeformMeshRemap.cpp.
Referenced by deform_master().
|
private |
Tag used for new positions.
Definition at line 170 of file DeformMeshRemap.cpp.
Referenced by deform_master().
|
private |
Tag name used for new positions.
Definition at line 176 of file DeformMeshRemap.cpp.