SheafSystem  0.0.0.0
field_eval_iterator.h
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 
22 #ifndef FIELD_EVAL_ITERATOR_H
23 #define FIELD_EVAL_ITERATOR_H
24 
25 #ifndef SHEAF_DLL_SPEC_H
26 #include "SheafSystem/sheaf_dll_spec.h"
27 #endif
28 
29 #ifndef DEPTH_FIRST_ITERATOR_H
30 #include "SheafSystem/depth_first_iterator.h"
31 #endif
32 
33 #ifndef SEC_VD_H
34 #include "SheafSystem/sec_vd.h"
35 #endif
36 
37 #ifndef STD_LIST_H
38 #include "SheafSystem/std_list.h"
39 #endif
40 
41 #ifndef STD_SET_H
42 #include "SheafSystem/std_set.h"
43 #endif
44 
45 namespace fiber_bundle
46 {
47 class base_space_poset;
48 class eval_family;
49 class section_space_schema_member;
50 class section_evaluator;
51 class sec_rep_descriptor;
52 }
53 
54 namespace fields
55 {
56 
57 using namespace sheaf;
58 using namespace fiber_bundle;
59 
60 class field_vd;
61 
67 class SHEAF_DLL_SPEC field_eval_iterator : public depth_first_iterator
68 {
69 
70  // ===========================================================
72  // ===========================================================
74 
75 public:
76 
80  field_eval_iterator(const field_vd& xfield);
81 
86  const section_space_schema_member& xcoordinate_schema_anchor,
87  const section_space_schema_member& xproperty_schema_anchor);
88 
93 
97  section_space_schema_member& coordinate_schema_anchor() const;
98 
102  section_space_schema_member& property_schema_anchor() const;
103 
107  const base_space_poset& base_space() const;
108 
112  const subposet& evaluation() const;
113 
117  int db() const;
118 
122  pod_index_type type_id() const;
123 
127  std::string type_name() const;
128 
133  section_evaluator& coordinate_evaluator() const;
134 
139  section_evaluator& property_evaluator() const;
140 
145  const block<scoped_index>& coordinate_discretization_members() const;
146 
151  const block<scoped_index>& property_discretization_members() const;
152 
157  bool property_has_been_visited(pod_index_type xhub_id) const;
158 
163  bool property_has_been_visited(const scoped_index& xid) const;
164 
169  void gather_coordinate_dofs(const sec_vd& xcoord,
170  block<sec_vd::dof_type>& xdofs);
171 
176  size_type refinement_depth() const;
177 
183  void update_capacity();
184 
189  bool enough_capacity() const;
190 
191 protected:
192 
196  void initialize_coordinate_schema(const section_space_schema_member& xanchor);
197 
201  void initialize_property_schema(const section_space_schema_member& xanchor);
202 
207  void initialize_discretization_order_correction();
208 
212  void ensure_discretization_order(block<scoped_index>& xdisc_mbrs);
213 
214 private:
215 
219  field_eval_iterator() {};
220 
224  field_eval_iterator(const field_eval_iterator& xother) {};
225 
229  section_space_schema_member* _coordinate_schema_anchor;
230 
234  section_space_schema_member* _property_schema_anchor;
235 
239  base_space_poset* _base_space;
240 
244  subposet _evaluation;
245 
249  bool _down_set_collection_enabled;
250 
254  eval_family* _coordinate_evaluators;
255 
259  eval_family* _property_evaluators;
260 
264  block<scoped_index> _coordinate_discretization_members;
265 
269  block<scoped_index> _property_discretization_members;
270 
274  zn_to_bool* _property_has_been_visited;
275 
279  block<scoped_index> _non_discretization_members;
280 
284  scoped_index _evaluator_id;
285 
289  int _evaluator_refinement_depth;
290 
294  bool _coordinate_vertex_discretization;
295 
300  bool _coordinate_correction_enabled;
301 
305  bool _property_vertex_discretization;
306 
311  bool _property_correction_enabled;
312 
317  std::set<pod_index_type> _correction_set;
318 
322  // static const int BUFFER_UB = 16;
323  enum static_const_int {BUFFER_UB = 16};
324 
325 
329  int _top_zone_depth;
330 
332 
333 
334  // ===========================================================
336  // ===========================================================
338 
339 public:
340 
344  virtual void force_is_done();
345 
349  inline void next()
350  {
351  next(false);
352  }
353 
360  virtual void next(bool xtruncate);
361 
368  void repeat(bool xwas_eval_member);
369 
373  virtual void reset(bool xreset_markers = true);
374 
376 
377 
378  // ===========================================================
380  // ===========================================================
382 
383 public:
384 
388  virtual bool is_ancestor_of(const any* xother) const;
389 
393  virtual field_eval_iterator* clone() const;
394 
398  bool invariant() const;
399 
401 
402 };
403 
404 } // namespace fields
405 
406 #endif // ifndef FIELD_EVAL_ITERATOR_H
A client handle for a subposet.
Definition: subposet.h:86
void next()
Makes this the next member of the subset.
Namespace for fields component of sheaf system.
An iterator which concurrently traverses the schema of both the coordinates and property sections of ...
Abstract base class with useful features for all objects.
Definition: any.h:39
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
Definition: zn_to_bool.h:52
The lattice of closed cells of a cellular space; a lattice representation of a computational mesh...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
A family of compatible section evaluators, one for each member of some family of cell types; a map fr...
Definition: eval_family.h:67
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
A vd-valued property as a function of global coordinates.
Definition: field_vd.h:69
An abstract local section evaluator; a map from {local coordinates x dofs} to section value...
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.
A client handle for a poset member which has been prepared for use as a schema for a section space...
Namespace for the fiber_bundles component of the sheaf system.