| FEAT 3
    Finite Element Analysis Toolbox | 
Global base-mesh vector splitter (and joiner) implementation. More...
#include <splitter.hpp>
| Public Types | |
| typedef Global::Vector< LocalVector_, Mirror_ > | GlobalVectorType | 
| our global vector type  More... | |
| typedef LocalVector_ | LocalVectorType | 
| our local vector type  More... | |
| typedef Mirror_ | MirrorType | 
| our mirror type  More... | |
| typedef Global::Muxer< LocalVector_, Mirror_ > | MuxerType | 
| our internal muxer type  More... | |
| Public Member Functions | |
| Splitter () | |
| standard constructor  More... | |
| Splitter (MuxerType &&muxer, LocalVector_ &&base_vector_tmpl) | |
| Splitter (Splitter &&other) | |
| move-constructor  More... | |
| virtual | ~Splitter () | 
| destructor  More... | |
| std::size_t | bytes () const | 
| Returns the internal data size in bytes.  More... | |
| void | compile (const LocalVector_ &vec_tmp_) | 
| Compiles the muxer.  More... | |
| template<typename LVT2_ > | |
| void | convert (const Splitter< LVT2_, Mirror_ > &other, LocalVector_ &&vector, LAFEM::CloneMode mode=LAFEM::CloneMode::Shallow) | 
| Conversion function for different vector container type.  More... | |
| template<typename LVT2_ , typename MT2_ > | |
| void | convert (const Splitter< LVT2_, MT2_ > &other) | 
| Conversion function for same vector container type but with different MDI-Type.  More... | |
| LocalVector_ | create_base_vector () const | 
| Creates a new base-mesh vector.  More... | |
| const LocalVector_ & | get_base_vector_template () const | 
| Returns the base vector template.  More... | |
| const MuxerType & | get_muxer () const | 
| Returns the internal muxer.  More... | |
| bool | is_root () const | 
| Checks whether this is the root process.  More... | |
| bool | is_single () const | 
| Checks whether there is only one process in the communicator.  More... | |
| LocalVector_ | join (const Global::Vector< LocalVector_, Mirror_ > &vector) const | 
| Joins a global vector into a base-mesh local vector on the root process.  More... | |
| void | join (LocalVector_ &vec_base, const Global::Vector< LocalVector_, Mirror_ > &vector) const | 
| Joins a global vector into a base-mesh local vector on the root process.  More... | |
| void | join_write_out (const Global::Vector< LocalVector_, Mirror_ > &vector, const String &filename, LAFEM::FileMode mode=LAFEM::FileMode::fm_binary) const | 
| Joins a global vector into a base-mesh local vector and writes it to a file.  More... | |
| Splitter & | operator= (Splitter &&other) | 
| move-assign operator  More... | |
| void | push_patch (Mirror_ &&patch_mirror) | 
| Adds a child rank and mirror for the parent process.  More... | |
| void | set_base_vector_template (LocalVector_ &&vector_template) | 
| Sets the base-vector template on the root process.  More... | |
| void | set_root (const Dist::Comm *comm, int root_rank, Mirror_ &&root_mirror) | 
| Sets the root communicator.  More... | |
| void | split (Global::Vector< LocalVector_, Mirror_ > &vector, const LocalVector_ &vec_base) const | 
| Splits a base-mesh local vector on the root process into a global vector.  More... | |
| void | split (LocalVector_ &vector, const LocalVector_ &vec_base) const | 
| Splits a base-mesh local vector on the root process into a patch-local vector.  More... | |
| void | split_read_from (Global::Vector< LocalVector_, Mirror_ > &vector, const String &filename, LAFEM::FileMode mode=LAFEM::FileMode::fm_binary) const | 
| Reads in a base-mesh local vector and splits it into a global vector.  More... | |
| void | split_read_from (LocalVector_ &vector, const String &filename, LAFEM::FileMode mode=LAFEM::FileMode::fm_binary) const | 
| Reads in a base-mesh local vector and splits it into a patch-local vector.  More... | |
| Public Attributes | |
| LocalVector_ | _base_vector_tmpl | 
| our base-mesh vector template; only required for join() but not for split()  More... | |
| MuxerType | _muxer | 
| our internal muxer  More... | |
Global base-mesh vector splitter (and joiner) implementation.
This class provides the functionality for the transfer of primal vectors between a partitioned mesh and its underlying unpartitioned base-mesh on the same refinement level. Technically, this class is merely a special case of the more general Muxer class, however, this class additionally offers some direct file I/O methods. The purpose of this class is to enable the user to write a solution vector, that has been computed on a partitioned mesh in an MPI-parallel simulation, into a single output file on the corresponding unpartitioned mesh by using the join_write_out() function, which can then be read in by another possibly sequential application by the means of the standard LAFEM read_from methods. Furthermore, this class also offers the vice-versa functionality, i.e. it is possible to read in a vector on the unpartitioned mesh that has been written out by the standard LAFEM write_out methods and split it into the local vectors on the corresponding partitioned mesh in an MPI-parallel application by using the split_read_from() function. Of course, as a direct consequence, it is also possible to write a partitioned vector generated on N MPI processes and then read it in by an application running on a different number of MPI processes.
| LocalVector_ | The local vector type that the splitter is to be applied onto. | 
| Mirror_ | The mirror type that is to be used. | 
To set up an object of this class, the following steps have to be performed:
Definition at line 58 of file splitter.hpp.
| typedef Global::Vector<LocalVector_, Mirror_> FEAT::Global::Splitter< LocalVector_, Mirror_ >::GlobalVectorType | 
our global vector type
Definition at line 71 of file splitter.hpp.
| typedef LocalVector_ FEAT::Global::Splitter< LocalVector_, Mirror_ >::LocalVectorType | 
our local vector type
Definition at line 65 of file splitter.hpp.
| typedef Mirror_ FEAT::Global::Splitter< LocalVector_, Mirror_ >::MirrorType | 
our mirror type
Definition at line 68 of file splitter.hpp.
| typedef Global::Muxer<LocalVector_, Mirror_> FEAT::Global::Splitter< LocalVector_, Mirror_ >::MuxerType | 
our internal muxer type
Definition at line 62 of file splitter.hpp.
| 
 | inline | 
