Rheolef  7.1
an efficient C++ finite element environment
geo_build_zero_dim.cc
Go to the documentation of this file.
1 // used by space IR = space(zero,"P1");
22 // zero.geo = 0D, 1 node, as in file:
23 // mesh
24 // 4
25 // header
26 // dimension 0
27 // nodes 1
28 // end header
29 //
30 // NOTE:
31 // - the only node is attributed to iproc=0
32 // used by field_concat.cc & form_concat.cc
33 // and this attribution convention
34 // is assumed in vec_concat.cc & csr_concat.cc
35 //
36 // TODO:
37 // - build it directly, without any file
38 // - for space IR^n : use a "n" parameter
39 //
40 #include "rheolef/geo.h"
41 
42 namespace rheolef {
43 
44 static std::string zero_full_name() {
45  std::string full_name = std::string(_RHEOLEF_PKGDATADIR) + "/zero-1";
46  if (file_exists (full_name + ".geo")) return full_name;
47  // second chance: regression tests running with non-installed lib
48  full_name = std::string(_RHEOLEF_ABS_TOP_SRCDIR) + "/main/lib/zero-1";
49  if (file_exists (full_name + ".geo")) return full_name;
50  fatal_macro ("cannot find \"zero-1.geo\"");
51  return std::string();
52 }
53 #define _RHEOLEF_zero_dimension(M) \
54 template <class T> \
55 geo_basic<T,M>::geo_basic ( \
56  details::zero_dimension, \
57  const communicator& comm) \
58 : base (0) \
59 { \
60  base::operator= (geo_load<T,M>(zero_full_name())); \
61 }
62 _RHEOLEF_zero_dimension(sequential)
63 #ifdef _RHEOLEF_HAVE_MPI
65 #endif // _RHEOLEF_HAVE_MPI
66 #undef _RHEOLEF_zero_dimension
67 // ----------------------------------------------------------------------------
68 // instanciation in library
69 // ----------------------------------------------------------------------------
70 #define _RHEOLEF_instanciation(T,M) \
71 template \
72 geo_basic<T,M>::geo_basic ( \
73  details::zero_dimension, \
74  const communicator& comm);
75 
76 _RHEOLEF_instanciation(Float,sequential)
77 #ifdef _RHEOLEF_HAVE_MPI
79 #endif // _RHEOLEF_HAVE_MPI
80 #undef _RHEOLEF_instanciation
81 
82 
83 } // namespace rheolef
rheolef::file_exists
bool file_exists(const std::string &filename)
file_exists: see the rheostream page for the full documentation
Definition: scatch.icc:42
rheolef::_RHEOLEF_instanciation
_RHEOLEF_instanciation(Float, sequential, std::allocator< Float >) _RHEOLEF_instanciation(Float
rheolef::_RHEOLEF_zero_dimension
_RHEOLEF_zero_dimension(sequential) _RHEOLEF_zero_dimension(distributed) _RHEOLEF_instanciation(Float
fatal_macro
#define fatal_macro(message)
Definition: dis_macros.h:33
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
_RHEOLEF_ABS_TOP_SRCDIR
#define _RHEOLEF_ABS_TOP_SRCDIR
Definition: config.h:6
Float
see the Float page for the full documentation
_RHEOLEF_PKGDATADIR
#define _RHEOLEF_PKGDATADIR
Definition: config.h:240
rheolef::distributed
distributed
Definition: asr.cc:228