10#include <kernel/global/gate.hpp> 
   11#include <kernel/global/muxer.hpp> 
   12#include <kernel/global/vector.hpp> 
   57    template<
typename LocalVector_, 
typename Mirror_>
 
  111        _muxer = std::forward<MuxerType>(other._muxer);
 
  123      template<
typename LVT2_, 
typename MT2_>
 
  126        if((
void*)
this == (
void*)&other)
 
  129        this->_muxer.
convert(other._muxer);
 
  130        this->_base_vector_tmpl.convert(other._base_vector_tmpl);
 
  152      template<
typename LVT2_>
 
  155        if((
void*)
this == (
void*)&other)
 
  158        this->_muxer.
convert(other._muxer, std::forward<LocalVector_>(vector), mode);
 
  159        this->_base_vector_tmpl.clear(); 
 
  205        this->_muxer.
set_parent(comm, root_rank, std::forward<Mirror_>(root_mirror));
 
  266        XASSERT(!this->_base_vector_tmpl.empty());
 
  287          return vector.
local().clone();
 
  299        join(vec_base, vector);
 
  325          vec_base.copy(vector.
local());
 
  378      void split(LocalVector_& vector, 
const LocalVector_& vec_base)
 const 
  384          vector.copy(vec_base);
 
  420        LocalVector_ vec_base(
join(vector));
 
  425          vec_base.write_out(mode, filename);
 
  465        LocalVector_ vec_base;
 
  471          vec_base.read_from(mode, filename);
 
  475        split(vector, vec_base);
 
#define XASSERT(expr)
Assertion macro definition.
#define XASSERTM(expr, msg)
Assertion macro definition with custom message.
int size() const
Returns the size of this communicator.
Global multiplexer/demultiplexer implementation.
bool is_child() const
Specifies whether this process represents a child in the muxer.
std::size_t bytes() const
Returns the internal data size in bytes.
void join_send(const LocalVector_ &vec_src) const
Sends a join operation to the parent process.
void compile(const LocalVector_ &vec_tmp_)
Compiles the muxer.
void convert(const Muxer< LVT2_, MT2_ > &other)
Conversion function for same vector container type but with different MDI-Type.
const Dist::Comm * get_sibling_comm() const
Returns the sibling communicator.
bool is_parent() const
Specifies whether this process represents a parent in the muxer.
void split_recv(LocalVector_ &vec_trg) const
Receives a split operation from the parent process.
void join(const LocalVector_ &vec_src, LocalVector_ &vec_trg) const
Performs a join operation on the parent process.
void push_child(Mirror_ &&child_mirror)
Adds a child rank and mirror for a parent process.
void set_parent(const Dist::Comm *sibling_comm_, int parent_rank, Mirror_ &&parent_mirror)
Sets the sibling communicator.
void split(LocalVector_ &vec_trg, const LocalVector_ &vec_src) const
Performs a split operation on the parent process.
Global base-mesh vector splitter (and joiner) implementation.
void set_base_vector_template(LocalVector_ &&vector_template)
Sets the base-vector template on the root process.
virtual ~Splitter()
destructor
Global::Muxer< LocalVector_, Mirror_ > MuxerType
our internal muxer type
LocalVector_ _base_vector_tmpl
our base-mesh vector template; only required for join() but not for split()
LocalVector_ join(const Global::Vector< LocalVector_, Mirror_ > &vector) const
Joins a global vector into a base-mesh local vector on the root process.
MuxerType _muxer
our internal muxer
void set_root(const Dist::Comm *comm, int root_rank, Mirror_ &&root_mirror)
Sets the root communicator.
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.
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.
void compile(const LocalVector_ &vec_tmp_)
Compiles the muxer.
std::size_t bytes() const
Returns the internal data size in bytes.
Splitter & operator=(Splitter &&other)
move-assign operator
Splitter()
standard constructor
void convert(const Splitter< LVT2_, MT2_ > &other)
Conversion function for same vector container type but with different MDI-Type.
void convert(const Splitter< LVT2_, Mirror_ > &other, LocalVector_ &&vector, LAFEM::CloneMode mode=LAFEM::CloneMode::Shallow)
Conversion function for different vector container type.
LocalVector_ LocalVectorType
our local vector type
Splitter(Splitter &&other)
move-constructor
Global::Vector< LocalVector_, Mirror_ > GlobalVectorType
our global vector type
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.
void split(LocalVector_ &vector, const LocalVector_ &vec_base) const
Splits a base-mesh local vector on the root process into a patch-local vector.
Mirror_ MirrorType
our mirror type
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.
void push_patch(Mirror_ &&patch_mirror)
Adds a child rank and mirror for the parent process.
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.
LocalVector_ create_base_vector() const
Creates a new base-mesh vector.
bool is_single() const
Checks whether there is only one process in the communicator.
bool is_root() const
Checks whether this is the root process.
const LocalVector_ & get_base_vector_template() const
Returns the base vector template.
const MuxerType & get_muxer() const
Returns the internal muxer.
Global vector wrapper class template.
void from_1_to_0()
Converts a type-1 vector into a type-0 vector.
Vector clone(LAFEM::CloneMode mode=LAFEM::CloneMode::Weak) const
Creates and returns a clone of this global vector.
LocalVector_ & local()
Returns a reference to the internal local LAFEM vector object.
String class implementation.
LAFEM common type definitions.
std::uint64_t Index
Index data type.