rheolef  6.6
space_constitution.cc
Go to the documentation of this file.
1 
2 #include "rheolef/space.h"
3 #include "rheolef/space_mult.h"
4 #include "rheolef/piola.h"
5 #include <sstream>
6 
7 namespace rheolef {
8 
9 template <class T, class M>
11  const geo_basic<T,M>& omega,
12  std::string approx,
13  std::string valued)
14  : _ownership(),
15  _start_by_component(),
16  _valued_tag(space_constant::scalar),
17  _is_hier(false),
18  _scalar_constit(),
19  _hier_constit()
20 {
21  if (valued == "scalar") {
22  _scalar_constit = scalar_type (omega, approx);
23  } else { // multi-valued:
24  _is_hier = true;
25  size_type d = omega.dimension();
27  size_type n_comp = space_constant::n_component (_valued_tag, d, omega.coordinate_system());
28  _hier_constit.resize(n_comp);
29  space_constitution<T,M> x (omega, approx);
30  for (size_type i_comp = 0; i_comp < n_comp; i_comp++) {
31  _hier_constit [i_comp] = x;
32  }
33  }
34  initialize();
35 }
36 template <class T, class M>
38  : _ownership(),
39  _start_by_component(),
40  _valued_tag(space_constant::mixed),
41  _is_hier(true),
42  _scalar_constit(),
43  _hier_constit(expr.size())
44 {
46  for (typename space_mult_list<T,M>::const_iterator iter = expr.begin(), last = expr.end(); iter != last; ++iter, ++iter_constit) {
47  const space_basic<T,M>& Xi = *iter;
48  *iter_constit = Xi.get_constitution();
49  }
50  initialize();
51 }
52 template <class T, class M>
53 void
55 {
56  _ownership = distributor (internal_dis_ndof(), internal_comm(), internal_ndof());
57  init_start_by_component();
58 }
59 template <class T, class M>
60 bool
62 {
63  if (_is_hier != V2._is_hier) return false;
64  if (!_is_hier) return (_scalar_constit == V2._scalar_constit);
65  if (_hier_constit.size() != V2._hier_constit.size()) return false;
66  for (const_iterator iter1 = _hier_constit.begin(), iter2 = V2._hier_constit.begin(), last1 = _hier_constit.end(); iter1 != last1; ++iter1, ++iter2) {
67  if (! (*iter1).data().operator==((*iter2).data())) { // recursive call
68  return false;
69  }
70  }
71  return true;
72 }
73 template <class T, class M>
76 {
77  if (! is_initialized()) { return communicator(); }
78  return get_geo().comm();
79 }
80 template <class T, class M>
83 {
84  if (!_is_hier) {
85  return _scalar_constit.get_geo().comm();
86  }
87  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
88  const space_constitution<T,M>& constit = *iter;
89  return constit.data().internal_comm(); // recursive call
90  }
91  return communicator();
92 }
93 template <class T, class M>
96 {
97  if (! is_initialized()) { return 0; }
98  return get_numbering().ndof (get_geo().sizes(), get_geo().map_dimension());
99 }
100 template <class T, class M>
103 {
104  if (!_is_hier) {
105  return _scalar_constit.internal_ndof();
106  }
107  size_type ndof = 0;
108  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
109  const space_constitution<T,M>& constit = *iter;
110  ndof += constit.data().internal_ndof(); // recursive call
111  }
112  return ndof;
113 }
114 template <class T, class M>
117 {
118  if (! is_initialized()) { return 0; }
119  return get_numbering().dis_ndof (get_geo().sizes(), get_geo().map_dimension());
120 }
121 template <class T, class M>
124 {
125  if (!_is_hier) {
126  return _scalar_constit.internal_dis_ndof();
127  }
128  size_type dis_ndof = 0;
129  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
130  const space_constitution<T,M>& constit = *iter;
131  dis_ndof += constit.data().internal_dis_ndof(); // recursive call
132  }
133  return dis_ndof;
134 }
135 template<class T, class M>
136 std::ostream&
137 put (std::ostream& os, const space_constitution<T,M>& constit, size_t level = 0)
138 {
140  if (! constit.is_hierarchical()) {
141  const space_scalar_constitution<T,M>& scalar_constit = constit.get_scalar();
142  if (!scalar_constit.data().is_initialized()) return os; // no numbering available: TODO: scalar_constit.is_initialized()
143  os << scalar_constit.get_numbering().name()
144  << "(" << scalar_constit.get_geo().name() << ")";
145  return os;
146  }
147  if (constit.valued_tag() == space_constant::vector ||
148  constit.valued_tag() == space_constant::tensor ||
150  assert_macro (constit.get_hierarchy().size() >= 1, "invalid space_constitution");
151  const space_constitution<T,M>& base_constit = *(constit.get_hierarchy().begin());
152  std::string spec = space_constant::valued_name (constit.valued_tag());
153  os << spec << "(";
154  put (os, base_constit, level+1);
155  os << ")";
156  return os;
157  }
158  if (level > 0) os << "(";
160  for (size_type i = 0, n = constit.get_hierarchy().size(); i < n; i++) {
161  const space_constitution<T,M>& xi = x[i];
162  put (os, xi, level+1); // recursive call
163  if (i+1 < n) { os << "*"; }
164  }
165  if (level > 0) os << ")";
166  return os;
167 }
168 template<class T, class M>
169 std::ostream&
170 operator<< (std::ostream& os, const space_constitution<T,M>& constit)
171 {
172  return put (os, constit);
173 }
174 template<class T, class M>
175 std::string
177 {
178  std::ostringstream ostrstr;
179  ostrstr << *this;
180  return ostrstr.str ();
181 }
182 template <class T, class M>
183 void
185 {
186  check_macro (!get_numbering().has_compact_support_inside_element(),
187  "try to [un]block domain `" << act.get_domain_name() << "' on discontinuous or bubble space("
188  << get_numbering().name()<<"(" <<_omega.name()<<"))");
189  _acts.push_back (act);
190 }
191 template <class T, class M>
192 void
194 {
196  if (! is_hierarchical()) {
197  space_scalar_constitution<T,M>& scalar_constit = get_scalar();
198  scalar_constit.do_act (act);
199  return;
200  }
201  for (iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
202  space_constitution<T,M>& constit = *iter;
203  constit.do_act (act); // recursive call
204  }
205 }
206 template <class T, class M>
207 void
209  array<size_type,M>& blocked_flag, // array<bool,M> not supported
210  const distributor& comp_ownership,
211  const distributor& start_by_component) const
212 {
213  check_macro (get_numbering().name() != "", "space with undefined finite element method cannot be used");
214  std::vector<size_type> comp_dis_idof_t;
215  distributor dof_ownership = blocked_flag.ownership();
216  size_type dis_ndof = dof_ownership.dis_size();
217  bool prev_act = space_act::block;
218  for (const_iterator iter = begin(), last = end(); iter != last; iter++) {
219  typename space_act::act_type act = (*iter).get_act();
220  const std::string& dom_name = (*iter).get_domain_name();
221  if (prev_act != act) {
222  blocked_flag.dis_entry_assembly();
223  prev_act = act;
224  }
225  const domain_indirect_basic<M>& dom = _omega.get_domain_indirect(dom_name);
226  size_type dom_dim = dom.map_dimension();
227  distributor ige_ownership = _omega.geo_element_ownership (dom_dim);
228  size_type first_dis_ige = ige_ownership.first_index();
229  size_type last_dis_ige = ige_ownership.last_index();
230  bool blk = (act == space_act::block) ? true : false;
231  for (size_type ioige = 0, noige = dom.size(); ioige < noige; ioige++) {
232  size_type ige = dom.oige (ioige).index();
233  size_type dis_ige = ige + first_dis_ige;
234  const geo_element& S = _omega.get_geo_element (dom_dim, ige);
235  get_numbering().dis_idof (_omega.sizes(), S, comp_dis_idof_t);
236  for (size_type loc_idof = 0, loc_ndof = comp_dis_idof_t.size(); loc_idof < loc_ndof; loc_idof++) {
237  size_type comp_dis_idof = comp_dis_idof_t [loc_idof];
238  size_type iproc = comp_ownership.find_owner (comp_dis_idof);
239  size_type first_comp_dis_idof = comp_ownership.first_index (iproc);
240  assert_macro (comp_dis_idof >= first_comp_dis_idof, "unexpected comp_dis_idof");
241  size_type comp_idof = comp_dis_idof - first_comp_dis_idof;
242  size_type comp_start_idof = start_by_component.size(iproc);
243  size_type idof = comp_start_idof + comp_idof;
244  size_type first_dis_idof = dof_ownership.first_index(iproc);
245  size_type dis_idof = first_dis_idof + idof;
246  assert_macro (dis_idof < dis_ndof, "unexpected dis_idof");
247  blocked_flag.dis_entry (dis_idof) = blk;
248  }
249  }
250  }
251 }
252 template <class T, class M>
253 void
255  array<size_type,M>& blocked_flag, // array<bool,M> not supported
256  const std::vector<distributor>& start_by_component,
257  size_type& i_comp) const
258 {
259  if (! is_hierarchical()) {
260  const space_scalar_constitution<T,M>& scalar_constit = get_scalar();
261  scalar_constit.data().build_blocked_flag (blocked_flag, ownership(), start_by_component [i_comp]);
262  i_comp++;
263  return;
264  }
265  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
266  const space_constitution<T,M>& constit = *iter;
267  constit.data().build_blocked_flag_recursive (blocked_flag, start_by_component, i_comp); // recursive call
268  }
269 }
270 template <class T, class M>
273 {
274  array<size_type,M> blocked_flag (ownership(), 0); // array<bool,M> not supported
275  size_type i_comp = 0;
276  build_blocked_flag_recursive (blocked_flag, _start_by_component, i_comp);
277  blocked_flag.dis_entry_assembly();
278  return blocked_flag;
279 }
280 template <class T, class M>
281 const geo_basic<T,M>&
283 {
284  if (! is_hierarchical()) {
285  return get_scalar().get_geo();
286  }
287  check_macro (_valued_tag == space_constant::vector ||
288  _valued_tag == space_constant::tensor ||
289  _valued_tag == space_constant::unsymmetric_tensor,
290  "get_geo: undefined for heterogeneous space products");
291  assert_macro (_hier_constit.size() > 0, "get_geo: empty vectorial/tensorial space product");
292  const_iterator iter = _hier_constit.begin();
293  const space_constitution<T,M>& constit = (*iter);
294  return constit.get_scalar().get_geo();
295 }
296 template <class T, class M>
297 const numbering<T,M>&
299 {
300  if (! is_hierarchical()) {
301  return get_scalar().get_numbering();
302  }
303  check_macro (_valued_tag == space_constant::vector ||
304  _valued_tag == space_constant::tensor ||
305  _valued_tag == space_constant::unsymmetric_tensor,
306  "get_numbering: undefined for heterogeneous space products");
307  assert_macro (_hier_constit.size() > 0, "get_numbering: empty vectorial/tensorial space product");
308  const_iterator iter = _hier_constit.begin();
309  const space_constitution<T,M>& constit = (*iter);
310  return constit.get_scalar().get_numbering();
311 }
312 template <class T, class M>
315 {
316  if (!_is_hier) {
317  communicator comm =_scalar_constit.get_geo().comm();
318  size_type dis_ndof =_scalar_constit.get_numbering().dis_ndof (_scalar_constit.get_geo().sizes(), _scalar_constit.get_geo().map_dimension());
319  distributor ios_ownership (dis_ndof, comm, distributor::decide);
320  return ios_ownership.size();
321  }
322  size_type ios_ndof = 0;
323  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
324  const space_constitution<T,M>& constit = *iter;
325  ios_ndof += constit.ios_ndof(); // recursive call
326  }
327  return ios_ndof;
328 }
329 template <class T, class M>
330 void
332  array<size_type,M>& idof2ios_dis_idof,
333  size_type& comp_start_idof,
334  size_type& comp_start_dis_idof) const
335 {
336  if (!_is_hier) {
337  array<size_type,M> comp_idof2ios_dis_idof;
338  array<size_type,M> comp_ios_idof2dis_idof;
339  _scalar_constit.get_numbering().set_ios_permutations (_scalar_constit.get_geo(), comp_idof2ios_dis_idof, comp_ios_idof2dis_idof);
340  size_type comp_ndof = comp_idof2ios_dis_idof.size();
341  size_type comp_dis_ndof = comp_idof2ios_dis_idof.dis_size();
342  size_type ndof = idof2ios_dis_idof.size();
343  size_type dis_ndof = idof2ios_dis_idof.dis_size();
344  for (size_type comp_idof = 0; comp_idof < comp_ndof; comp_idof++) {
345  size_type comp_ios_dis_idof = comp_idof2ios_dis_idof [comp_idof];
346  size_type ios_dis_idof = comp_start_dis_idof + comp_ios_dis_idof;
347  size_type idof = comp_start_idof + comp_idof;
348  assert_macro (idof < ndof, "unexpected idof="<<idof<<" out of range [0:"<<ndof<<"[");
349  assert_macro (ios_dis_idof < dis_ndof, "unexpected ios_dis_idof="<<ios_dis_idof<<" out of range [0:"<<dis_ndof<<"[");
350  idof2ios_dis_idof [idof] = ios_dis_idof;
351  }
352  comp_start_idof += comp_ndof;
353  comp_start_dis_idof += comp_dis_ndof;
354  return;
355  }
356  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
357  const space_constitution<T,M>& constit = *iter;
358  constit.set_ios_permutation_recursion (idof2ios_dis_idof, comp_start_idof, comp_start_dis_idof); // recursive call
359  }
360 }
361 template <class T, class M>
362 void
364  array<size_type,M>& idof2ios_dis_idof,
365  array<size_type,M>& ios_idof2dis_idof) const
366 {
367  if (!_is_hier) {
368  _scalar_constit.get_numbering().set_ios_permutations (_scalar_constit.get_geo(), idof2ios_dis_idof, ios_idof2dis_idof);
369  return;
370  }
371  communicator comm1 = comm();
372  distributor dof_ownership = ownership();
373  size_type ndof1 = dof_ownership.size();
374  size_type dis_ndof1 = dof_ownership.dis_size();
375  idof2ios_dis_idof.resize (dof_ownership, std::numeric_limits<size_type>::max());
376  size_type comp_start_idof = 0;
377  size_type comp_start_dis_idof = 0;
378  set_ios_permutation_recursion (idof2ios_dis_idof, comp_start_idof, comp_start_dis_idof);
379  size_type ios_ndof1 = ios_ndof();
380  distributor ios_dof_ownership (dis_ndof1, idof2ios_dis_idof.comm(), ios_ndof1);
381  ios_idof2dis_idof.resize (ios_dof_ownership, std::numeric_limits<size_type>::max());
382  idof2ios_dis_idof.reverse_permutation (ios_idof2dis_idof);
383 }
384 template <class T, class M>
387 {
388  switch (valued_tag()) {
389  case space_constant::scalar: {
390  return get_numbering().get_basis().size (hat_K);
391  }
395  size_type loc_comp_ndof = get_numbering().get_basis().size (hat_K);
396  size_type n_comp = size();
397  return n_comp*loc_comp_ndof;
398  }
399  default: {
400  fatal_macro ("dis_idof: hybrid multi-component: not yet");
401  return 0; // not reached
402  }
403  }
404 }
405 template <class T, class M>
406 void
407 space_constitution_rep<T,M>::dis_idof (const geo_element& K, std::vector<size_type>& dis_idof_t) const
408 {
409  size_type n_comp = size();
410  switch (valued_tag()) {
411  case space_constant::scalar: {
412  get_numbering().dis_idof (get_geo().sizes(), K, dis_idof_t);
413  return;
414  }
418  assert_macro (_hier_constit.size() > 0, "unexpected empty vector valued");
419  distributor comp_ownership = _hier_constit [0].ownership();
420  size_type comp_dis_ndof = get_numbering().dis_ndof (get_geo().sizes(), get_geo().map_dimension());
421  std::vector<size_type> comp_dis_idof_t;
422  get_numbering().dis_idof (get_geo().sizes(), K, comp_dis_idof_t);
423  size_type loc_ndof = comp_dis_idof_t.size();
424  dis_idof_t.resize (n_comp*loc_ndof);
425  for (size_type loc_idof = 0; loc_idof < loc_ndof; loc_idof++) {
426  size_type comp_dis_idof = comp_dis_idof_t [loc_idof];
427  size_type iproc = comp_ownership.find_owner (comp_dis_idof);
428  size_type comp_first_dis_idof = comp_ownership.first_index(iproc);
429  assert_macro (comp_dis_idof >= comp_first_dis_idof, "unexpected comp_dis_idof");
430  size_type comp_idof = comp_dis_idof - comp_first_dis_idof;
431  size_type first_dis_idof = ownership().first_index(iproc);
432  for (size_type i_comp = 0; i_comp < n_comp; i_comp++) {
433  size_type comp_start_idof = _start_by_component [i_comp].size(iproc);
434  size_type idof = comp_start_idof + comp_idof;
435  size_type dis_idof = first_dis_idof + idof;
436  dis_idof_t [i_comp*loc_ndof + loc_idof] = dis_idof;
437  }
438  }
439  return;
440  }
441  default: {
442  fatal_macro ("dis_idof: hybrid multi-component: not yet");
443  }
444  }
445 }
446 // => build _start_by_component : used by set_external_dof()
447 template <class T, class M>
450 {
451  if (!_is_hier) {
452  return 1;
453  }
454  size_type n_comp = 0;
455  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
456  n_comp += (*iter).data().n_component_recursive(); // recursive call
457  }
458  return n_comp;
459 }
460 template <class T, class M>
461 void
463  std::vector<distributor>& start_by_component,
464  size_type& i_comp,
465  const communicator& comm,
466  size_type& comp_start_idof,
467  size_type& comp_start_dis_idof) const
468 {
469  if (!_is_hier) {
470  start_by_component [i_comp] = distributor (comp_start_dis_idof, comm, comp_start_idof);
471  i_comp++;
472  comp_start_idof += ndof();
473  comp_start_dis_idof += dis_ndof();
474  return;
475  }
476  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
477  (*iter).data().init_start_by_component (start_by_component, i_comp, comm,
478  comp_start_idof, comp_start_dis_idof);
479  }
480 }
481 template <class T, class M>
482 void
484 {
485  size_type n_comp_rec = n_component_recursive();
486  _start_by_component.resize (n_comp_rec);
487  size_type i_comp = 0;
488  size_type comp_start_idof = 0;
489  size_type comp_start_dis_idof = 0;
490  init_start_by_component (_start_by_component, i_comp, comm(), comp_start_idof, comp_start_dis_idof);
491 }
492 // get external idofs: used by space<distributed>::freeze
493 template <class T, class M>
494 void
496  const geo_basic<T,M>& dom,
497  std::set<size_type>& ext_dof_set,
498  const distributor& dof_ownership,
499  const distributor& start_by_component) const
500 {
501  distributor comp_ownership = ownership();
502  size_type comp_dis_ndof = comp_ownership.dis_size();
503  std::vector<size_type> comp_dis_idof1;
504  for (size_type ie = 0, ne = dom.size(); ie < ne; ie++) {
505  const geo_element& K = dom [ie];
506  dis_idof (K, comp_dis_idof1);
507  for (size_type loc_idof = 0, loc_ndof = comp_dis_idof1.size(); loc_idof < loc_ndof; loc_idof++) {
508  size_type comp_dis_idof = comp_dis_idof1 [loc_idof];
509  assert_macro (comp_dis_idof < comp_dis_ndof, "idof " << comp_dis_idof1 [loc_idof] << " out of range[0:"<< comp_dis_ndof << "[");
510  if (! comp_ownership.is_owned (comp_dis_idof)) {
511  size_type iproc = comp_ownership.find_owner (comp_dis_idof);
512  size_type comp_first_dis_idof = comp_ownership.first_index(iproc);
513  assert_macro (comp_dis_idof >= comp_first_dis_idof, "unexpected comp_dis_idof");
514  size_type comp_idof = comp_dis_idof - comp_first_dis_idof;
515  size_type comp_start_idof = start_by_component.size(iproc);
516  size_type idof = comp_start_idof + comp_idof;
517  size_type first_dis_idof = dof_ownership.first_index(iproc);
518  size_type dis_idof = first_dis_idof + idof;
519  assert_macro (! dof_ownership.is_owned (dis_idof), "unexpected dis_idof="<<dis_idof<<" in range ["
520  << first_dis_idof << ":" << dof_ownership.last_index() << "[");
521  ext_dof_set.insert (dis_idof);
522  }
523  }
524  }
525 }
526 template <class T, class M>
527 void
529  const geo_basic<T,M>& dom,
530  std::set<size_type>& ext_dof_set,
531  const distributor& dof_ownership,
532  const distributor& start_by_component) const
533 {
534  size_type dim = dom.dimension();
535  size_type map_dim = dom.map_dimension();
536  if (dim > map_dim) {
537  return;
538  }
539  if (dom.name() != dom.get_background_geo().name()) {
540  return;
541  }
542  dom.neighbour_guard(); // uses S.master(i), a neighbour connnectivity
543  if (map_dim == 0) return; // no sides
544  size_type sid_dim = map_dim-1;
545  distributor comp_ownership = ownership();
546  size_type comp_dis_ndof = comp_ownership.dis_size();
547  std::vector<size_type> comp_dis_idof1;
548  for (size_type isid = 0, nsid = dom.size(sid_dim); isid < nsid; isid++) {
549  const geo_element& S = dom.get_geo_element (sid_dim, isid);
550  for (size_type i_master = 0; i_master < 2; i_master++) {
551  size_type dis_ie = S.master(i_master); // two possible Ki such that S is a side of Ki
552  if (dis_ie == std::numeric_limits<size_type>::max()) continue; // S is on the boundary
553  const geo_element& K = dom.dis_get_geo_element (map_dim, dis_ie);
554  dis_idof (K, comp_dis_idof1);
555  for (size_type loc_idof = 0, loc_ndof = comp_dis_idof1.size(); loc_idof < loc_ndof; loc_idof++) {
556  size_type comp_dis_idof = comp_dis_idof1 [loc_idof];
557  assert_macro (comp_dis_idof < comp_dis_ndof, "idof " << comp_dis_idof1 [loc_idof] << " out of range[0:"<< comp_dis_ndof << "[");
558  if (! comp_ownership.is_owned (comp_dis_idof)) {
559  size_type iproc = comp_ownership.find_owner (comp_dis_idof);
560  size_type comp_first_dis_idof = comp_ownership.first_index(iproc);
561  assert_macro (comp_dis_idof >= comp_first_dis_idof, "unexpected comp_dis_idof");
562  size_type comp_idof = comp_dis_idof - comp_first_dis_idof;
563  size_type comp_start_idof = start_by_component.size(iproc);
564  size_type idof = comp_start_idof + comp_idof;
565  size_type first_dis_idof = dof_ownership.first_index(iproc);
566  size_type dis_idof = first_dis_idof + idof;
567  assert_macro (! dof_ownership.is_owned (dis_idof), "unexpected dis_idof="<<dis_idof<<" in range ["
568  << first_dis_idof << ":" << dof_ownership.last_index() << "[");
569  ext_dof_set.insert (dis_idof);
570  }
571  }
572  }
573  }
574 }
575 template <class T, class M>
576 void
578  std::set<size_type>& ext_dof_set,
579  const distributor& dof_ownership,
580  const std::vector<distributor>& start_by_component,
581  size_type& i_comp) const
582 {
583  if (! is_hierarchical()) {
584  const space_scalar_constitution<T,M>& scalar_constit = get_scalar();
585  if (! scalar_constit.get_numbering().has_compact_support_inside_element()) {
586  continuous_append_external_dof (scalar_constit.get_geo(), ext_dof_set, dof_ownership, start_by_component [i_comp]);
587  for (size_type idom = 0, ndom = scalar_constit.get_geo().n_domain(); idom < ndom; idom++) {
588  const geo_basic<T,M>& dom = scalar_constit.get_geo().get_domain (idom);
589  continuous_append_external_dof (dom, ext_dof_set, dof_ownership, start_by_component [i_comp]);
590  }
591  } else {
592  discontinuous_append_external_dof (scalar_constit.get_geo(), ext_dof_set, dof_ownership, start_by_component [i_comp]);
593  }
594  i_comp++;
595  return;
596  }
597  for (const_iterator iter = _hier_constit.begin(), last = _hier_constit.end(); iter != last; ++iter) {
598  (*iter).data().compute_external_dofs (ext_dof_set, dof_ownership, start_by_component, i_comp);
599  }
600 }
601 template <class T, class M>
602 void
604  std::set<size_type>& ext_dof_set) const
605 {
606  ext_dof_set.clear();
607  size_type i_comp = 0;
608  compute_external_dofs (ext_dof_set, ownership(), _start_by_component, i_comp);
609 }
613 template std::ostream& operator<< (std::ostream&, const space_constitution<Float,sequential>&);
614 
615 #ifdef _RHEOLEF_HAVE_MPI
619 template std::ostream& operator<< (std::ostream&, const space_constitution<Float,distributed>&);
620 #endif // _RHEOLEF_HAVE_MPI
621 
622 } // namespace rheolef
distributor - data distribution table
Definition: distributor.h:19
#define fatal_macro(message)
Definition: compiler.h:98
size_type size(size_type ip) const
Definition: distributor.h:110
bool is_owned(size_type dis_i, size_type ip) const
true when dis_i in [first_index(ip):last_index(ip)[
Definition: distributor.h:160
space_scalar_constitution< T, M > scalar_type
rep::const_iterator const_iterator
Definition: space_mult.h:36
reference_element - reference element
void build_blocked_flag(array< size_type, M > &blocked_flag, const distributor &comp_ownership, const distributor &start_by_component) const
numbering - global degree of freedom numbering
Definition: numbering.h:55
size_type find_owner(size_type dis_i) const
find iproc associated to a global index dis_i: CPU=log(nproc)
Definition: distributor.cc:69
void put(std::ostream &out, std::string name, const tiny_matrix< T > &a)
Definition: tiny_lu.h:106
container_type::const_iterator const_iterator
void do_act(const space_act &act)
array< size_type, M > build_blocked_flag() const
const geo_basic< T, M > & get_geo() const
hierarchy_type::size_type size_type
const communicator & comm() const
Definition: diststream.h:240
irheostream, orheostream - large data streams
Definition: compiler.h:7
void set_ios_permutation_recursion(array< size_type, M > &idof2ios_dis_idof, size_type &comp_start_idof, size_type &comp_start_dis_idof) const
communicator internal_comm() const
void continuous_append_external_dof(const geo_basic< T, M > &dom, std::set< size_type > &ext_dof_set, const distributor &dof_ownership, const distributor &start_by_component) const
void discontinuous_append_external_dof(const geo_basic< T, M > &dom, std::set< size_type > &ext_dof_set, const distributor &dof_ownership, const distributor &start_by_component) const
#define assert_macro(ok_condition, message)
Definition: compiler.h:120
const numbering< T, M > & get_numbering() const
size_type last_index(size_type ip) const
Definition: distributor.h:104
void build_blocked_flag_recursive(array< size_type, M > &blocked_flag, const std::vector< distributor > &start_by_component, size_type &i_comp) const
space – piecewise polynomial finite element space
Definition: space.h:229
#define check_macro(ok_condition, message)
Definition: compiler.h:104
const std::string & valued_name(valued_type valued_tag)
size_t d
const numbering< T, M > & get_numbering() const
hierarchy_type::const_iterator const_iterator
size_type first_index(size_type ip) const
global index range and local size owned by ip-th process
Definition: distributor.h:98
size_type master(bool i) const
const geo_basic< T, M > & get_geo() const
static const size_type decide
Definition: distributor.h:31
const space_scalar_constitution< T, M > & get_scalar() const
domain_indirect - a named part of a finite element mesh
void set_ios_permutation_recursion(array< size_type, M > &idof2ios_dis_idof, size_type &comp_start_idof, size_type &comp_start_dis_idof) const
size_type dis_size() const
global and local sizes
Definition: distributor.h:154
valued_type valued_tag(const std::string &name)
const std::string & get_domain_name() const
bool operator==(const space_constitution_rep< T, M > &V2) const
void do_act(const space_act &act)
const_iterator begin() const
Definition: space_mult.h:43
const_iterator end() const
Definition: space_mult.h:44
boost::proto::result_of::make_expr< boost::proto::tag::function, vec_domain, const vec_detail::max_, const int &, const vec< T, M > & >::type max(const int &x, const vec< T, M > &y)
geo_element - element of a mesh
void set_ios_permutations(array< size_type, M > &idof2ios_dis_idof, array< size_type, M > &ios_idof2dis_idof) const
size_type loc_ndof(const reference_element &hat_K) const
void do_act(const space_act &act)
const valued_type & valued_tag() const
void compute_external_dofs(std::set< size_type > &ext_dof_set) const
std::allocator< int >::size_type size_type
Definition: distributor.h:23
const hierarchy_type & get_hierarchy() const
hierarchy_type::iterator iterator
size_type n_component(valued_type valued_tag, size_type d, coordinate_type sys_coord)
reference_element_H::size_type size_type
void dis_idof(const geo_element &K, std::vector< size_type > &dis_idof) const