25#include "rheolef/geo.h"
36template<
class T,
class M>
53#ifdef _RHEOLEF_HAVE_MPI
66 const map_t& map_vertex =
vertex.get_dis_map_entries();
67 size_type dis_nv = omega.dis_size (0);
68 for (
typename map_t::const_iterator
69 iter = map_vertex.begin(),
70 last = map_vertex.end(); iter != last; ++iter) {
71 size_type dis_iv = (*iter).first;
72 check_macro (dis_iv < dis_nv,
"dis_iv="<<dis_iv<<
" out of range [0:"<<dis_nv<<
"[");
75 ball.set_dis_indexes (ext_iv_set);
81template<
class T,
class M>
87 if (map_dim <= 0)
return;
93 S.
set_master (0, std::numeric_limits<size_type>::max());
94 S.
set_master (1, std::numeric_limits<size_type>::max());
98 std::array<index_set, reference_element::max_variant> ext_isv_set;
102 for (
size_type loc_is = 0, loc_ns = K.
n_subgeo(sid_dim); loc_is < loc_ns; ++loc_is) {
103 size_type dis_is = (map_dim == 1) ? K[loc_is] : ((map_dim == 2) ? K.
edge(loc_is) : K.
face(loc_is));
104 if (is_ownership.
is_owned (dis_is))
continue;
108 ext_isv_set [
variant] += dis_isv;
109 ext_is_set += dis_is;
128 for (
size_type loc_inod = 0, loc_nnod = K.
size(); loc_inod < loc_nnod; loc_inod++) {
131 ball.dis_entry (dis_iv) += dis_ie_set;
134 ball.dis_entry_assembly();
141 std::array<index_set, reference_element::max_variant> ext_igev_set;
145 side_marked.set_dis_indexes (ext_is_set);
148 for (
size_type loc_is = 0, loc_ns = K.
n_subgeo(sid_dim); loc_is < loc_ns; ++loc_is) {
149 size_type dis_is = (sid_dim == 0) ? K[loc_is] : ((sid_dim == 1) ? K.
edge(loc_is) : K.
face(loc_is));
150 if (side_marked.dis_at (dis_is))
continue;
151 side_marked.dis_entry (dis_is) = 1;
154 index_set ball_intersect = ball.dis_at (dis_iv0);
155 for (
size_type loc_iv = 1, loc_nv = S.
size(); loc_iv < loc_nv; loc_iv++) {
159 switch (ball_intersect.size()) {
161 index_set::const_iterator iter = ball_intersect.begin();
164 S.
set_master (1, std::numeric_limits<size_type>::max());
168 index_set::const_iterator iter = ball_intersect.begin();
173 if (! ie_ownership.
is_owned (dis_ie1)) std::swap (dis_ie1, dis_ie2);
174 if (! ie_ownership.
is_owned (dis_ie2)) {
177 size_type dis_igev2 =
_gs.dis_ige2dis_igev_by_dimension (map_dim, dis_ie2, variant2);
178 ext_igev_set [variant2] += dis_igev2;
179 ext_ie_set += dis_ie2;
187 if (orient < 0) std::swap (dis_ie1, dis_ie2);
193 error_macro (
"neighbour: side #"<< ball_intersect.size()<<
" connectivity problem");
213 for (index_set::const_iterator iter = ext_ie_set.begin(), last = ext_ie_set.end(); iter != last; ++iter) {
216 for (
size_type loc_inod = 0, loc_nnod = K.
n_node(); loc_inod < loc_nnod; loc_inod++) {
223 _node.append_dis_indexes (ext_inod_set);
232template<
class T,
class M>
239 check_macro (ie1 <
size(map_dim),
"neighbour: element index ie=" << ie1
240 <<
" is out of range [0:" <<
size(map_dim) <<
"[");
244 case 3: dis_isid = K1.
face (loc_isid);
break;
245 case 2: dis_isid = K1.
edge (loc_isid);
break;
253 default:
return std::numeric_limits<size_type>::max();
260 size_type first_dis_ie =
_gs.ownership_by_dimension[map_dim].first_index();
262 if (dis_ie2 != dis_ie1)
return dis_ie2;
268#define _RHEOLEF_instanciation(T,M) \
269template void geo_base_rep<T,M>::init_neighbour() const; \
270template geo_base_rep<T,M>::size_type \
271 geo_base_rep<T,M>::neighbour (size_type, size_type) const;
274#ifdef _RHEOLEF_HAVE_MPI
#define _RHEOLEF_instanciation(T, M, A)
see the Float page for the full documentation
see the disarray page for the full documentation
see the distributor page for the full documentation
size_type first_index(size_type iproc) const
global index range and local size owned by ip-th process
bool is_owned(size_type dis_i, size_type iproc) const
true when dis_i in [first_index(iproc):last_index(iproc)[
base class for M=sequential or distributed meshes representations
friend void add_ball_externals(const geo_base_rep< U, M > &, const disarray< index_set, M > &)
void dis_inod(const geo_element &K, std::vector< size_type > &dis_inod) const
size_type map_dimension() const
base::size_type size_type
const distributor & vertex_ownership() const
const_reference get_geo_element(size_type dim, size_type ige) const
void init_neighbour() const
size_type neighbour(size_type ie, size_type loc_isid) const
iterator end(size_type dim)
const_reference dis_get_geo_element(size_type dim, size_type dis_ige) const
size_type dis_inod2dis_iv(size_type dis_inod) const
iterator begin(size_type dim)
iterator by dimension: wraps iterator by geo_element variant
base::const_iterator const_iterator
disarray< node_type, M > _node
size_type variant() const
const geo_size & sizes() const
std::array< hack_array< geo_element_hack, M >, reference_element::max_variant > _geo_element
size_type size(size_type dim) const
see the geo_element page for the full documentation
geo_element_indirect::orientation_type orientation_type
size_type edge(size_type i) const
size_type face(size_type i) const
orientation_type get_side_orientation(const geo_element &S) const
size_type master(bool i) const
size_type n_subgeo(size_type subgeo_dim) const
void set_master(bool i, size_type dis_ie) const
void inplace_intersection(const index_set &b)
static variant_type last_variant_by_dimension(size_type dim)
static variant_type first_variant_by_dimension(size_type dim)
#define error_macro(message)
const point vertex[n_vertex]
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.