Rheolef  7.1
an efficient C++ finite element environment
space_constitution_get.cc
Go to the documentation of this file.
1 // input space_constitution files:
22 // idiststream& operator >> (idiststream&, space_constitution&);
23 //
24 // author: Pierre.Saramito@imag.fr
25 //
26 // date: 19 dec 2011
27 //
29 
30 // ================================================================================
31 // part 1 : read from idiststeam and build as tree_type* result_ptr
32 // ================================================================================
33 /* AIX requires this to be the first thing in the file. */
34 #ifndef __GNUC__
35 # if _RHEOLEF_HAVE_ALLOCA_H
36 # include <alloca.h>
37 # else
38 # ifdef _AIX
39 #pragma alloca
40 # else
41 # ifndef alloca /* predefined by HP cc +Olibcalls */
42 char *alloca ();
43 # endif
44 # endif
45 # endif
46 #endif
47 
48 namespace rheolef {
49 
50 using namespace std;
51 
52 typedef size_t size_type;
53 
56 
57 extern int space_constitution_lex();
58 void space_constitution_error (const char* msg) {
59  std::string near;
60  error_macro("space constitution input:" << space_constitution_line_no << ": " << msg);
62 }
63 int space_constitution_wrap () { return 1; }
64 
65 #pragma GCC diagnostic push
66 #pragma GCC diagnostic ignored "-Weffc++"
67 #define YYMALLOC ::malloc
68 #define YYFREE ::free
69 #include "space_constitution_yacc.cc"
70 // avoid re-definition of YY_NULL within flex
71 #ifdef YY_NULL
72 #undef YY_NULL
73 #endif
74 #include "space_constitution_lex.cc"
75 #pragma GCC diagnostic pop
76 
77 static yyFlexLexer input_space_constitution;
78 
80 
81 // ================================================================================
82 // part 2 : main call
83 // ================================================================================
84 template<class T, class M>
85 idiststream&
86 operator>> (idiststream& ids, space_constitution<T,M>& constit)
87 {
88  space_constitution_get_pass_1_2 (ids, space_constitution_parse,
90  // convert tree_type result_ptr to space_constitution
91  const tree_type* ptr = result_ptr;
92  constit = build_from_tree<T,M> (*ptr);
93  delete_macro (result_ptr); result_ptr = 0;
94  return ids;
95 }
96 // ----------------------------------------------------------------------------
97 // instanciation in library
98 // ----------------------------------------------------------------------------
99 template idiststream& operator>> (idiststream&, space_constitution<Float,sequential>&);
100 
101 #ifdef _RHEOLEF_HAVE_MPI
102 template idiststream& operator>> (idiststream&, space_constitution<Float,distributed>&);
103 #endif // _RHEOLEF_HAVE_MPI
104 
105 } // namespace rheolef
space_constitution_get.icc
rheolef::space_constitution_error
void space_constitution_error(const char *msg)
Definition: space_constitution_get.cc:58
rheolef::space_constitution_line_no
static size_type space_constitution_line_no
Definition: space_constitution_get.cc:54
rheolef::result_ptr
static tree_type * result_ptr
Definition: space_constitution_get.icc:100
rheolef::tree_type
Definition: space_constitution_get.icc:67
rheolef::size_type
size_t size_type
Definition: space_constitution_get.cc:52
rheolef::space_constitution_n_error
static size_type space_constitution_n_error
Definition: space_constitution_get.cc:55
rheolef::space_constitution_lex
int space_constitution_lex()
Definition: space_constitution_get.cc:79
rheolef::space_constitution_wrap
int space_constitution_wrap()
Definition: space_constitution_get.cc:63
rheolef::operator>>
std::istream & operator>>(std::istream &is, const catchmark &m)
Definition: catchmark.h:88
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
error_macro
#define error_macro(message)
Definition: dis_macros.h:49
rheolef::input_space_constitution
static yyFlexLexer input_space_constitution
Definition: space_constitution_get.cc:77
rheolef::space_constitution
Definition: space_constitution.h:381