SheafSystem  0.0.0.0
eval_iterator.h
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 
18 // Interface for class eval_iterator
19 
20 
21 #ifndef EVAL_ITERATOR_H
22 #define EVAL_ITERATOR_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef DEPTH_FIRST_ITERATOR_H
29 #include "SheafSystem/depth_first_iterator.h"
30 #endif
31 
32 #ifndef BASE_SPACE_POSET_H
33 #include "SheafSystem/base_space_poset.h"
34 #endif
35 
36 #ifndef STD_LIST_H
37 #include "SheafSystem/std_list.h"
38 #endif
39 
40 #ifndef SEC_VD_H
41 #include "SheafSystem/sec_vd.h" // just to get typedefs
42 #endif
43 
44 namespace sheaf
45 {
46 class index_space_handle;
47 }
48 
49 namespace fiber_bundle
50 {
51 
52 using namespace sheaf;
53 
54 
55 class eval_family;
56 class section_space_schema_member;
57 class section_evaluator;
58 class sec_rep_descriptor;
59 
66 class SHEAF_DLL_SPEC eval_iterator : public depth_first_iterator
67 {
68 public:
69 
70  // CANONICAL MEMBERS
71 
75  eval_iterator();
76 
80  eval_iterator(const eval_iterator& xother);
81 
85  ~eval_iterator();
86 
90  virtual bool is_ancestor_of(const any* xother) const;
91 
95  virtual eval_iterator* clone() const;
96 
100  bool invariant() const;
101 
102  // OTHER CONSTRUCTORS
103 
108  eval_iterator(const section_space_schema_member& xschema_anchor, bool xvisit_once = true);
109 
110  // ITERATOR FACET
111 
116  virtual bool is_initialized() const;
117 
121  virtual void force_is_done();
122 
126  inline void next()
127  {
128  next(false);
129  }
130 
137  void next(bool xtruncate);
138 
139  // EVALUATION ITERATOR FACET
140 
145  section_space_schema_member& schema_anchor();
146 
151  const section_space_schema_member& schema_anchor() const;
152 
156  void put_schema_anchor(const section_space_schema_member& xschema_anchor);
157 
161  void put_schema_anchor(pod_index_type xschema_anchor_index);
162 
166  void put_schema_anchor(const scoped_index& xschema_anchor_index);
167 
171  base_space_poset& base_space();
172 
176  const base_space_poset& base_space() const;
177 
181  int db() const;
182 
186  pod_index_type type_id() const;
187 
191  scoped_index client_id() const;
192 
196  section_evaluator& evaluator();
197 
201  const section_evaluator& evaluator() const;
202 
206  block<scoped_index>& discretization_members();
207 
211  const block<scoped_index>& discretization_members() const;
212 
217  scoped_index discretization_client_id(size_type xi);
218 
223  void gather_dofs(const sec_vd& xsec, block<sec_vd::dof_type>& xdofs);
224 
229  void scatter_dofs(sec_vd& xsec, const block<sec_vd::dof_type>& xdofs, size_type xindex);
230 
231 protected:
232 
236  void initialize_schema_anchor(const section_space_schema_member& xanchor);
237 
238 
239 private:
240 
245  section_space_schema_member* _schema_anchor;
246 
250  base_space_poset* _base_space;
251 
255  bool _down_set_collection_enabled;
256 
260  eval_family* _evaluators;
261 
265  block<scoped_index> _discretization_members;
266 
270  block<scoped_index> _non_discretization_members;
271 
275  scoped_index _evaluator_id;
276 
282  scoped_index _maximal_eval_id;
283 
287  bool _vertex_discretization;
288 
293  bool _disc_reversal_enabled;
294 
298  index_space_handle* _eval_id_space;
299 
303  index_space_handle* _disc_id_space;
304 
308  subposet* _eval_sp;
309 
313  subposet* _disc_sp;
314 
318  subposet* _mono_sp;
319 
323  void put_schema_variables();
324 
325 };
326 
327 } // namespace fiber_bundle
328 
329 #endif // ifndef EVAL_ITERATOR_H
A client handle for a subposet.
Definition: subposet.h:86
An iterator over the members of the evaluation subposet contained in the downset of the base space of...
Definition: eval_iterator.h:66
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
Abstract base class with useful features for all objects.
Definition: any.h:39
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
void next()
Makes this the next member of the subset.
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.