standard constructor
Definition at line 81 of file splitter.hpp.
| 
 | inline | 
move-constructor
Definition at line 88 of file splitter.hpp.
| 
 | inlineexplicit | 
Definition at line 94 of file splitter.hpp.
| 
 | inlinevirtual | 
destructor
Definition at line 101 of file splitter.hpp.
| 
 | inline | 
Returns the internal data size in bytes.
Definition at line 163 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_base_vector_tmpl, FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer, and FEAT::Global::Muxer< LocalVector_, Mirror_ >::bytes().
Referenced by FEAT::Control::ScalarBasicSystemLevel< DataType_, IndexType_, ScalarMatrix_, TransferMatrix_ >::bytes().
| 
 | inline | 
Compiles the muxer.
| [in] | vec_tmp_ | A transient reference to a temporary vector for internal use. | 
Definition at line 253 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer, and FEAT::Global::Muxer< LocalVector_, Mirror_ >::compile().
| 
 | inline | 
Conversion function for different vector container type.
This function (re)creates this splitter from another gate with a different vector type, but the same mirrors. This can be used to create a splitter using DenseVectorBlocked from a splitter using DenseVector or vice versa.
| [in] | other | A (transient) reference to the splitter using the other vector type to create this splitter from. | 
| [in] | vector | A temporary vector allocated to the correct size that is to be used for internal initialization. | 
| [in] | mode | The clone-mode to be used for cloning the mirrors. Defaults to shallow clone. | 
Definition at line 153 of file splitter.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::convert().
| 
 | inline | 
Conversion function for same vector container type but with different MDI-Type.
| [in] | other | A transient reference to the splitter to convert from | 
Definition at line 124 of file splitter.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::convert().
| 
 | inline | 
Creates a new base-mesh vector.
Definition at line 264 of file splitter.hpp.
References FEAT::LAFEM::Layout, and XASSERT.
| 
 | inline | 
Returns the base vector template.
Definition at line 236 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_base_vector_tmpl.
| 
 | inline | 
Returns the internal muxer.
Definition at line 242 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer.
| 
 | inline | 
