COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
Class to adapt the mesh. More...
#include <MeshAdaptor.hpp>
Public Member Functions | |
MeshAdaptor (mesh::Mesh &mesh) | |
Constructor. More... | |
virtual | ~MeshAdaptor () |
Destructor. More... | |
void | prepare () |
Prepare the mesh adaptor for changes. More... | |
void | finish () |
Apply the changes the mesh adaptor for changes and fix inconsistent state. More... | |
Elementary operations, should not be called usually | |
void | add_element (const PackedElement &packed_element) |
Add element to the mesh. More... | |
void | remove_element (const PackedElement &packed_element) |
Remove element from the mesh. More... | |
void | remove_element (const Uint entities_idx, const Uint elem_loc_idx) |
Remove element from the mesh. More... | |
void | flush_elements () |
Apply all changes to elements. More... | |
void | add_node (const PackedNode &packed_node) |
Add node from the mesh. More... | |
void | remove_node (const PackedNode &packed_node) |
Remove node from the mesh. More... | |
void | remove_node (const Uint dict_idx, const Uint node_loc_idx) |
Remove node from the mesh. More... | |
void | flush_nodes () |
Apply all changes to nodes. More... | |
Fine Level functions, should not be called usually | |
void | create_element_buffers () |
Creates buffers for element changes. More... | |
void | create_node_buffers () |
Creates buffers for node changes. More... | |
void | clear_element_buffers () |
Creates buffers for element changes. More... | |
void | clear_node_buffers () |
Creates buffers for node changes. More... | |
void | make_element_node_connectivity_global () |
Element-node connectivity is replaced with global indices. More... | |
void | restore_element_node_connectivity () |
Element-node connectivity is restored with local indices. More... | |
void | rebuild_node_glb_to_loc_map () |
rebuild dictionary.glb_to_loc() map with flushed nodes included More... | |
void | rebuild_node_to_element_connectivity () |
rebuild dictionary.connectivity() map with flushed nodes and elements included More... | |
High-level API | |
void | move_elements (const std::vector< std::vector< std::vector< Uint > > > &exported_elements_loc_id) |
Move elements and attached nodes between processors, according to an elements_changeset. More... | |
void | grow_overlap () |
Create an additional cell-layer of overlap between pid's. More... | |
void | combine_mesh (const Mesh &other_mesh) |
Add another mesh to this mesh. More... | |
void | remove_duplicate_elements_and_nodes () |
Add another mesh to this mesh. More... | |
Low-level API | |
void | find_nodes_to_export (const std::vector< std::vector< std::vector< Uint > > > &exported_elements_loc_id, std::vector< std::vector< std::vector< Uint > > > &exported_nodes_loc_id) |
Assemble a change-set of nodes to be sent together with elements. More... | |
void | send_elements (const std::vector< std::vector< std::vector< Uint > > > &exported_elements_loc_id, std::vector< std::vector< std::vector< boost::uint64_t > > > &imported_elements_glb_id) |
Send/Receive elements according to an elements-changeset. More... | |
void | send_nodes (const std::vector< std::vector< std::vector< Uint > > > &exported_nodes_loc_id, std::vector< std::vector< std::vector< boost::uint64_t > > > &imported_nodes_glb_id) |
Send/Receive nodes according to an nodes-changeset. More... | |
void | fix_node_ranks () |
Correct ranks of nodes to be unique in all pid's. More... | |
void | assign_global_numbering_and_rank_to_unknown_elems () |
Exactly what it says new elements have a rank and glb_idx to be Uint::max or std::numeric_limits<boost::uint64_t>::max() More... | |
void | remove_ghost_nodes () |
remove ghost nodes More... | |
void | remove_ghost_elements () |
remove ghost elements More... | |
void | assign_partition_agnostic_global_indices_to_dict (Dictionary &dict) |
Private Attributes | |
Handle< Mesh > | m_mesh |
Handle to the mesh. More... | |
bool | is_node_connectivity_global |
boolean that says if mesh has element-node connectivities with global node-indices More... | |
std::vector< boost::shared_ptr< common::List< Uint >::Buffer > > | element_glb_idx |
Element buffers for global index. More... | |
std::vector< boost::shared_ptr< common::List< Uint >::Buffer > > | element_rank |
Element buffers for rank. More... | |
std::vector< std::vector< boost::shared_ptr< common::Table< Uint >::Buffer > > > | element_connected_nodes |
Element buffers for element-node connectivity. More... | |
std::vector< boost::shared_ptr< common::List< Uint >::Buffer > > | node_glb_idx |
Node buffers for global index. More... | |
std::vector< boost::shared_ptr< common::List< Uint >::Buffer > > | node_rank |
Node buffers for rank. More... | |
std::vector< std::vector< boost::shared_ptr< common::Table< Real >::Buffer > > > | node_field_values |
Node buffers for field values. More... | |
bool | node_glb_to_loc_needs_rebuild |
flag if dictionary.glb_to_loc() must be rebuilt More... | |
bool | node_elem_connectivity_needs_rebuild |
flag if dictionary.connectivity() must be rebuilt More... | |
bool | elem_flush_required |
flag if there are still elements that need to be flush More... | |
bool | node_flush_required |
flag if there are still nodes that need to be flush More... | |
std::vector< std::set< boost::uint64_t > > | added_elements |
bookkeeping of added and removed elements More... | |
std::vector< std::set< boost::uint64_t > > | added_nodes |
bookkeeping of added and removed nodes More... | |
bool | has_element_buffers |
bool | has_node_buffers |
Class to adapt the mesh.
First call prepare(). This puts mesh in inconsistent state, but allows it to be changed more easily. Then indicate all the changes with functions like
Definition at line 45 of file MeshAdaptor.hpp.
MeshAdaptor | ( | mesh::Mesh & | mesh | ) |
Constructor.
Definition at line 171 of file MeshAdaptor.cpp.
|
virtual |
Destructor.
Definition at line 186 of file MeshAdaptor.cpp.
void add_element | ( | const PackedElement & | packed_element | ) |
Add element to the mesh.
Definition at line 372 of file MeshAdaptor.cpp.
void add_node | ( | const PackedNode & | packed_node | ) |
Add node from the mesh.
Definition at line 421 of file MeshAdaptor.cpp.
void assign_global_numbering_and_rank_to_unknown_elems | ( | ) |
Exactly what it says new elements have a rank and glb_idx to be Uint::max or std::numeric_limits<boost::uint64_t>::max()
Definition at line 1803 of file MeshAdaptor.cpp.
void assign_partition_agnostic_global_indices_to_dict | ( | Dictionary & | dict | ) |
Nodes found on pid 0 will be numbered from 0 to nb_nodes(pid0) NEW nodes found on pid 1 will be numbered from nb_nodes(pid0) to nb_nodes(pid0+pid1) NEW nodes found on pid 2 will be numbered from nb_nodes(pid0+pid1) to nb_nodes(pid0+pid1+pid2) ... Any ownership is not claimed! It is still possible that a node with glb_idx between nb_nodes(pid0) and nb_nodes(pid0+pid1) is owned by pid0 or pid1 or pid2. Only when a call to fix_node_ranks() is done, will ownership be claimed by the proc that found the node, with the lowest pid.
Definition at line 1696 of file MeshAdaptor.cpp.
void clear_element_buffers | ( | ) |
Creates buffers for element changes.
Definition at line 247 of file MeshAdaptor.cpp.
void clear_node_buffers | ( | ) |
Creates buffers for node changes.
Definition at line 292 of file MeshAdaptor.cpp.
void combine_mesh | ( | const Mesh & | other_mesh | ) |
Add another mesh to this mesh.
Definition at line 1330 of file MeshAdaptor.cpp.
void create_element_buffers | ( | ) |
Creates buffers for element changes.
Definition at line 222 of file MeshAdaptor.cpp.
void create_node_buffers | ( | ) |
Creates buffers for node changes.
Definition at line 267 of file MeshAdaptor.cpp.
void find_nodes_to_export | ( | const std::vector< std::vector< std::vector< Uint > > > & | exported_elements_loc_id, |
std::vector< std::vector< std::vector< Uint > > > & | exported_nodes_loc_id | ||
) |
Assemble a change-set of nodes to be sent together with elements.
[in] | exported_elements_loc_id | A set with 3 indices: send_element[to_pid][from_entities_idx][local_elem_idx] |
[out] | exported_nodes_loc_id | A set with 3 indices: send_node[to_pid][from_dict_idx][local_node_idx] |
Definition at line 549 of file MeshAdaptor.cpp.
void finish | ( | ) |
Apply the changes the mesh adaptor for changes and fix inconsistent state.
Definition at line 205 of file MeshAdaptor.cpp.
void fix_node_ranks | ( | ) |
Correct ranks of nodes to be unique in all pid's.
Definition at line 1044 of file MeshAdaptor.cpp.
void flush_elements | ( | ) |
Apply all changes to elements.
Definition at line 467 of file MeshAdaptor.cpp.
void flush_nodes | ( | ) |
Apply all changes to nodes.
Definition at line 492 of file MeshAdaptor.cpp.
void grow_overlap | ( | ) |
Create an additional cell-layer of overlap between pid's.
Definition at line 1178 of file MeshAdaptor.cpp.
void make_element_node_connectivity_global | ( | ) |
Element-node connectivity is replaced with global indices.
This is to allow elements from other ranks to be added, in which case local indices are meaningless
Definition at line 312 of file MeshAdaptor.cpp.
void move_elements | ( | const std::vector< std::vector< std::vector< Uint > > > & | exported_elements_loc_id | ) |
Move elements and attached nodes between processors, according to an elements_changeset.
[in] | exported_elements_loc_id | A set with 3 indices: move_element[to_pid][from_entities_idx][local_elem_idx] |
Definition at line 844 of file MeshAdaptor.cpp.
void prepare | ( | ) |
Prepare the mesh adaptor for changes.
Prepare the mesh adaptor for changes to add/remove nodes and elements The element-node connectivity tables are replaced with global node indices instead of local indices, so that elements from other processes can be added.
Definition at line 192 of file MeshAdaptor.cpp.
void rebuild_node_glb_to_loc_map | ( | ) |
rebuild dictionary.glb_to_loc() map with flushed nodes included
Definition at line 811 of file MeshAdaptor.cpp.
void rebuild_node_to_element_connectivity | ( | ) |
rebuild dictionary.connectivity() map with flushed nodes and elements included
Definition at line 827 of file MeshAdaptor.cpp.
void remove_duplicate_elements_and_nodes | ( | ) |
Add another mesh to this mesh.
Definition at line 1537 of file MeshAdaptor.cpp.
void remove_element | ( | const PackedElement & | packed_element | ) |
Remove element from the mesh.
Definition at line 395 of file MeshAdaptor.cpp.
Remove element from the mesh.
Definition at line 402 of file MeshAdaptor.cpp.
void remove_ghost_elements | ( | ) |
remove ghost elements
Definition at line 518 of file MeshAdaptor.cpp.
void remove_ghost_nodes | ( | ) |
remove ghost nodes
Definition at line 534 of file MeshAdaptor.cpp.
void remove_node | ( | const PackedNode & | packed_node | ) |
Remove node from the mesh.
Definition at line 444 of file MeshAdaptor.cpp.
Remove node from the mesh.
Definition at line 451 of file MeshAdaptor.cpp.
void restore_element_node_connectivity | ( | ) |
Element-node connectivity is restored with local indices.
Definition at line 341 of file MeshAdaptor.cpp.
void send_elements | ( | const std::vector< std::vector< std::vector< Uint > > > & | exported_elements_loc_id, |
std::vector< std::vector< std::vector< boost::uint64_t > > > & | imported_elements_glb_id | ||
) |
Send/Receive elements according to an elements-changeset.
[in] | exported_elements_loc_id | A set with 3 indices: send_element[to_pid][from_entities_idx][local_elem_idx] |
[out] | imported_elements_glb_id | A set with 3 indices: received_element[from_pid][from_entities_idx][glb_elem_idx] |
Definition at line 620 of file MeshAdaptor.cpp.
void send_nodes | ( | const std::vector< std::vector< std::vector< Uint > > > & | exported_nodes_loc_id, |
std::vector< std::vector< std::vector< boost::uint64_t > > > & | imported_nodes_glb_id | ||
) |
Send/Receive nodes according to an nodes-changeset.
[in] | exported_nodes_loc_id | A set with 3 indices: send_node[to_pid][from_dict_idx][local_node_idx] |
[out] | imported_nodes_glb_id | A set with 3 indices: received_node[from_pid][from_dict_idx][glb_node_idx] |
Definition at line 726 of file MeshAdaptor.cpp.
|
private |
bookkeeping of added and removed elements
Definition at line 256 of file MeshAdaptor.hpp.
|
private |
bookkeeping of added and removed nodes
Definition at line 259 of file MeshAdaptor.hpp.
|
private |
flag if there are still elements that need to be flush
Definition at line 250 of file MeshAdaptor.hpp.
|
private |
Element buffers for element-node connectivity.
Definition at line 232 of file MeshAdaptor.hpp.
|
private |
Element buffers for global index.
Definition at line 226 of file MeshAdaptor.hpp.
|
private |
Element buffers for rank.
Definition at line 229 of file MeshAdaptor.hpp.
|
private |
Definition at line 261 of file MeshAdaptor.hpp.
|
private |
Definition at line 263 of file MeshAdaptor.hpp.
|
private |
boolean that says if mesh has element-node connectivities with global node-indices
Definition at line 223 of file MeshAdaptor.hpp.
Handle to the mesh.
Definition at line 220 of file MeshAdaptor.hpp.
|
private |
flag if dictionary.connectivity() must be rebuilt
Definition at line 247 of file MeshAdaptor.hpp.
|
private |
Node buffers for field values.
Definition at line 241 of file MeshAdaptor.hpp.
|
private |
flag if there are still nodes that need to be flush
Definition at line 253 of file MeshAdaptor.hpp.
|
private |
Node buffers for global index.
Definition at line 235 of file MeshAdaptor.hpp.
|
private |
flag if dictionary.glb_to_loc() must be rebuilt
Definition at line 244 of file MeshAdaptor.hpp.
|
private |
Node buffers for rank.
Definition at line 238 of file MeshAdaptor.hpp.
Send comments to: COOLFluiD Web Admin |