an efficient C++ finite element environment
|
|
Go to the documentation of this file. 1 #ifndef _RHEOLEF_HACK_ARRAY_H
2 #define _RHEOLEF_HACK_ARRAY_H
33 #include "rheolef/disarray.h"
40 template <
class T,
class Ref,
class Ptr,
class Raw,
class RawIterator>
50 typedef typename std::iterator_traits<RawIterator>::difference_type
difference_type;
77 template <
class T,
class A>
90 typedef typename generic_value_type::raw_type
raw_type;
119 const T* q = (
const T*)
p;
136 template <
class GetFunction> idiststream&
get_values (idiststream& ips, GetFunction get_element);
155 #ifdef _RHEOLEF_HAVE_MPI
156 template <
class T,
class A>
221 template<
class Set,
class Map>
224 template<
class Set,
class Map>
248 void permutation_apply (
252 void reverse_permutation (
263 template <
class GetFunction> idiststream&
get_values (idiststream& ips, GetFunction get_element);
266 template <
class PutFunction,
class Permutation>
269 const Permutation& perm,
270 PutFunction put_element)
const;
282 std::list<std::pair<size_type,mpi::request> >
waits;
283 std::vector<std::pair<size_type,raw_type> >
data;
296 #endif // _RHEOLEF_HAVE_MPI
345 template <
class T,
class M = rheo_default_memory_model,
class A = std::allocator<T> >
350 typedef typename std::vector<T,A>::iterator
iterator;
354 template <
class T,
class A>
387 const communicator&
comm()
const {
return ownership().
comm(); }
408 template<
class SetOp>
410 template<
class SetOp>
412 template<
class SetOp>
418 template<
class RepSize>
420 const RepSize& partition,
422 RepSize& old_numbering,
423 RepSize& new_numbering)
const
424 {
return base::data().repartition (partition, new_array, old_numbering, new_numbering); }
426 template<
class RepSize>
427 void permutation_apply (
428 const RepSize& new_numbering,
429 hack_array<T,sequential,A>& new_array)
const
430 {
return base::data().permutation_apply (new_numbering, new_array); }
436 idiststream&
get_values (idiststream& ips) {
return base::data().get_values(ips); }
437 template <
class GetFunction>
438 idiststream&
get_values (idiststream& ips, GetFunction get_element) {
return base::data().get_values(ips, get_element); }
439 template <
class PutFunction>
442 void dump (std::string
name)
const {
return base::data().dump(
name); }
446 template <
class T,
class A>
453 template <
class T,
class A>
459 :
base(new_macro(
rep(loc_size,param,alloc)))
462 template <
class T,
class A>
468 :
base(new_macro(
rep(ownership,param,alloc)))
471 template <
class T,
class A>
478 base::data().resize (loc_size,param);
480 template <
class T,
class A>
487 base::data().resize (ownership,param);
490 #ifdef _RHEOLEF_HAVE_MPI
492 template <
class T,
class A>
524 const communicator&
comm()
const {
return base::data().comm(); }
536 template<
class Set,
class Map>
537 void append_dis_entry (
const Set& ext_idx_set, Map& ext_idx_map)
const { base::data().append_dis_entry (ext_idx_set, ext_idx_map); }
539 template<
class Set,
class Map>
540 void get_dis_entry (
const Set& ext_idx_set, Map& ext_idx_map)
const { base::data().get_dis_entry (ext_idx_set, ext_idx_map); }
543 void append_dis_indexes (
const Set& ext_idx_set)
const { base::data().append_dis_indexes (ext_idx_set); }
546 void set_dis_indexes (
const Set& ext_idx_set) { base::data().set_dis_indexes (ext_idx_set); }
561 template<
class SetOp>
563 template<
class SetOp>
565 template<
class SetOp>
570 template<
class RepSize>
572 const RepSize& partition,
574 RepSize& old_numbering,
575 RepSize& new_numbering)
const
576 {
return base::data().repartition (partition.data(), new_array.data(), old_numbering.data(), new_numbering.data()); }
579 template<
class RepSize>
580 void permutation_apply (
581 const RepSize& new_numbering,
583 { base::data().permutation_apply (new_numbering.data(), new_array.data()); }
585 void reverse_permutation (
586 hack_array<size_type,distributed,A>& inew2dis_iold)
const
587 { base::data().reverse_permutation (inew2dis_iold.data()); }
593 idiststream&
get_values (idiststream& ips) {
return base::data().get_values(ips); }
595 void dump (std::string
name)
const {
return base::data().dump(
name); }
598 template <
class GetFunction>
599 idiststream&
get_values (idiststream& ips, GetFunction get_element)
600 {
return base::data().get_values(ips, get_element); }
601 template <
class PutFunction>
603 {
return base::data().put_values(ops, put_element); }
605 template <
class PutFunction,
class Permutation>
608 const Permutation& perm,
609 PutFunction put_element)
const
610 {
return base::data().permuted_put_values (ops, perm.data(), put_element); }
613 template <
class T,
class A>
620 template <
class T,
class A>
626 :
base(new_macro(
rep(ownership,param,alloc)))
629 template <
class T,
class A>
636 base::data().resize (ownership,param);
638 #endif // _RHEOLEF_HAVE_MPI
643 template <
class T,
class A>
650 template <
class T,
class A>
657 #ifdef _RHEOLEF_HAVE_MPI
658 template <
class T,
class A>
665 template <
class T,
class A>
672 #endif // _RHEOLEF_HAVE_MPI
679 #include "rheolef/hack_array_seq.icc"
680 #include "rheolef/hack_array_mpi.icc"
682 #endif // _RHEOLEF_HACK_ARRAY_H
const communicator & comm() const
std::vector< T, A >::iterator iterator
const_reference dis_at(size_type dis_i) const
_self & operator-=(size_type n)
void repartition(const disarray_rep< size_type, distributed, A2 > &partition, hack_array_mpi_rep< T, A > &new_array, disarray_rep< size_type, distributed, A2 > &old_numbering, disarray_rep< size_type, distributed, A2 > &new_numbering) const
rep::const_reference const_reference
base::size_type size_type
const_reference dis_at(size_type dis_i) const
dis_reference dis_entry(size_type dis_i)
hack_array_seq_rep< T, A > rep
const distributor & ownership() const
void append_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
get values from ext_idx_set, that are managed by another proc new version: instead of sending automat...
void dis_entry_assembly()
_self operator+(size_type n) const
const communicator_type & comm() const
rep::const_iterator const_iterator
rep::dis_reference dis_reference
hack_array_iterator< generic_value_type, generic_value_type &, generic_value_type *, raw_type, raw_type * > iterator
void dis_entry_assembly()
void update_dis_entries() const
parameter_type _parameter
const_iterator end() const
void append_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
const_iterator begin() const
size_type dis_size() const
void resize(const distributor &ownership, const parameter_type ¶m)
std::vector< T, A >::const_iterator const_iterator
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format format format format format format dump
dis_reference(hack_array_mpi_rep< T, A > &x, size_type dis_i)
rep::const_reference const_reference
see the distributor page for the full documentation
std::map< size_type, automatic_value_type > scatter_map_type
odiststream & put_values(odiststream &ops) const
const generic_value_type & operator[](size_type ie) const
generic_value_type::raw_type raw_type
const communicator & comm() const
void update_dis_entries() const
hack_array_iterator< T, T &, T *, Raw, Raw * > _iterator
T::parameter_type parameter_type
odiststream & put_values(odiststream &ops) const
idiststream & get_values(idiststream &ips)
rep::parameter_type parameter_type
void repartition(const RepSize &partition, hack_array< T, distributed > &new_array, RepSize &old_numbering, RepSize &new_numbering) const
std::iterator_traits< RawIterator >::difference_type difference_type
hack_array_iterator(const _iterator &y)
idiststream & get_values(idiststream &ips, GetFunction get_element)
rep::value_type value_type
odiststream & put_values(odiststream &ops) const
odiststream & permuted_put_values(odiststream &ops, const Permutation &perm, PutFunction put_element) const
base::value_type value_type
dis_reference & operator=(const generic_value_type &value)
hack_array_mpi_rep(const A &alloc=A())
const_reference dis_at(size_type dis_i) const
see the smart_pointer page for the full documentation
odiststream & put_values(odiststream &ops, PutFunction put_element) const
base::automatic_value_type automatic_value_type
idiststream & get_values(idiststream &ips, GetFunction get_element)
odiststream & put_values(odiststream &ops) const
void resize(const distributor &ownership, const parameter_type ¶m)
void set_dis_indexes(const Set &ext_idx_set)
_self & operator+=(size_type n)
void dis_entry_assembly_end(SetOp my_set_op)
void set_dis_indexes(const Set &ext_idx_set)
base::parameter_type parameter_type
size_type dis_size() const
const_iterator end() const
base::generic_value_type generic_value_type
base::size_type size_type
base::const_iterator const_iterator
const communicator & comm() const
std::bidirectional_iterator_tag iterator_category
pointer operator->() const
_self operator-(size_type n) const
smart_pointer< rep > base
std::list< std::pair< size_type, mpi::request > > waits
rep::const_iterator const_iterator
hack_array_seq_rep(const A &alloc=A())
const distributor & ownership() const
disarray_rep< typename T::raw_type, sequential, A > base
void dis_entry_assembly(SetOp my_set_op)
odiststream & permuted_put_values(odiststream &ops, const Permutation &perm, PutFunction put_element) const
void append_dis_indexes(const Set &ext_idx_set) const
void dis_entry_assembly_begin(SetOp my_set_op)
odiststream & put_values(odiststream &ops, PutFunction put_element) const
std::istream & operator>>(std::istream &is, const catchmark &m)
void dis_entry_assembly_begin(SetOp my_set_op)
This file is part of Rheolef.
size_type dis_size() const
global and local sizes
const_iterator begin() const
hack_array_mpi_rep< T, A > & _x
idiststream & get_values(idiststream &ips)
const_iterator begin() const
bool operator!=(const _self &y) const
dis_reference dis_entry(size_type dis_i)
std::vector< std::pair< size_type, raw_type > > data
idiststream & get_values(idiststream &ips)
void update_dis_entries() const
odiststream: see the diststream page for the full documentation
const scatter_map_type & get_dis_map_entries() const
size_type dis_size() const
smart_pointer< rep > base
void _init(const distributor &ownership, const parameter_type ¶m)
const distributor & ownership() const
bool operator==(const _self &y) const
rep::scatter_map_type scatter_map_type
base::allocator_type allocator_type
void dis_entry_assembly()
const_iterator end() const
rep::dis_reference dis_reference
dis_reference dis_entry(size_type dis_i)
void get_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
rep::value_type value_type
const_iterator begin() const
void dis_entry_assembly(SetOp my_set_op)
idiststream & get_values(idiststream &ips)
void dis_entry_assembly_end()
void append_dis_indexes(const Set &ext_idx_set) const
size_type _receive_max_size
field::size_type size_type
hack_array_iterator< T, Ref, Ptr, Raw, RawIterator > _self
reference operator*() const
hack_array_iterator< generic_value_type, const generic_value_type &, const generic_value_type *, raw_type, const raw_type * > const_iterator
hack_array_mpi_rep< T, A > rep
const_iterator end() const
const typedef value_type & const_reference
const distributor & ownership() const
base::reference reference
reference operator[](size_type i) const
T::generic_type value_type
std::ostream & operator<<(std::ostream &os, const catchmark &m)
std::vector< T, A >::size_type size_type
std::map< size_type, raw_type > stash_map_type
size_type dis_size() const
base::const_reference const_reference
T::generic_type generic_value_type
void append_dis_indexes(const Set &ext_idx_set) const
const generic_value_type & operator[](size_type ie) const
void get_dis_entry(const Set &ext_idx_set, Map &ext_idx_map) const
hack_array_seq_rep< T, A > base
void dis_entry_assembly_begin()
rep::parameter_type parameter_type
T::automatic_type automatic_value_type
size_type size(size_type iproc) const
void dis_entry_assembly_end(SetOp my_set_op)
void set_dis_entry(size_type dis_i, const generic_value_type &val)
hack_array_iterator(RawIterator raw_iter, size_type incr)
const communicator & comm() const
const scatter_map_type & get_dis_map_entries() const