Checks whether this is the root process.
The root process is the process that receives the joined local vector and which is responsible for writing out and reading in the files.
true, if this is the root process, otherwise false. Definition at line 176 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer, FEAT::Global::Muxer< LocalVector_, Mirror_ >::get_sibling_comm(), and FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_parent().
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::join_write_out(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split_read_from().
| 
 | inline | 
Checks whether there is only one process in the communicator.
true, if there is only one process, otherwise false. Definition at line 186 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer, FEAT::Global::Muxer< LocalVector_, Mirror_ >::get_sibling_comm(), and FEAT::Dist::Comm::size().
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split().
| 
 | inline | 
Joins a global vector into a base-mesh local vector on the root process.
| [in] | vector | A transient reference to the global vector that is to be joined. | 
Definition at line 283 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_base_vector_tmpl, FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_root(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_single(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::LAFEM::Layout, FEAT::Global::Vector< LocalVector_, Mirror_ >::local(), and XASSERTM.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::join_write_out().
| 
 | inline | 
Joins a global vector into a base-mesh local vector on the root process.
| [in,out] | vec_base | A transient reference to a base-mesh local vector that receives the joined global vector. Must be allocated to correct size(s), but its numerical contents are ignored. | 
| [in] | vector | A transient reference to the type-1 global vector that is to be joined. | 
Definition at line 320 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer, FEAT::Global::Vector< LocalVector_, Mirror_ >::clone(), FEAT::LAFEM::Deep, FEAT::Global::Vector< LocalVector_, Mirror_ >::from_1_to_0(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_child(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_parent(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_single(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::join_send(), FEAT::Global::Vector< LocalVector_, Mirror_ >::local(), and XASSERT.
| 
 | inline | 
Joins a global vector into a base-mesh local vector and writes it to a file.
| [in] | vector | A transient reference to the type-1 global vector that is to be joined. | 
| [in] | filename | The filename of the output file that is to be written. | 
| [in] | mode | The LAFEM::FileMode of the output file, defaults to binary format. | 
Definition at line 416 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_root(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::join().
| 
 | inline | 
move-assign operator
Definition at line 106 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_base_vector_tmpl, and FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer.
| 
 | inline | 
Adds a child rank and mirror for the parent process.
| [in] | patch_mirror | The mirror of the patch of this process. | 
Definition at line 214 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer, and FEAT::Global::Muxer< LocalVector_, Mirror_ >::push_child().
| 
 | inline | 
Sets the base-vector template on the root process.
| [in] | vector_template | A base-mesh vector that is allocated to correct size(s) and which is used as a template for the creation of temporary base-mesh vectors. Its numerical contents are ignored. | 
Definition at line 230 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_base_vector_tmpl.
| 
 | inline | 
Sets the root communicator.
| [in] | comm | The communicator. | 
| [in] | root_rank | The rank of the root process in the comm. | 
| [in] | root_mirror | The root mirror. | 
Definition at line 203 of file splitter.hpp.
References FEAT::Global::Muxer< LocalVector_, Mirror_ >::set_parent().
| 
 | inline | 
Splits a base-mesh local vector on the root process into a global vector.
| [in,out] | vector | A transient reference to the type-1 global vector that receives the split base-mesh vector. Must be allocated to correct size(s), but its numerical contents are ignored. | 
| [in] | vec_base | A transient reference to a base-mesh local vector that is to be split. | 
Definition at line 362 of file splitter.hpp.
References FEAT::Global::Vector< LocalVector_, Mirror_ >::local(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split().
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::split(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split_read_from().
| 
 | inline | 
Splits a base-mesh local vector on the root process into a patch-local vector.
| [in,out] | vector | A transient reference to the type-1 patch-local vector that receives the split base-mesh vector. Must be allocated to correct size(s), but its numerical contents are ignored. | 
| [in] | vec_base | A transient reference to a base-mesh local vector that is to be split. | 
Definition at line 378 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer, FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_child(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::is_parent(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_single(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split(), FEAT::Global::Muxer< LocalVector_, Mirror_ >::split_recv(), and XASSERT.
| 
 | inline | 
Reads in a base-mesh local vector and splits it into a global vector.
| [in,out] | vector | A transient reference to the type-1 global vector that is to be joined. Must be allocated to correct size(s), but its numerical contents are ignored. | 
| [in] | filename | The filename of the input file that is to be read in. | 
| [in] | mode | The LAFEM::FileMode of the input file, defaults to binary format. | 
Definition at line 442 of file splitter.hpp.
References FEAT::Global::Vector< LocalVector_, Mirror_ >::local(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split_read_from().
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::split_read_from().
| 
 | inline | 
Reads in a base-mesh local vector and splits it into a patch-local vector.
| [in,out] | vector | A transient reference to the type-1 patch-local vector that receives the split base-mesh vector. Must be allocated to correct size(s), but its numerical contents are ignored. | 
| [in] | filename | The filename of the input file that is to be read in. | 
| [in] | mode | The LAFEM::FileMode of the input file, defaults to binary format. | 
Definition at line 461 of file splitter.hpp.
References FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_root(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split().
| LocalVector_ FEAT::Global::Splitter< LocalVector_, Mirror_ >::_base_vector_tmpl | 
our base-mesh vector template; only required for join() but not for split()
Definition at line 77 of file splitter.hpp.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::bytes(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::get_base_vector_template(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::operator=(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::set_base_vector_template().
| MuxerType FEAT::Global::Splitter< LocalVector_, Mirror_ >::_muxer | 
our internal muxer
Definition at line 75 of file splitter.hpp.
Referenced by FEAT::Global::Splitter< LocalVector_, Mirror_ >::bytes(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::compile(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::get_muxer(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_root(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::is_single(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::join(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::operator=(), FEAT::Global::Splitter< LocalVector_, Mirror_ >::push_patch(), and FEAT::Global::Splitter< LocalVector_, Mirror_ >::split().