37 #ifndef GETFEM_GENERIC_ASSEMBLY_COMP_EXEC_H__ 38 #define GETFEM_GENERIC_ASSEMBLY_COMP_EXEC_H__ 44 class ga_if_hierarchy :
public std::vector<size_type> {
47 void increment() { (back())++; }
48 void child_of(
const ga_if_hierarchy &gih)
49 { *
this = gih; push_back(0); }
50 bool is_compatible(
const std::list<ga_if_hierarchy> &gihl) {
52 std::list<ga_if_hierarchy>::const_iterator it = gihl.begin();
53 for (; it != gihl.end(); ++it) {
54 if (it->size() <= size()) {
56 for (
size_type i = 0; i+1 < it->size(); ++i)
57 if ((*it)[i] != (*this)[i]) { ok =
false;
break; }
58 if (it->back() > (*this)[it->size()-1]) { ok =
false;
break; }
65 ga_if_hierarchy() :
std::vector<
size_type>(1) { (*this)[0] = 0; }
69 struct ga_instruction {
70 virtual int exec() = 0;
71 virtual ~ga_instruction() {};
74 typedef std::shared_ptr<ga_instruction> pga_instruction;
75 typedef std::vector<pga_instruction> ga_instruction_list;
78 struct gauss_pt_corresp {
80 papprox_integration pai;
81 std::vector<size_type> nodes;
84 bool operator <(
const gauss_pt_corresp &gpc1,
85 const gauss_pt_corresp &gpc2);
87 struct ga_instruction_set {
89 papprox_integration pai;
90 fem_interpolation_context ctx;
91 base_small_vector Normal;
99 fem_precomp_pool fp_pool;
100 std::map<gauss_pt_corresp, bgeot::pstored_point_tab> neighbour_corresp;
102 struct region_mim : std::pair<const mesh_im *, const mesh_region *> {
103 const mesh_im* mim()
const {
return this->first; }
104 const mesh_region* region()
const {
return this->second; }
105 region_mim(
const mesh_im *mim_,
const mesh_region *region_) :
106 std::pair<const mesh_im *, const mesh_region *>(mim_, region_) {}
109 std::map<std::string, const base_vector *> extended_vars;
110 std::map<std::string, base_vector> really_extended_vars;
111 std::map<std::string, gmm::sub_interval> var_intervals;
114 struct variable_group_info {
116 gmm::sub_interval Ir, In;
118 const base_vector *U;
119 const std::string *varname;
120 variable_group_info() : mf(0), U(0), varname(0) {}
123 struct interpolate_info {
127 fem_interpolation_context ctx;
129 base_small_vector Normal;
131 std::map<std::string, variable_group_info> groups_info;
132 std::map<var_trans_pair, base_tensor> derivatives;
133 std::map<const mesh_fem *, pfem_precomp> pfps;
136 struct elementary_trans_info {
142 std::set<std::string> transformations;
144 struct region_mim_instructions {
148 ga_if_hierarchy current_hierarchy;
149 std::map<std::string, base_vector> local_dofs;
150 std::map<const mesh_fem *, pfem_precomp> pfps;
151 std::map<const mesh_fem *, base_tensor> base;
152 std::map<const mesh_fem *, std::list<ga_if_hierarchy>> base_hierarchy;
153 std::map<const mesh_fem *, base_tensor> grad;
154 std::map<const mesh_fem *, std::list<ga_if_hierarchy>> grad_hierarchy;
155 std::map<const mesh_fem *, base_tensor> hess;
156 std::map<const mesh_fem *, std::list<ga_if_hierarchy>> hess_hierarchy;
158 std::map<const mesh_fem *, base_tensor>
159 xfem_plus_base, xfem_plus_grad, xfem_plus_hess,
160 xfem_minus_base, xfem_minus_grad, xfem_minus_hess;
161 std::map<const mesh_fem *, std::list<ga_if_hierarchy>>
162 xfem_plus_base_hierarchy, xfem_plus_grad_hierarchy,
163 xfem_plus_hess_hierarchy, xfem_minus_base_hierarchy,
164 xfem_minus_grad_hierarchy, xfem_minus_hess_hierarchy;
166 std::map<std::string, std::set<std::string>> transformations;
167 std::set<std::string> transformations_der;
168 std::map<std::string, interpolate_info> interpolate_infos;
169 std::map<std::string, elementary_trans_info> elementary_trans_infos;
173 ga_instruction_list begin_instructions;
175 ga_instruction_list elt_instructions;
177 ga_instruction_list instructions;
178 std::map<scalar_type, std::list<pga_tree_node> > node_list;
180 region_mim_instructions(): m(0), im(0) {}
183 std::list<ga_tree> trees;
185 std::list<ga_tree> interpolation_trees;
187 typedef std::map<region_mim, region_mim_instructions> instructions_set;
189 instructions_set whole_instructions;
191 ga_instruction_set() { max_dof = nb_dof = 0; need_elt_size =
false; ipt=0; }
195 void ga_exec(ga_instruction_set &gis, ga_workspace &workspace);
196 void ga_function_exec(ga_instruction_set &gis);
197 void ga_compile(ga_workspace &workspace, ga_instruction_set &gis,
199 void ga_compile_function(ga_workspace &workspace,
200 ga_instruction_set &gis,
bool scalar);
201 void ga_compile_interpolation(ga_workspace &workspace,
202 ga_instruction_set &gis);
203 void ga_interpolation_exec(ga_instruction_set &gis,
204 ga_workspace &workspace,
205 ga_interpolation_context &gic);
206 void ga_interpolation_single_point_exec
207 (ga_instruction_set &gis, ga_workspace &workspace,
208 const fem_interpolation_context &ctx_x,
const base_small_vector &Normal,
209 const mesh &interp_mesh);
The object geotrans_precomp_pool Allow to allocate a certain number of geotrans_precomp and automatic...
Semantic analysis of assembly trees and semantic manipulations.
size_t size_type
used as the common size type in the library
GEneric Tool for Finite Element Methods.
size_type alpha(short_type n, short_type d)
Return the value of which is the number of monomials of a polynomial of variables and degree ...
std::shared_ptr< const bgeot::geometric_trans > pgeometric_trans
pointer type for a geometric transformation