SheafSystem  0.0.0.0
structured_block.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 #ifndef STRUCTURED_BLOCK_H
22 #define STRUCTURED_BLOCK_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef HOMOGENEOUS_BLOCK_H
29 #include "SheafSystem/homogeneous_block.h"
30 #endif
31 
32 #ifndef CHART_POINT_H
33 #include "SheafSystem/chart_point.h"
34 #endif
35 
36 #ifndef STD_CMATH_H
37 #include "SheafSystem/std_cmath.h"
38 #endif
39 
40 namespace fiber_bundle
41 {
42 
43 using namespace sheaf;
44 
45 class chart_point_3d;
46 
51 class SHEAF_DLL_SPEC structured_block : public homogeneous_block
52 {
53  // ===========================================================
55  // ===========================================================
57 
58 public:
59 
64  static host_type& new_host(namespace_type& xns,
65  const poset_path& xhost_path,
66  const poset_path& xschema_path,
67  int xmax_db,
68  bool xauto_access);
69 
75  static host_type& new_host(namespace_type& xns,
76  const poset_path& xhost_path,
77  int xmax_db,
78  bool xauto_access);
79 
80 
81 protected:
82 
83 private:
84 
86 
87 
88  // ===========================================================
90  // ===========================================================
92 
93 public:
94 
99 
103  virtual ~structured_block();
104 
105 protected:
106 
111  virtual void init_handle_data_members();
112 
117 
121  void refine_coordinate(chart_point_coord_type& xcoord,
122  scoped_index::pod_type& xchart_id,
123  size_type xchart_id_ub) const;
124 
125  static inline double TOLERANCE()
126  {
127  static const double result = 10.0*std::numeric_limits<double>::epsilon();
128  return result;
129  };
130 
134  static inline bool is_close_enough(double x1, double x2)
135  {
136  return (std::fabs(x2 - x1) <= TOLERANCE());
137  };
138 
139 private:
140 
142 
143 
144  // ===========================================================
146  // ===========================================================
148 
149 public:
150 
155 
160  chart_point* refine_point(const chart_point& xpt) const;
161 
166  virtual void refine_point_pa(const chart_point& xpt, chart_point& result) const = 0;
167 
174  virtual void refine_point_pa(const chart_point& xpt,
175  block<chart_point_3d>& result) const = 0;
176 
181  chart_point* unrefine_point(const chart_point& xpt) const;
182 
187  virtual void unrefine_point_pa(const chart_point& xpt, chart_point& result) const = 0;
188 
193  virtual void refine() = 0;
194 
199  virtual void unrefine() = 0;
200 
205  virtual void simplify() = 0;
206 
211  virtual void unsimplify() = 0;
212 
213 protected:
214 
215 private:
216 
218 
219 
220  // ===========================================================
222  // ===========================================================
224 
225 public:
226 
227 protected:
228 
229 private:
230 
232 
233 
234  // ===========================================================
236  // ===========================================================
238 
239 public:
240 
241 protected:
242 
243 private:
244 
246 
247 
248  // ===========================================================
250  // ===========================================================
252 
253 public:
254 
255 protected:
256 
257 private:
258 
260 
261 
262  // ===========================================================
264  // ===========================================================
266 
267 public:
268 
272  virtual structured_block* clone() const = 0;
273 
279  inline structured_block* clone(bool xnew_state, bool xauto_access = true) const
280  {
281  return static_cast<structured_block*>(homogeneous_block::clone(xnew_state, xauto_access));
282  }
283 
284 protected:
285 
286 private:
287 
289 
290 
291  // ===========================================================
293  // ===========================================================
295 
296 public:
297 
302  {
303  return static_cast<structured_block*>(base_space_member::greatest_jem());
304  };
305 
309  inline structured_block* least_jem() const
310  {
311  return static_cast<structured_block*>(base_space_member::least_jem());
312  };
313 
314 protected:
315 
316 private:
317 
319 
320 
321  // ===========================================================
323  // ===========================================================
325 
326 public:
327 
333  {
334  return static_cast<structured_block*>(base_space_member::p_join(other));
335  };
336 
342  {
343  return static_cast<structured_block*>(base_space_member::p_meet(other));
344  };
345 
346 protected:
347 
348 private:
349 
351 
352 
353  // ===========================================================
355  // ===========================================================
357 
358 public:
359 
365  inline structured_block* l_join(abstract_poset_member* other, bool xnew_jem = true)
366  {
367  return static_cast<structured_block*>(base_space_member::l_join(other, xnew_jem));
368  };
369 
375  inline structured_block* l_meet(abstract_poset_member* other, bool xnew_jem = true)
376  {
377  return static_cast<structured_block*>(base_space_member::l_meet(other, xnew_jem));
378  };
379 
385  inline structured_block* l_not(bool xnew_jem = true) const
386  {
387  return static_cast<structured_block*>(base_space_member::l_not(xnew_jem));
388  };
389 
390 protected:
391 
392 private:
393 
395 
396 
397  // ===========================================================
399  // ===========================================================
401 
402 public:
403 
407  virtual bool invariant() const;
408 
412  virtual bool is_ancestor_of(const any* other) const;
413 
417  virtual structured_block& operator=(const abstract_poset_member& xother);
418 
422  structured_block& operator=(const structured_block& xother);
423 
424 protected:
425 
426 private:
427 
429 };
430 
431 //==============================================================================
432 // NON-MEMBER FUNCTIONS
433 //==============================================================================
434 
439 SHEAF_DLL_SPEC size_t deep_size(const structured_block& x0, bool xinclude_shallow = true);
440 
441 
442 } // namespace fiber_bundle
443 
444 
445 #endif // STRUCTURED_BLOCK_H
double chart_point_coord_type
The type of local coordinate in the base space; the scalar type for the local coordinate vector space...
Definition: fiber_bundle.h:57
base_space_member * p_join(abstract_poset_member *other) const
poset join of this with other, auto-, pre-, and self-allocated versions the poset join is the least u...
index_space_handle * _elements_id_space
The client id space for the elements subposet.
base_space_member * l_join(abstract_poset_member *other, bool xnew_jem=true)
lattice join of this with other, auto-, pre-, and self-allocated versions the lattice join is the lea...
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
virtual homogeneous_block * clone() const =0
Make a new handle, no state instance of current.
structured_block * greatest_jem() const
The largest member which is join-equivalent to this.
A point in chart space.
Definition: chart_point.h:52
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
structured_block * least_jem() const
The smallest member which is join-equivalent to this.
base_space_member * least_jem() const
The smallest member which is join-equivalent to this.
structured_block * l_join(abstract_poset_member *other, bool xnew_jem=true)
lattice join of this with other, auto-, pre-, and self-allocated versions the lattice join is the lea...
base_space_member * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
structured_block * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
A client handle for a base space member which represents a homgeneous collection of local cells...
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...
structured_block * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of this with other, auto-, pre-, and self-allocated versions the lattice meet is the gre...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
static bool is_close_enough(double x1, double x2)
True if x2 is close enough to x1 to be considered equal.
A client handle for a base space member which represents a homgeneous collection of local cells...
base_space_member * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-, pre-, and self-allocated versions the poset meet is the greates...
SHEAF_DLL_SPEC void fabs(const sec_at0 &x0, sec_at0 &xresult, bool xauto_access)
Compute fabs of x0 (fabs(x0)) (pre-allocated version).
Definition: sec_at0.cc:1331
base_space_member * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of this with other, auto-, pre-, and self-allocated versions the lattice meet is the gre...
structured_block * clone(bool xnew_state, bool xauto_access=true) const
Make a new handle instance of current. Attach the new instance to a new state if xnew_state is true...
pod_index_type pod_type
The "plain old data" storage type for this.
Definition: scoped_index.h:128
structured_block * p_join(abstract_poset_member *other) const
poset join of this with other, auto-, pre-, and self-allocated versions the poset join is the least u...
Namespace for the sheaves component of the sheaf system.
base_space_member * greatest_jem() const
The largest member which is join-equivalent to this.
An abstract client handle for a member of a poset.
structured_block * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-, pre-, and self-allocated versions the poset meet is the greates...
An auto_block with a no-initialization initialization policy.
Namespace for the fiber_bundles component of the sheaf system.