21#include "rheolef/domain_indirect.h"
22#include "rheolef/geo.h"
23#include "rheolef/rheostream.h"
33 const std::string&
name,
36 const std::vector<size_type>& ie_list)
43 for (std::vector<size_type>::const_iterator iter = ie_list.begin(),
45 iter != last; iter++, oige_iter++) {
46 (*oige_iter).set (1, *iter);
60 "union: domains "<<a._name<<
" and " << b._name <<
" have incompatible dimensions");
61 _name = a._name +
"+" + b._name;
64 std::map<size_type,geo_element_indirect> c_map;
66 iter = a.begin(), last = a.end(); iter != last; ++iter) {
71 iter = b.begin(), last = b.end(); iter != last; ++iter) {
78 for (
typename std::map<size_type,geo_element_indirect>::const_iterator
79 iter = c_map.begin(), last = c_map.end(); iter != last; ++iter, ++oige_iter) {
80 *oige_iter = (*iter).second;
89 ops <<
"domain" << endl
101 const std::vector<index_set>& ball,
106 if (S.
size() == 0)
return;
107 contains_S = ball[S[0]];
108 for (size_type i = 1; i < S.
size(); i++) {
120 std::vector<index_set> *ball)
122 std::istream& is = ips.
is();
123 if (!
scatch(is,
"\ndomain")) {
124 is.setstate (std::ios::badbit);
129 check_macro (version <= 2,
"unexpected domain format version="<<version);
136 for (
size_type ioige = 0, noige =
size(); ioige < noige; ioige++) {
139 check_macro (prev_variant <= S.
variant(),
"elements should be sorted by increasing variant order");
145 check_macro (version == 1,
"unexpected domain format version="<<version);
147 <<
base::_map_dim<<
" > geometry dimension = " << omega.dimension());
157 disarray_t d_tmp (n_side, elem_init);
158 d_tmp.get_values (ips);
168 std::vector<index_set>* ball)
174 if (d_tmp.size() == 0)
return;
186 disarray_t::const_iterator q = d_tmp.begin();
190 check_macro (prev_variant <= S.
variant(),
"elements should be sorted by increasing variant order");
194 check_macro (contains_S.size() >= 1,
"domain element not in mesh: S.dis_ie=" << S.
dis_ie());
195 check_macro (contains_S.size() <= 1,
"problem with domain element: S.dis_ie=" << S.
dis_ie());
197 size_type i_side = *(contains_S.begin());
202 "problem with domain element: S.dis_ie=" << S.
dis_ie());
203 (*p).set (orient, i_side, shift);
211 std::vector<index_set>* ball)
215 "build a domain for a geo_domain: not yet");
217 data().build_from_data (omega_data, d_tmp, ball);
227 std::vector<index_set> *ball);
235 std::vector<index_set>* ball);
242 std::vector<index_set>* ball);
244#define _RHEOLEF_instanciation(M) \
245template class domain_indirect_base_rep<M>; \
248#ifdef _RHEOLEF_HAVE_MPI
#define _RHEOLEF_instanciation(T, M, A)
see the communicator page for the full documentation
see the disarray page for the full documentation
rep::base::const_iterator const_iterator
rep::base::iterator iterator
see the distributor page for the full documentation
static const size_type decide
void build_from_list(const std::string &name, size_type map_dim, const communicator &comm, const std::vector< size_type > &ie_list)
void build_union(const domain_indirect_base_rep< M > &a, const domain_indirect_base_rep< M > &b)
geo_element_indirect::size_type size_type
domain_indirect_base_rep()
base::size_type size_type
void build_from_data(const geo_rep< U, sequential > &omega, disarray< geo_element_auto<>, sequential > &d_tmp, std::vector< index_set > *ball)
const_iterator_ioige ioige_begin() const
const_iterator_ioige ioige_end() const
const geo_element_indirect & oige(size_type ioige) const
base::iterator_ioige iterator_ioige
generic mesh with rerefence counting
see the geo_element page for the full documentation
geo_element_indirect::orientation_type orientation_type
bool get_orientation_and_shift(const geo_element &S, orientation_type &orient, shift_type &shift) const
return orientation and shift between *this element and S
reference_element::size_type size_type
variant_type variant() const
geo_element_indirect::shift_type shift_type
sequential mesh representation
idiststream: see the diststream page for the full documentation
void inplace_intersection(const index_set &b)
odiststream: see the diststream page for the full documentation
const domain_indirect_rep< sequential > & data() const
smart_pointer(domain_indirect_rep< sequential > *p=0)
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
bool scatch(std::istream &in, const std::string &ch, bool full_match=true)
scatch: see the rheostream page for the full documentation
void build_set_that_contains_S(const geo_element &S, const std::vector< index_set > &ball, index_set &contains_S)
builds a set of elements that all contain S.