INMOST
Mathematical Modelling Toolkit
|
#include <inmost_mesh.h>
Classes | |
class | base_iterator |
class | BulkComparator |
class | BulkDFComparator |
class | CentroidComparator |
class | exchange_data |
class | GlobalIDComparator |
class | HierarchyComparator |
class | IntegerComparator |
class | IntegerDFComparator |
class | RealComparator |
class | RealDFComparator |
Public Types | |
enum | MeshState { Serial, Parallel } |
enum | Action { AGhost, AMigrate } |
enum | Prepare { UnknownSize, UnknownSource } |
typedef chunk_array< integer, chunk_bits_empty > | empty_container |
typedef chunk_array< integer, chunk_bits_elems > | links_container |
typedef TagManager::sparse_sub_type | sparse_type |
typedef TagManager::sparse_sub_record | sparse_rec |
typedef sparse_type::size_type | senum |
typedef void(* | ReduceOperation )(const Tag &tag, const Element &element, const INMOST_DATA_BULK_TYPE *recv_data, INMOST_DATA_ENUM_TYPE recv_size) |
typedef std::vector< Tag > | tag_set |
typedef std::vector< HandleType > | element_set |
typedef std::vector < INMOST_DATA_BULK_TYPE > | buffer_type |
typedef std::map< int, element_set > | proc_elements |
typedef std::pair< int, buffer_type > | proc_buffer_type |
typedef std::vector < proc_buffer_type > | exch_buffer_type |
typedef base_iterator< Storage > | iteratorStorage |
typedef base_iterator< Element > | iteratorElement |
typedef base_iterator< ElementSet > | iteratorSet |
typedef base_iterator< Cell > | iteratorCell |
typedef base_iterator< Face > | iteratorFace |
typedef base_iterator< Edge > | iteratorEdge |
typedef base_iterator< Node > | iteratorNode |
typedef tiny_map < GeometricData, ElementType, 5 > | GeomParam |
Public Types inherited from INMOST::TagManager | |
typedef tag_array_type::iterator | iteratorTag |
Public Types inherited from INMOST::Storage | |
typedef INMOST_DATA_REAL_TYPE | real |
Storage type for representing real values. More... | |
typedef INMOST_DATA_INTEGER_TYPE | integer |
Storage type for representing integer values. More... | |
typedef INMOST_DATA_BULK_TYPE | bulk |
Storage type for representing one byte of abstact data. More... | |
typedef INMOST_DATA_ENUM_TYPE | enumerator |
type for representing unsigned integer values. More... | |
typedef HandleType | reference |
Storage type for representing references to Element. More... | |
typedef RemoteHandleType | remote_reference |
Storage type for representing references to Element in another Mesh. More... | |
typedef shell< real > | real_array |
Storage type for representing arrays of real values. More... | |
typedef shell< integer > | integer_array |
Storage type for representing arrays of integer values. More... | |
typedef shell< bulk > | bulk_array |
Storage type for representing abstact data as a series of bytes. More... | |
typedef variable | var |
Storage type for representing real value with vector of variations. More... | |
typedef shell< variable > | var_array |
Storage type for representing array of values with vectors of variations. More... | |
Static Public Member Functions | |
static void | Initialize (int *argc, char ***argv) |
static void | Finalize () |
Finalizes operation with MPI, recomended to call, otherwise MPI may produce warnings. More... | |
static Mesh * | GetMesh (std::string name) |
Find mesh by name. More... | |
Definition at line 1205 of file inmost_mesh.h.
typedef std::vector<INMOST_DATA_BULK_TYPE> INMOST::Mesh::buffer_type |
Definition at line 2148 of file inmost_mesh.h.
typedef std::vector<HandleType> INMOST::Mesh::element_set |
Definition at line 2147 of file inmost_mesh.h.
typedef chunk_array<integer,chunk_bits_empty> INMOST::Mesh::empty_container |
Definition at line 1210 of file inmost_mesh.h.
typedef std::vector< proc_buffer_type > INMOST::Mesh::exch_buffer_type |
Definition at line 2151 of file inmost_mesh.h.
typedef tiny_map<GeometricData, ElementType,5> INMOST::Mesh::GeomParam |
Definition at line 2992 of file inmost_mesh.h.
typedef base_iterator<Cell> INMOST::Mesh::iteratorCell |
Definition at line 2849 of file inmost_mesh.h.
typedef base_iterator<Edge> INMOST::Mesh::iteratorEdge |
Definition at line 2851 of file inmost_mesh.h.
Definition at line 2847 of file inmost_mesh.h.
typedef base_iterator<Face> INMOST::Mesh::iteratorFace |
Definition at line 2850 of file inmost_mesh.h.
typedef base_iterator<Node> INMOST::Mesh::iteratorNode |
Definition at line 2852 of file inmost_mesh.h.
Definition at line 2848 of file inmost_mesh.h.
Definition at line 2845 of file inmost_mesh.h.
typedef chunk_array<integer,chunk_bits_elems> INMOST::Mesh::links_container |
Definition at line 1212 of file inmost_mesh.h.
typedef std::pair<int, buffer_type > INMOST::Mesh::proc_buffer_type |
Definition at line 2150 of file inmost_mesh.h.
typedef std::map<int, element_set > INMOST::Mesh::proc_elements |
Definition at line 2149 of file inmost_mesh.h.
typedef void(* INMOST::Mesh::ReduceOperation)(const Tag &tag, const Element &element, const INMOST_DATA_BULK_TYPE *recv_data, INMOST_DATA_ENUM_TYPE recv_size) |
Definition at line 2145 of file inmost_mesh.h.
Definition at line 1220 of file inmost_mesh.h.
Definition at line 1218 of file inmost_mesh.h.
Definition at line 1216 of file inmost_mesh.h.
typedef std::vector<Tag> INMOST::Mesh::tag_set |
Definition at line 2146 of file inmost_mesh.h.
enum INMOST::Mesh::Action |
Enumerator | |
---|---|
AGhost | |
AMigrate |
Definition at line 2143 of file inmost_mesh.h.
Enumerator | |
---|---|
Serial | |
Parallel |
Definition at line 1208 of file inmost_mesh.h.
Enumerator | |
---|---|
UnknownSize | |
UnknownSource |
Definition at line 2144 of file inmost_mesh.h.
INMOST::Mesh::Mesh | ( | ) |
INMOST::Mesh::Mesh | ( | std::string | name | ) |
INMOST::Mesh::Mesh | ( | const Mesh & | other | ) |
INMOST::Mesh::~Mesh | ( | ) |
void INMOST::Mesh::ApplyModification | ( | ) |
After this function any link to deleted element will be replaced by InvalidHandle(). This will modify DATA_REFERENCE tags and contents of sets, so that all deleted elements are not referenced anymore. If you have any tags of type DATA_REMOTE_REFERENCE on current mesh linking to the elements of the current mesh or there are other meshes that posses tags of type DATA_REMOTE_REFERENCE and link elements on the current mesh, you should check that there are no links to deleted elements manually with Element::Old().
void INMOST::Mesh::AssignGlobalID | ( | ElementType | mask | ) |
Assign unique numbers to elements. Internally this will create Mesh::GlobalIDTag and make call to Element::GlobalID and Mesh::GlobalID functions valid. Internally this will also set have_global_id variable that will indicate that all the comparisons in parallel algorithms should be performed using global identificators instead of centroids which is faster.
iteratorStorage INMOST::Mesh::Begin | ( | ElementType | Types | ) |
These iterators skip invalid elements but don't skip modified elements.
iteratorCell INMOST::Mesh::BeginCell | ( | ) |
iteratorEdge INMOST::Mesh::BeginEdge | ( | ) |
iteratorElement INMOST::Mesh::BeginElement | ( | ElementType | Types | ) |
iteratorFace INMOST::Mesh::BeginFace | ( | ) |
void INMOST::Mesh::BeginModification | ( | ) |
iteratorNode INMOST::Mesh::BeginNode | ( | ) |
void INMOST::Mesh::BeginSequentialCode | ( | ) |
iteratorSet INMOST::Mesh::BeginSet | ( | ) |
|
inline |
Returns the first tag defined on the mesh. For safety while iterating through tags you should check for validity of the tag
Definition at line 1368 of file inmost_mesh.h.
TopologyCheck INMOST::Mesh::BeginTopologyCheck | ( | ElementType | etype, |
const HandleType * | adj, | ||
enumerator | num | ||
) |
This function allows you to perform some topologycal checks before you create an element. Function is used internally by CreateEdge, CreateFace, CreateCell functions If you perform topological checks on your own, you'd probably better turn off checks before calling CreateXXX functions. Note that check for duplicates within mesh is performed by Mesh::FindSharedAdjacency.
Definition at line 1331 of file inmost_mesh.h.
bulk& INMOST::Mesh::Bulk | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns a reference in inner representation to the first element of array of bytes. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.
If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.
Reference to the data is guaranteed to be valid during mesh modification.
h | element handle |
tag | tag that represents data |
bulk_array INMOST::Mesh::BulkArray | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns an array of bytes.
If you know that data is certanly sparse or dense on elements you access then it is faster to use variants of this function with hint data structure.
Array data structure is guaranteed to be valid during mesh modification.
h | element handle |
tag | tag that represents data |
|
inline |
Returns an array of bytes in dense array. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set), likely to result in segfault.
Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1682 of file inmost_mesh.h.
|
inline |
Returns an array of bytes in dense array of variable size. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents data |
Definition at line 1836 of file inmost_mesh.h.
|
inline |
Returns a reference in dense array to the first element of constant size array of bytes. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1617 of file inmost_mesh.h.
|
inline |
Returns a reference in dense array to the first element of variable size array of bytes. Future recomendation: If array was not allocated then this function will generate segmentation fault.
If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents data |
Definition at line 1777 of file inmost_mesh.h.
Definition at line 2815 of file inmost_mesh.h.
Definition at line 2821 of file inmost_mesh.h.
void INMOST::Mesh::Clear | ( | ) |
Remove all data and all elements from the mesh Reset geometry service and topology check flags
void INMOST::Mesh::ClearMarkerSpace | ( | HandleType | h | ) |
Remove all the markers from the element.
|
inline |
Revert mesh to clean topology error state.
Definition at line 3080 of file inmost_mesh.h.
void INMOST::Mesh::ComputeGeometricType | ( | HandleType | h | ) |
Recompute geometrical type of current element and set it to element.
h | handle of element |
Element::GeometricType INMOST::Mesh::ComputeGeometricType | ( | ElementType | element_type, |
const HandleType * | lower_adjacent, | ||
INMOST_DATA_ENUM_TYPE | lower_adjacent_size | ||
) | const |
Definition at line 1322 of file inmost_mesh.h.
enumerator INMOST::Mesh::Count | ( | const HandleType * | arr, |
enumerator | size, | ||
MarkerType | marker | ||
) | const |
integer INMOST::Mesh::CountBoundaryFaces | ( | ) |
integer INMOST::Mesh::CountInteriorFaces | ( | ) |
std::pair<Cell,bool> INMOST::Mesh::CreateCell | ( | const ElementArray< Face > & | faces, |
const ElementArray< Node > & | suggest_nodes_order = ElementArray< Node >(NULL) |
||
) |
std::pair<Cell,bool> INMOST::Mesh::CreateCell | ( | const ElementArray< Node > & | c_f_nodes, |
const integer * | c_f_numnodes, | ||
integer | num_c_faces, | ||
const ElementArray< Node > & | suggest_nodes_order = ElementArray< Node >(NULL) |
||
) |
std::pair<Cell,bool> INMOST::Mesh::CreateCell | ( | const ElementArray< Node > & | c_nodes, |
const integer * | c_f_nodeinds, | ||
const integer * | c_f_numnodes, | ||
integer | num_c_faces, | ||
const ElementArray< Node > & | suggest_nodes_order = ElementArray< Node >(NULL) |
||
) |
std::pair<Edge,bool> INMOST::Mesh::CreateEdge | ( | const ElementArray< Node > & | nodes | ) |
std::pair<Face,bool> INMOST::Mesh::CreateFace | ( | const ElementArray< Edge > & | edges | ) |
std::pair<Face,bool> INMOST::Mesh::CreateFace | ( | const ElementArray< Node > & | nodes | ) |
MarkerType INMOST::Mesh::CreateMarker | ( | ) |
Allocate a new marker. Assert will fire in debug mode (NDEBUG not set) if you run out of space for markers, in this case you either use too many markers, then you can just increase MarkerFields variable (increasing by 1 gives you 8 more markers) or you forget to release markers after you use them.
In release mode (NDEBUG is set) if you run out of space for markers function will return InvalidMarker()
Create node by given coordinates. This operation would not involve searching existing nodes for node with the same coordinates. It is potentially dangerous to have nodes whose coordinates differ by less then GetEpsilon since ResolveShared algorithm would not know how to resolve parallel statuses of the elements. However this may be subject to change, if ResolveShared algorithm will be rewritten to resolve cells first by their centroids and only then resolve all the rest elements by adjacency information.
coords | array of coordinates at least of size GetDimensions() |
MarkerType INMOST::Mesh::CreatePrivateMarker | ( | ) |
std::pair<ElementSet,bool> INMOST::Mesh::CreateSet | ( | std::string | name | ) |
std::pair<ElementSet,bool> INMOST::Mesh::CreateSetUnique | ( | std::string | name | ) |
Same as Mesh::CreateSet without checking existance of the set.
Tag INMOST::Mesh::CreateTag | ( | std::string | name, |
DataType | dtype, | ||
ElementType | etype, | ||
ElementType | sparse, | ||
INMOST_DATA_ENUM_TYPE | size = ENUMUNDEF |
||
) |
Create the tag by name, type and size. You cannot create the tag with the same name and different type or size.
You may make subsequent calls to the function with the same name, same type and same size (or undefined size, then it will be deduced) but different selection of element.
The following recomendation is for future: When you create data of variable size, every array of data for every element will be empty at first, so before accessing it through mechanism for single-valued data (Real, Integer, Bulk, Reference) you should first resize arrays otherwise your program very likely to be halted by segmentation fault. For this case arrays are not allocated automatically from performance considerations.
name | name of the tag |
dtype | type of the tag |
etype | the selection of elements on which the data of the tag is defined, you may use bitwise or operations to define tag on multiple types of elements, example CELL | FACE |
sparse | the selection of elements from etype on which the tag is sparse, for example, if you know that the data is used on all cells and only on boundary faces, then you may should set etype = CELL | FACE and sparse = FACE |
size | size of associated data |
|
inline |
Retrieve position of the data position of current element. After ReorderEmpty this number is guaranteed to be between 0 and NumberOf(type of element)
h | handle of the element |
Definition at line 2060 of file inmost_mesh.h.
void INMOST::Mesh::DelData | ( | HandleType | h, |
const Tag & | tag | ||
) |
Remove tag data from given element. Removes data of variable size and sparse tag data. Clears to zero data of fixed size.
h | handle to the element |
tag | tag that indicates the data |
void INMOST::Mesh::DelDenseData | ( | HandleType | h, |
const Tag & | tag | ||
) |
Removes data of variable size, clears to zero data of fixed size.
h | handle to the element |
tag | tag that indicates the data |
bool INMOST::Mesh::Delete | ( | HandleType | h | ) |
This function will hide element in modification state (between BeginModification and EndModification) or call Destroy in non-modification state.
h | handle of the element |
|
virtual |
Remove the data that is represented by the tag from elements of selected type.
tag | tag that indicates the data |
mask | the selection of the elements on which the data should be removed, may be set by bitwise or operation |
Reimplemented from INMOST::TagManager.
void INMOST::Mesh::DelSparseData | ( | HandleType | h, |
const Tag & | tag | ||
) |
Removes data of variable size and sparse tag data.
h | handle to the element |
tag | tag that indicates the data |
void INMOST::Mesh::Destroy | ( | HandleType | h | ) |
Completely destroy element from mesh. This function bypass check that mesh is in modification state and will remove element immediatly. It will disconnect element from lower adjacencies and delete all the upper adjacencies that depend on current element. If you don't want upper adjacencies to be deleted you should first use Element::Disconnect function to explicitly disconnect current element and then destroy it.
h | handle of the element |
|
inline |
Shortcut for typed elements.
Definition at line 2092 of file inmost_mesh.h.
Definition at line 2813 of file inmost_mesh.h.
Definition at line 2819 of file inmost_mesh.h.
|
inline |
Definition at line 2795 of file inmost_mesh.h.
|
inline |
Definition at line 2794 of file inmost_mesh.h.
iteratorStorage INMOST::Mesh::End | ( | ) |
iteratorCell INMOST::Mesh::EndCell | ( | ) |
iteratorEdge INMOST::Mesh::EndEdge | ( | ) |
iteratorElement INMOST::Mesh::EndElement | ( | ) |
iteratorFace INMOST::Mesh::EndFace | ( | ) |
void INMOST::Mesh::EndModification | ( | ) |
iteratorNode INMOST::Mesh::EndNode | ( | ) |
void INMOST::Mesh::EndSequentialCode | ( | ) |
iteratorSet INMOST::Mesh::EndSet | ( | ) |
|
inline |
Returns the indicator for loop to end iteration over tags.
Definition at line 1374 of file inmost_mesh.h.
TopologyCheck INMOST::Mesh::EndTopologyCheck | ( | HandleType | e | ) |
This function performs some topologycal checks after construction of element. Function is used internally by CreateEdge, CreateFace, CreateCell functions.
integer INMOST::Mesh::Enumerate | ( | ElementType | mask, |
Tag | num_tag, | ||
integer | start = 0 , |
||
bool | define_sparse = false |
||
) |
Enumerate all elements begining with start and put numeration to data associated with num_tag for all elements with given type mask.
Collective operation.
mask | bitwise or of types of elements |
num_tag | a tag that is associated with the data |
start | starting value for enumeration |
define_sparse | if true then function will define sparse data on elements that don't have it, otherwise it will skip those elements |
integer INMOST::Mesh::Enumerate | ( | const HandleType * | h, |
enumerator | num, | ||
const Tag & | num_tag, | ||
integer | start = 0 , |
||
bool | define_sparse = true |
||
) |
Enumerate all elements begining with start and put numeration to data associated with num_tag.
Collective operation.
h | array of handles |
num | number of handles |
num_tag | a tag that is associated with the data |
start | starting value for enumeration |
define_sparse | if true then function will define sparse data on elements that don't have it, otherwise it will skip those elements |
|
inline |
Enumerate all elements begining with start and put numeration to data associated with num_tag.
Collective operation.
elements | array of elements |
num_tag | a tag that is associated with the data |
start | starting value for enumeration |
define_sparse | if true then function will define sparse data on elements that don't have it, otherwise it will skip those elements |
Definition at line 2679 of file inmost_mesh.h.
integer INMOST::Mesh::EnumerateSet | ( | const ElementSet & | set, |
const Tag & | num_tag, | ||
integer | start = 0 , |
||
bool | define_sparse = true |
||
) |
Enumerate all elements in the set.
Collective operation.
set | handle of the set |
num_tag | a tag that is associated with the data |
start | starting value for enumeration |
define_sparse | if true then function will define sparse data on elements that don't have it, otherwise it will skip those elements |
|
inline |
Definition at line 2816 of file inmost_mesh.h.
Definition at line 2822 of file inmost_mesh.h.
void INMOST::Mesh::ExchangeData | ( | const Tag & | tag, |
ElementType | mask, | ||
MarkerType | select | ||
) |
Update data from Shared elements to Ghost elements. For backward direction please see Mesh::ReduceData. If you have a tag of DATA_BULK type and you store your own custom data structure in it, it is highly recomended that you provide MPI information about your structure through Tag::SetBulkDataType, this would not do any difference on homogeneous architecture, but it may help you save a lot of time and nerves in heterogeneous parallel environment.
Blocking, Collective point-2-point
tag | tag that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
void INMOST::Mesh::ExchangeData | ( | const tag_set & | tags, |
ElementType | mask, | ||
MarkerType | select | ||
) |
This function will perform exchange of multiple data tags.
Blocking, Collective point-2-point
tags | multiple tags that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
void INMOST::Mesh::ExchangeDataBegin | ( | const Tag & | tag, |
ElementType | mask, | ||
MarkerType | select, | ||
exchange_data & | storage | ||
) |
Start asynchronous synchronization of data. You should define object of type exchange_data that will hold temporary buffers for data. every Mesh::ExchangeDataBegin should be matched with Mesh::ExchangeDataEnd with the same exchange_data object. After matching Mesh::ExchangeDataEnd the exchange_data object may be reused If you will go out of the scope where exchange_data object was defined it will be deallocated and may result in segmentation fault.
You should also never put the same exchange_data object to any other Mesh::ExchangeDataBegin or Mesh::ReduceDataBegin, until matching Mesh::ExchangeDataEnd because it may override or reallocate buffers, internally used by MPI and remote processor will receive garbage instead of data.
Nonblocking, Collective point-2-point
tag | tag that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
storage | buffer that will temporary hold sended data |
void INMOST::Mesh::ExchangeDataBegin | ( | const tag_set & | tags, |
ElementType | mask, | ||
MarkerType | select, | ||
exchange_data & | storage | ||
) |
This function will initialize exchange of multiple data tags. Using this function may lead to good overlapping between communication and computation.
Nonblocking, Collective point-2-point
tags | multiple tags that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
storage | buffer that will temporary hold sended data |
void INMOST::Mesh::ExchangeDataEnd | ( | const Tag & | tag, |
ElementType | mask, | ||
MarkerType | select, | ||
exchange_data & | storage | ||
) |
Complete asynchronous synchronization of data.
Blocking
tag | tag that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
storage | buffer that will temporary hold sended data |
void INMOST::Mesh::ExchangeDataEnd | ( | const tag_set & | tags, |
ElementType | mask, | ||
MarkerType | select, | ||
exchange_data & | storage | ||
) |
This function will finalize exchange of multiple data tags.
Blocking
tags | multiple tags that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
storage | buffer that will temporary hold sended data |
void INMOST::Mesh::ExchangeGhost | ( | integer | layers, |
ElementType | bridge | ||
) |
Form several layers of ghosted cells that are adjacent through bridge elements to current cells. This function acceptes any mesh topology, failure on some mesh should be considered a bug and sample example should be provided for testing purposes.
This function internally calculates layer by layer and invokes ExchangeMarked for each layer, you can either reproduce the algorithm on your own if you want to bypass the function and call Mesh::ExchangeMarked directly, but then you will lose optimization in Mesh::Redistribute, that expects that layers are formed the same way they are formed in Mesh::ExchangeGhost. Internally it sets up LayersTag and BridgeTag for the mesh with provided values, which are used by Mesh::Redistribute but you are discouraged to override these tags since using non-matching algorithms is not tested and should be considered dangerous.
Nevertheless you can use this function first for layers then request any additional ghosted elements by ExchangeMarked.
Collective point-2-point.
layers | number of required layers of ghosted elements |
bridge | bitwise mask of elements for which neighbouring cells should be considered a layer |
This function realizes two algorithms: ghosting of elements and migration of elements. ghosting:
Creates ghosted elements at other processors prescribed in SendtoTag() performs sending and receiving of elements and all operations to keep parallel state of the mesh.
Given that all the data was up to date among processors all the data at the end of the algorithm will be also up to data
migration:
To correctly perform migration of elements it is necessery to set up tags besides SendToTag(), which indicates to where every element should be sent:
if there is no current processor in "TEMPORARY_NEW_PROCESSORS", then current processor will remove copy of the element. All this actions are performed automatically by Mesh::Redistribute based on information provided in Mesh::RedistributeTag which effectively contains new owner.
Given that all the data was up to date among processors all the data at the end of the algorithm will be also up to data
Collective point-2-point.
action |
Compute sum of integer values for all processors with rank lower then current, excluding current processor.
Collective operation.
input | value on current processor |
Definition at line 2814 of file inmost_mesh.h.
Definition at line 2820 of file inmost_mesh.h.
|
static |
Finalizes operation with MPI, recomended to call, otherwise MPI may produce warnings.
HandleType INMOST::Mesh::FindSharedAdjacency | ( | const HandleType * | arr, |
enumerator | num | ||
) | const |
Retrieve upper adjacent that is shared by multiple lower adjacencies.
|
inline |
|
inline |
integer INMOST::Mesh::FirstLocalID | ( | ElementType | etype | ) | const |
ElementArray<Face> INMOST::Mesh::GatherBoundaryFaces | ( | ) |
ElementArray<Face> INMOST::Mesh::GatherInteriorFaces | ( | ) |
INMOST_DATA_ENUM_TYPE INMOST::Mesh::GetArrayCapacity | ( | integer | etypenum | ) |
This function is needed by TagManager, may be made private in future follows definition of chunk_array to estimate current occupancy of arrays
INMOST_MPI_Comm INMOST::Mesh::GetCommunicator | ( | ) |
Retrieve MPI communicator.
void INMOST::Mesh::GetData | ( | HandleType | h, |
const Tag & | tag, | ||
enumerator | shift, | ||
enumerator | size, | ||
void * | data | ||
) | const |
Copy inner data array of size elements to provided array begining from shift element. It is assumed that user-provided array don't overlap inner data.
h | handle of element |
tag | tag that represents data |
shift | for which element to start to copy |
size | how many elements to copy |
data | user-provided array where data should be copied |
INMOST_DATA_ENUM_TYPE INMOST::Mesh::GetDataCapacity | ( | HandleType | h, |
const Tag & | tag | ||
) | const |
Return the size of the structure required to represent the data on current element. This is equal to GetDataSize times Tag::GetBytesSize for all the data types, except for DATA_VARIABLE, that requires a larger structure to accomodate derivatives.
h | handle of element |
tag | tag that represents the data |
INMOST_DATA_ENUM_TYPE INMOST::Mesh::GetDataSize | ( | HandleType | h, |
const Tag & | tag | ||
) | const |
Return the size of the array. For variable size arrays returns current size of the array. For constant size array returns the same value that may be obtained through GetSize.
h | handle of element |
tag | tag that represents the data |
Get number of dimensions of mesh. Size of the array returned by Node::Coords will match this number.
Definition at line 1317 of file inmost_mesh.h.
Retrieve tolerance for coordinates comparison.
Definition at line 1307 of file inmost_mesh.h.
std::string INMOST::Mesh::GetFileOption | ( | std::string | key | ) |
Get current option corresponding to key.
key | options for which options should be retrieven |
void INMOST::Mesh::GetGeometricData | ( | HandleType | e, |
GeometricData | type, | ||
real * | ret | ||
) |
const Tag& INMOST::Mesh::GetGeometricTag | ( | GeometricData | type | ) | const |
|
inline |
|
inline |
Check whether the marker is set one the element.
h | element handle |
n | stores byte number and byte bit mask that represent marker |
Definition at line 1911 of file inmost_mesh.h.
void INMOST::Mesh::GetMarkerSpace | ( | HandleType | h, |
bulk | copy[MarkerFields] | ||
) | const |
Get a copy of the bytes that store markers on the element.
h | element handle |
copy | storage to put data to |
|
static |
Find mesh by name.
std::string INMOST::Mesh::GetMeshName | ( | ) |
Retrive the name of the current mesh.
Get parallel state of the mesh
Definition at line 1320 of file inmost_mesh.h.
enumerator INMOST::Mesh::getNext | ( | const HandleType * | arr, |
enumerator | size, | ||
enumerator | k, | ||
MarkerType | marker | ||
) | const |
|
inline |
Retrieve currently set parallel strategy for ".pmf" files
Definition at line 2348 of file inmost_mesh.h.
|
inline |
Retrieve currently set parallel strategy.
Definition at line 2304 of file inmost_mesh.h.
bool INMOST::Mesh::GetPrivateMarker | ( | HandleType | h, |
MarkerType | n | ||
) | const |
int INMOST::Mesh::GetProcessorRank | ( | ) |
Get rank of current processor.
int INMOST::Mesh::GetProcessorsNumber | ( | ) |
Get number of processors.
ElementSet INMOST::Mesh::GetSet | ( | std::string | name | ) |
ElementArray<ElementSet> INMOST::Mesh::GetSetsByPrefix | ( | std::string | prefix | ) |
Retrieve all the sets whose names start with given prefix.
|
inline |
Retrieve parallel status of the element. If mesh is in Serial state then call always returns Element::Owned. otherwise it will return:
h | handle of the element |
Definition at line 2069 of file inmost_mesh.h.
|
inline |
Retrieve currently set topology checks.
Definition at line 3070 of file inmost_mesh.h.
|
inline |
Retrieve topology error state, this indicates that some error have occured.
Definition at line 3078 of file inmost_mesh.h.
|
inline |
Retrieve global id of the element with right of modification (dangerous to modify). Run AssignGlobalID so that tag is automatically allocated and shortcut is set within mesh, otherwise tag is not created and call will fail.
h | handle of the element |
Definition at line 2048 of file inmost_mesh.h.
|
inline |
Retrieve global id of the element without right of modification. Run AssignGlobalID so that tag is automatically allocated and shortcut is set within mesh, otherwise tag is not created and call will fail.
h | handle of the element |
Definition at line 2055 of file inmost_mesh.h.
|
inline |
For debug purposes.
Definition at line 1272 of file inmost_mesh.h.
bool INMOST::Mesh::HaveData | ( | HandleType | h, |
const Tag & | tag | ||
) | const |
Check whether data is present on given element. Always returns true for dense tag data.
h | handle to the element |
tag | tag that indicates data |
|
inline |
bool INMOST::Mesh::Hidden | ( | HandleType | h | ) | const |
bool INMOST::Mesh::Hide | ( | HandleType | h | ) |
Hide element from mesh. All the functions (except direct access like LowConn,HighConn or ElementSet::getElementsHandles) involving adjacencies retrival would not return this element. Works only inside BeginModification and EndModification, on EndModification all Hidden elements are destroyed.
h | handle of the element |
|
inline |
Definition at line 3019 of file inmost_mesh.h.
|
inline |
Access directly higher order adjacencies of current element with right of modification. This function gives direct access to elements and allows you to overwrite handles which is not recomended. You bypass topology checks, correct connectivity estableshment and geometric data updates. If you do so then check connectivity afterwards by Element::CheckElementConnectivity for debugging purposes. Then for correct function of geometrical algorithms in order from lower modified adjacenices to upper modified adjacencies (if some element have lower adjacencies updated then it should be updated otherwise it shouldn't) call ComputeGeometricType to deduce geometric representation or force it by SetGeometricType, then for element of type CELL call RestoreCellNodes, clear current mutual connection to the nodes and establish new mutual connections from nodes returned by RestoreCellNodes; then for all elements call RecomputeGeometricData to automatically recompute all geometric quantities. Don't forget that edges of the face should be ordered for correct retrival of nodes, otherwise Face::getNodes and Element::getNodes for FACE in 3 dimensions or Cell::getNodes and Element::getNodes for CELL in 2 dimensions will return garbage
h | handle of the element |
Definition at line 1966 of file inmost_mesh.h.
|
inline |
Access directly higher order adjacencies of current element without right of modification.
Definition at line 1968 of file inmost_mesh.h.
|
static |
Initial initialization. Calls MPI_Initialize, if MPI was not initialized it is necessery to invoke this function if you plan to use any parallel algorithms Accepts arguments passed to console aplication or NULL
argc | number of arguments for command line |
argv | strings of arguments of command line |
integer& INMOST::Mesh::Integer | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns a reference to inner memory location of the first element of the array of integer values. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.
If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.
Reference to the data is guaranteed to be valid during mesh modification.
h | element handle |
tag | tag that represents data |
integer_array INMOST::Mesh::IntegerArray | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns an array of integer values. If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function. variants of this function with hint data structure.
Array data structure is guaranteed to be valid during mesh modification.
h | element handle |
tag | tag that represents data |
|
inline |
Returns an array of integer values in dense array. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set), likely to result in segfault.
Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1669 of file inmost_mesh.h.
|
inline |
Returns an array of integer values in dense array of variable size. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents data |
Definition at line 1827 of file inmost_mesh.h.
|
inline |
Returns a reference to inner memory location of the first element of the array of integer values. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1608 of file inmost_mesh.h.
|
inline |
Returns a reference in dense array to the first element of variable size array of integer values. Future recomendation: If array was not allocated then this function will generate segmentation fault.
If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents data |
Definition at line 1764 of file inmost_mesh.h.
Integrate real value over all processors.
Collective operation.
input | Value on current processor |
Integrate integer value over all processors.
Collective operation.
input | Value on current processor |
Integrate an array of real values over all processors.
Collective operation.
input | An array of values on current processor. |
size | Size of the array. |
Integrate an array of integer values over all processors.
Collective operation.
input | An array of values on current processor. |
size | Size of the array. |
real INMOST::Mesh::Integrate | ( | const Tag & | t, |
enumerator | entry, | ||
ElementType | mask | ||
) |
Integrate data corresponding to tag between all processors. Elements without the data defined on them or when entry not present will be skipped.
Collective operation.
t | tag that correspond to data to be integrated |
entry | in the array of data |
mask | bitwise or of types of elements on which to integrate |
|
inline |
Check whether code runs between Mesh::BeginModification, Mesh::EndModification scope. In case mesh is modified, on element construction Mesh::TieElements will always place elements to the end of the array as a result all the newly created elements will be iterated after current or hidden elements.
Definition at line 3018 of file inmost_mesh.h.
bool INMOST::Mesh::isParallelFileFormat | ( | std::string | File | ) |
|
inline |
|
inline |
Definition at line 1411 of file inmost_mesh.h.
bool INMOST::Mesh::isValidHandleRange | ( | HandleType | h | ) | const |
|
inline |
Definition at line 1401 of file inmost_mesh.h.
|
inline |
|
inline |
|
inline |
Definition at line 2833 of file inmost_mesh.h.
Definition at line 1330 of file inmost_mesh.h.
void INMOST::Mesh::Load | ( | std::string | File | ) |
Acceptable file formats for reading
File | path to the file |
void INMOST::Mesh::LoadECL | ( | std::string | File | ) |
void INMOST::Mesh::LoadMKF | ( | std::string | File | ) |
void INMOST::Mesh::LoadMSH | ( | std::string | File | ) |
void INMOST::Mesh::LoadPMF | ( | std::string | File | ) |
void INMOST::Mesh::LoadPVTK | ( | std::string | File | ) |
void INMOST::Mesh::LoadVTK | ( | std::string | File | ) |
void INMOST::Mesh::LoadXML | ( | std::string | File | ) |
|
inline |
Access directly lower order adjacencies of current element with right of modification. This function gives direct access to elements and allows you to overwrite handles. If you are going to overwrite them then read recomendations in description for HighConn function.
h | handle of the element |
Definition at line 1980 of file inmost_mesh.h.
|
inline |
Access directly lower order adjacencies of current element without right of modification.
Definition at line 1982 of file inmost_mesh.h.
enumerator INMOST::Mesh::MemoryUsage | ( | HandleType | h | ) |
For parmetis return total number in bytes of occupied memory by element and its data
bool INMOST::Mesh::New | ( | HandleType | h | ) | const |
Check whether element is new. Works only in modification state (between BeginModification and EndModification), when you create elements all of them are marked.
|
inline |
Definition at line 3020 of file inmost_mesh.h.
HandleType INMOST::Mesh::NextHandle | ( | HandleType | h | ) | const |
HandleType INMOST::Mesh::NextHandle | ( | HandleType | h, |
ElementType | mask | ||
) | const |
|
inline |
Definition at line 2812 of file inmost_mesh.h.
Definition at line 2818 of file inmost_mesh.h.
integer INMOST::Mesh::NumberOf | ( | ElementType | t | ) | const |
Definition at line 2837 of file inmost_mesh.h.
Definition at line 2839 of file inmost_mesh.h.
Definition at line 2841 of file inmost_mesh.h.
Definition at line 2838 of file inmost_mesh.h.
Definition at line 2840 of file inmost_mesh.h.
Definition at line 2836 of file inmost_mesh.h.
|
inline |
Retrieve the total number of valid tags.
Definition at line 1371 of file inmost_mesh.h.
Definition at line 1329 of file inmost_mesh.h.
void INMOST::Mesh::PrepareGeometricData | ( | GeomParam | table | ) |
HandleType INMOST::Mesh::PrevHandle | ( | HandleType | h | ) | const |
HandleType INMOST::Mesh::PrevHandle | ( | HandleType | h, |
ElementType | mask | ||
) | const |
|
inline |
Definition at line 1332 of file inmost_mesh.h.
real& INMOST::Mesh::Real | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns a reference to inner memory location of the first element of the array of real values. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.
If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.
Reference to the data is guaranteed to be valid during mesh modification.
h | element handle |
tag | tag that represents data |
real_array INMOST::Mesh::RealArray | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns an array of real values. If you know that data is certanly dense on elements you access then it is faster to use variants of this function with hint data structure.
Array data structure is guaranteed to be valid during mesh modification.
h | element handle |
tag | tag that represents data |
|
inline |
Returns an array of real values in dense array. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).
Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1656 of file inmost_mesh.h.
|
inline |
Returns an array of real values in dense array of variable size. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents data |
Definition at line 1818 of file inmost_mesh.h.
|
inline |
Returns a reference to inner memory location of the first element of the array of real values. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents data |
Definition at line 1599 of file inmost_mesh.h.
|
inline |
Returns a reference in dense array to the first element of variable size array of real values. Future recomendation: If array was not allocated (resized) then this function will generate segmentation fault.
If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
h | element handle |
tag | tag that represents data |
Definition at line 1752 of file inmost_mesh.h.
void INMOST::Mesh::RecomputeGeometricData | ( | HandleType | e | ) |
void INMOST::Mesh::RecomputeParallelStorage | ( | ElementType | mask | ) |
Regather ghosted and shared element sets for data exchange. This function will be quite useful if you change statuses of elements or modify mesh on your own bypassing internal algorithms.
No action will be performed if USE_PARALLEL_STORAGE is not set in inmost_common.h, since all the elements are computed during exchange phase.
Generally this is not needed if you use high-level algorithms for mesh modification or mesh redistribution.
mask | bitwise type mask |
void INMOST::Mesh::Redistribute | ( | ) |
Migrate all the elements to the new owners prescribed in data corresponding to RedistributeTag. This will perform all the actions to send mesh elements and data and reproduce new mesh partitions on remote elements and correctly resolve parallel state of the mesh. If you have priviously prescribed number of layers through ExchangeGhost, then minimal number of actions will be performed to reproduce layers of ghosted elements whithout involving removal of all ghosted elements.
Internally function sets up following data on elements using provided information:
Action of this function regarding restoration of layers of ghosted elements in the case you have modified mesh without involving Mesh::ResolveModification is yet to be tested and should be considered dangerous.
If you have output from Zoltan or ParMetis for cells of the mesh then just write this output to RedistributeTag and call Mesh::Redistribute.
Collective point-2-point.
Don't put this shortcut to any function directly, as it creates tag inside assign to other object of type Tag and put this object to functions.
Definition at line 1337 of file inmost_mesh.h.
void INMOST::Mesh::ReduceData | ( | const Tag & | tag, |
ElementType | mask, | ||
MarkerType | select, | ||
ReduceOperation | op | ||
) |
Accumulation of data from ghost elements to shared elements.
Accumulation is performed based on user-provided function. When processor - owner of the element receives data addressed to this element then it calls user-defined op function. Since there may be multiple ghost elements per one shared element, function may be called multiple times.
Several examples of reduction functions may be found within the mesh_parallel.cpp source.
Remember that the result will be up to date only on the owner processor of the element. You will have to run Mesh::ExchangeData to make the data up to date among all of the processors.
If you have a tag of DATA_BULK type and you store your own custom data structure in it, it is highly recomended that you provide MPI information about your structure through Tag::SetBulkDataType, this would not do any difference on homogeneous architecture, but it may help you save a lot of time and nerves in heterogeneous parallel environment.
Exchanging tags of DATA_REFERNCE is not implemented, TODO 14.
Blocking, Collective point-2-point
tag | tag that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
op | user-defined operation on received data |
void INMOST::Mesh::ReduceData | ( | const tag_set & | tags, |
ElementType | mask, | ||
MarkerType | select, | ||
ReduceOperation | op | ||
) |
This function will perform reduction of multiple data tags. Note that function will be the same for all tags, you can differentiate behavior of function depending on tag name (may be expensive).
Blocking, collective point-2-point
tags | multiple tags that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
op | user-defined operation on received data |
void INMOST::Mesh::ReduceDataBegin | ( | const Tag & | tag, |
ElementType | mask, | ||
MarkerType | select, | ||
exchange_data & | storage | ||
) |
This function intializes data reduction. Read recomendations about exchange_storage object in Mesh::ExchangeDataBegin
Nonblocking, Collective point-2-point
tag | tag that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
storage | buffer that will temporary hold sended data |
void INMOST::Mesh::ReduceDataBegin | ( | const tag_set & | tags, |
ElementType | mask, | ||
MarkerType | select, | ||
exchange_data & | storage | ||
) |
This function will initialize reduction of multiple data tags.
Nonblocking, collective point-2-point
tags | multiple tags that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
storage | buffer that will temporary hold sended data |
void INMOST::Mesh::ReduceDataEnd | ( | const Tag & | tag, |
ElementType | mask, | ||
MarkerType | select, | ||
ReduceOperation | op, | ||
exchange_data & | storage | ||
) |
This function completes data reduction. Read Mesh::ReduceData for information about op function
Blocking
tag | tag that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
storage | buffer that will temporary hold sended data |
op | user-defined operation on received data |
void INMOST::Mesh::ReduceDataEnd | ( | const tag_set & | tags, |
ElementType | mask, | ||
MarkerType | select, | ||
ReduceOperation | op, | ||
exchange_data & | storage | ||
) |
This function will finalize exchange of multiple data tags.
Blocking
tags | multiple tags that represents data |
mask | bitwise or of element types |
select | set the marker to filter elements that perform operation, set 0 to select all elements |
storage | buffer that will temporary hold sended data |
op | user-defined operation on received data |
reference& INMOST::Mesh::Reference | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns a reference in an inner representation to the first element of array of element handles. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.
If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.
Reference to the data is guaranteed to be valid during mesh modification.
Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.
h | element handle |
tag | tag that represents data |
reference_array INMOST::Mesh::ReferenceArray | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns an array of element handles.
If you know that data is certanly sparse or dense on elements you access then it is faster to use variants of this function with hint data structure.
The class reference_array that is used to represent array of elements stores handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.
Array data structure is guaranteed to be valid during mesh modification. If you delete elements by Mesh::Delete or Element::Delete all the references are also will be valid and reverted to InvalidHandle on Mesh::ApplyModification. If you use Mesh::Destroy to delete mesh elements or you delete elements not within modification state then references may become either invalid but not testable against InvalidHandle (situation may be tested by Element::isValid or Mesh::isValidHandle) or reference may be reused by another element. If you mix deletion and construction of elements then there is no way to resolve this situation, except if you have created only one element, then it may be retrieved by Mesh::LastHandle.
h | element handle |
tag | tag that represents data |
|
inline |
Returns an array of element handles in dense array. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set), likely to result in segfault.
Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.
The class reference_array that is used to represent array of elements stores handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1711 of file inmost_mesh.h.
|
inline |
Returns an array of element handles in dense array of variable size. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
The class reference_array that is used to represent array of elements stores handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.
h | element handle |
tag | tag that represents data |
Definition at line 1861 of file inmost_mesh.h.
|
inline |
Returns a reference in dense array to the first element of constant size array of element handles. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).
Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1630 of file inmost_mesh.h.
|
inline |
Returns a reference in dense array to the first element of variable size array of element handles. Future recomendation: If array was not allocated then this function will generate segmentation fault.
If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.
h | element handle |
tag | tag that represents data |
Definition at line 1793 of file inmost_mesh.h.
void INMOST::Mesh::ReleaseMarker | ( | MarkerType | n | ) |
Release marker back for reuse. This function will only notice mesh that the marker is free to be reused, this will not clear markers from elements. Before releasing the marker you should ensure that all the marker is removed from all the elements. Since many inner algorithms use markers, not properly clearing markers from elements may lead to undefined behavior.
Since it is expensive to check asserts will fire in debug mode (NDEBUG not set) only if you define CHECKS_MARKERS in inmost_common.h, no checks will be performed in release mode(NDEBUG is set).
n | byte position and byte bit mask |
void INMOST::Mesh::ReleasePrivateMarker | ( | MarkerType | n | ) |
|
inline |
Remove the marker from the element.
h | element handle |
n | stores byte number and byte bit mask that represent marker |
Definition at line 1916 of file inmost_mesh.h.
|
inline |
Remove the marker from the set of handles.
h | set of handles |
n | number of handles |
m | stores byte number and byte bit mask that represent marker |
Definition at line 1923 of file inmost_mesh.h.
remote_reference& INMOST::Mesh::RemoteReference | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns a reference in an inner representation to the first element of array of element remote handles. Future recomendation: If variable size array was not allocated then this function will generate segmentation fault.
If you know that data is certanly dense and fixed or variable on elements you access then it is faster to use specialized variants of this function.
Reference to the data is guaranteed to be valid during mesh modification.
Using remote handle you can construct objects of type Element with the function MakeElement or MakeElementRef.
h | element handle |
tag | tag that represents data |
remote_reference_array INMOST::Mesh::RemoteReferenceArray | ( | HandleType | h, |
const Tag & | tag | ||
) |
Returns an array of element remote handles. If you know that data is certanly sparse or dense on elements you access then it is faster to use variants of this function with hint data structure.
The class reference_array that is used to represent array of elements stores remote handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form an object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain remote handle you may use remote_reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.
Array data structure is guaranteed to be valid during mesh modification. If you delete elements by Mesh::Delete or Element::Delete all the references are also will be valid and reverted to InvalidHandle on Mesh::ApplyModification. If you use Mesh::Destroy to delete mesh elements or you delete elements not within modification state then references may become either invalid but not testable against InvalidHandle (situation may be tested by Element::isValid or Mesh::isValidHandle) or reference may be reused by another element. If you mix deletion and construction of elements then there is no way to resolve this situation, except if you have created only one element, then it may be retrieved by Mesh::LastHandle.
h | element handle |
tag | tag that represents data |
|
inline |
Returns an array of element remote handles in dense array. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set), likely to result in segfault.
Note that as array is fixed you shouldn't use any functions that alter size of the array as resize, erase, insert, you may use replace if initial and final size will match, in debug mode assert will fire if you try to do this in release (NDEBUG is set) it will lead to segfault.
The class remote_reference_array that is used to represent array of elements stores handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1740 of file inmost_mesh.h.
|
inline |
Returns an array of element remote handles in dense array of variable size. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
The class remote_reference_array that is used to represent array of elements stores remote handles inside but accessing them through square scopes [] or by arrow -> in iterator will automatically form object of type Element. If you are not sure that stored handles are valid, you should either check that by Element::isValid (involves deep check) or test handle against InvalidHandle (simple check). To obtain handle you may use reference_array::at function or dereference * operator for iterator. If you need custom object like Node, Edge, Face, Cell or ElementSet you may use Element::getAsNode, Element::getAsEdge, Element::getAsFace, Element::getAsCell and Element::getAsSet functions.
h | element handle |
tag | tag that represents data |
Definition at line 1886 of file inmost_mesh.h.
|
inline |
Returns a reference in dense array to the first element of constant size array of element remote handles. If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and fixed is incorrect, no checks performed in release mode (NDEBUG is set).
Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.
h | element handle |
tag | tag that represents dense data of fixed size on given handle |
Definition at line 1643 of file inmost_mesh.h.
|
inline |
Returns a reference in dense array to the first element of variable size array of element remote handles. Future recomendation: If array was not allocated then this function will generate segmentation fault.
If you don't know any hint information about tag data you should not use this function.
Asserts will fire in debug mode if assumption that data is dense and variable is incorrect, no checks performed in release mode (NDEBUG is set).
Using handle you can construct objects of type Storage, Element, Node, Edge, Face, Cell, ElementSet by calling their constructor with pointer to mesh and handle as arguments.
h | element handle |
tag | tag that represents data |
Definition at line 1809 of file inmost_mesh.h.
void INMOST::Mesh::RemoveGeometricData | ( | GeomParam | table | ) |
void INMOST::Mesh::RemoveGhost | ( | ) |
Delete all the ghost cells.
void INMOST::Mesh::RemoveGhostElements | ( | const HandleType * | ghost, |
enumerator | num | ||
) |
Delete some ghost cells provided in array. Non-ghost elements will also be deleted.
This algorithm will properly communicate between processors so that parallel states of deleted elements properly updated on remote processors. Internally function invokes Destroy function, not Delete, which hides elements during modification state, currently it is not expected that any parallel algorithms will be performed between BeginModification and EndModification since modification may break parallel state though it is never checked whether the mesh is in the modification state, so you are free to experiment. This behavior may change in future.
Collective point-2-point.
ghost | array of handles |
num | number of handles |
|
inline |
Definition at line 2380 of file inmost_mesh.h.
|
inline |
Definition at line 2381 of file inmost_mesh.h.
void INMOST::Mesh::RemPrivateMarker | ( | HandleType | h, |
MarkerType | n | ||
) |
|
inline |
void INMOST::Mesh::RemTopologyCheck | ( | TopologyCheck | mask | ) |
Remove topology checks.
void INMOST::Mesh::ReorderApply | ( | Tag | index, |
ElementType | mask | ||
) |
void INMOST::Mesh::ReorderEmpty | ( | ElementType | reordertypes | ) |
void INMOST::Mesh::ResolveModification | ( | ) |
This function is not yet implemented. It should correctly resolve parallel state of newly created elements, provide them valid global identificators, resolve owners of the elements potentially optimized using information from BridgeTag and LayersTag May use ResolveShared function as basis but instead the whole mesh run the same algorithm for subset.
void INMOST::Mesh::ResolveShared | ( | ) |
void INMOST::Mesh::RestoreCellNodes | ( | HandleType | hc, |
ElementArray< Node > & | ret | ||
) |
void INMOST::Mesh::Save | ( | std::string | File | ) |
Acceptable file formats for writing
Remeber: .pmf stores all references to elements. If reference are broken due to mesh modification, saving or loading such a mesh may lead to seagfault. To automatically maintain correct references modify mesh using BeginModification, ApplyModification, EndModification
File | path to the file |
void INMOST::Mesh::SaveGMV | ( | std::string | File | ) |
void INMOST::Mesh::SavePMF | ( | std::string | File | ) |
void INMOST::Mesh::SavePVTK | ( | std::string | File | ) |
void INMOST::Mesh::SaveVTK | ( | std::string | File | ) |
void INMOST::Mesh::SaveXML | ( | std::string | File | ) |
Definition at line 1327 of file inmost_mesh.h.
void INMOST::Mesh::SetCommunicator | ( | INMOST_MPI_Comm | _comm | ) |
Set MPI communicator.
Definition at line 1334 of file inmost_mesh.h.
void INMOST::Mesh::SetData | ( | HandleType | h, |
const Tag & | tag, | ||
enumerator | shift, | ||
enumerator | size, | ||
const void * | data | ||
) |
Copy into inner data array of size elements from provided array begining from shift element.
h | handle of element |
tag | tag that represents data |
shift | for which element to start to copy |
size | how many elements to copy |
data | user-provided array where data should be copied |
void INMOST::Mesh::SetDataSize | ( | HandleType | h, |
const Tag & | tag, | ||
enumerator | new_size | ||
) |
Sets the size of the array for data of variable size. If you try to change size of data of constant size then if size is different from current then in debug mode (NDEBUG not set) assertion will fail, in release mode nothing happens.
h | handle of element |
tag | tag that represents the data |
new_size | new size of the array |
void INMOST::Mesh::SetDimensions | ( | integer | dim | ) |
Set number of dimensions for mesh. It sets the size for number of internally stored coordinates. Size of the array returned by Node::Coords will match this number. When you change number of dimensions and there are nodes with bigger number of dimensions then first dim coordinates are copied and the rest are dropped.
Set tolerance for coordinates comparison. This tolerance is used in comparators when two meshes are merged during loading, in ResolveShared to check that nodes on different processors match and in UnpackElementsData
e | small real value |
Definition at line 1304 of file inmost_mesh.h.
void INMOST::Mesh::SetFileOption | ( | std::string | , |
std::string | |||
) |
Set file option. Current availible file options:
|
inline |
|
inline |
Set a marker on the element represented by handle.
h | element handle |
n | stores byte number and byte bit mask that represent marker |
Definition at line 1899 of file inmost_mesh.h.
|
inline |
Set a marker on the set of handles.
h | set of handles |
n | number of handles |
m | stores byte number and byte bit mask that represent marker |
Definition at line 1906 of file inmost_mesh.h.
void INMOST::Mesh::SetMarkerSpace | ( | HandleType | h, |
bulk | source[MarkerFields] | ||
) |
Overwrite the bytes that store markers on the element.
h | element handle |
source | storage to get data from |
void INMOST::Mesh::SetMeshName | ( | std::string | new_name | ) |
Be careful changing mesh name if you have already established remote links.
Definition at line 1333 of file inmost_mesh.h.
|
inline |
This strategy correspond only to internal ".pmf" mesh format. There are two availible strategies for ".pmf" files loading and saving:
strategy = 0
This strategy requires one processor to hold all the data, which is quite bad for large files. New strategy may be created from this one in future when each processors consequently obtain access to the file using std::fstream and writes the data.
strategy = 1
on load it will perform
Availible only when USE_MPI_P2P is set because it rely on MPI-2 api that begins with MPI_File_xxx some MPI-1 standards contain this api as extension.
The strategy 1 appeared to be considerably slower on INM cluster then strategy 0, this may happen due to lack of read-write devices that able to work in parallel. On IBM Bluegene/p strategy 1 was not working due to same old problem with shared file pointers in their MPI realization
Definition at line 2345 of file inmost_mesh.h.
|
inline |
Set parallel strategy for inner communications. There are three possible scenaries in parallel communication associated in accordance to enum Prepare structre:
Currently with UnknownSize it will run following algorithm none for strategy 0, following for strategies 1 and 2:
With UnknownSource there are two options depending from the USE_MPI_P2P define. If USE_MPI_P2P is defined then MPI-2 api operations will be used
if USE_MPI_P2P not set then MPI-1 api will be used
Initially it was intended to mainly use MPI-2 functionality for both scenarios but it was realized that there is no availible hardware on which MPI-2 functionalty performs match better then MPI-1 counterparts, especially in the case of UnknownSize. Probably this happens due to lack of support of RDMA operations. If you believe it will be better to use MPI-2 in both cases you are free to uncomment definition of PREFFER_MPI_P2P in inmost_common.h then MPI-2 will be used in both scenaries. These algorthms above are implemented in Mesh::ExchangeBufferInner.
After first problem was resolved following strategies are availible for main communication: strategy = 0
This strategy shows to be the fastest on mac with intel core 2 duo it appears to be independend on apriori knowledge of sizes of incoming messages and skips the step of determining sizes in all the cases but still it requires establishing knowledge of communicating processors Asynchronous sending and receiving may be performed by breaking the steps 1) and 2-5) but should be considered bad since it will be performed without appropriate receive buffers posted for sends, as a result messages will stuck in network pipeline and would be repeatedly rejected resulting in bad networking performance especially if processors have small memory. As a result non-asynchronous communication is realized with this stategy breaking steps 1-5) and 6) when you as for asynchronous communication startegy = 1
True asynchronous behavior is reproduced by breaking 1-2) and 3) strategy = 2
For asynchronous communication algorithm is broken into 1-3) and 4) which is fairly asynchronous. The only provisional benefit it may have on machines with small memory since it should bypass any allocation of buffers for sent and received data by MPI and probably not perform any randezvous communication to ensure data allocation. But MPI_Barrier looks like elephant here.
Algorithms above are implemented in Mesh::ExchangeBuffersInner
Definition at line 2301 of file inmost_mesh.h.
void INMOST::Mesh::SetPrivateMarker | ( | HandleType | h, |
MarkerType | n | ||
) |
|
inline |
|
inline |
Set parallel status of the element. If mesh is in Serial state then call will fire asserts in debug mode and segfault in relese mode.
Parallel status controls how exchange of data between elements will be performed, it is expected that number of elements and copies of elements do match between processors. This kind of check is never performed and if you fail to setup statuses correctly, you may end up with data being copied to incorrect elements. If you modify statuses on your own don't forget to call RecomputeParallelStorage, otherwise exchange will be performed by old status guidelines.
h | handle of the element |
s | new status of the element |
Definition at line 2081 of file inmost_mesh.h.
void INMOST::Mesh::SetTopologyCheck | ( | TopologyCheck | mask | ) |
Set topology checks.
|
inline |
This will turn mesh into the state indicating that some topology error occured.
Definition at line 3076 of file inmost_mesh.h.
bool INMOST::Mesh::Show | ( | HandleType | h | ) |
Show element from mesh.
h | handle of the element |
void INMOST::Mesh::SortByGlobalID | ( | HandleType * | h, |
enumerator | num | ||
) |
void INMOST::Mesh::SortHandles | ( | HandleType * | h, |
enumerator | num | ||
) |
void INMOST::Mesh::SwapModification | ( | ) |
ElementType INMOST::Mesh::SynchronizeElementType | ( | ElementType | etype | ) |
Synchronize bitwise mask of element types between processors.
Collective operation
etype | bitwise type mask |
void INMOST::Mesh::SynchronizeMarker | ( | MarkerType | marker, |
ElementType | mask, | ||
SyncBitOp | op | ||
) |
Syncronize marker on elements between processors using provided operation. Depending on requested operation following action is performed:
marker | marker to be synchronized |
mask | bitwise or type mask |
op | operation, one of SYNC_BIT_SET, SYNC_BIT_OR, SYNC_BIT_XOR, SYNC_BIT_AND |
bool INMOST::Mesh::TestClosure | ( | const HandleType * | elements, |
integer | num | ||
) | const |
|
inline |
This will return tag by which you can retrieve error mark to any element on which topogy check failed. As this is sparse tag you can check presence of error by Element::HaveData or Mesh::HaveData check. This tag will be valid only if you pass MARK_ON_ERROR to Mesh::GetTopologyCheck and will be deleted if you pass MARK_ON_ERROR to Mesh::RemTopologyCheck
Definition at line 3068 of file inmost_mesh.h.
integer INMOST::Mesh::TotalNumberOf | ( | ElementType | mask | ) |
Sum of all physical elements, it excludes ghosted copies. To compute total number including ghosted copies run Integrate(NumberOf(mask))
Collective operation.
mask | bitwise mask of element types, example: NODE | CELL |
var& INMOST::Mesh::Variable | ( | HandleType | h, |
const Tag & | tag | ||
) |
var_array INMOST::Mesh::VariableArray | ( | HandleType | h, |
const Tag & | tag | ||
) |
|
inline |
Definition at line 1893 of file inmost_mesh.h.
|
inline |
|
inline |
|
inline |