SheafSystem  0.0.0.0
structured_block_3d.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_3D_H
22 #define STRUCTURED_BLOCK_3D_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef STRUCTURED_BLOCK_H
29 #include "SheafSystem/structured_block.h"
30 #endif
31 
32 #ifndef STRUCTURED_BLOCK_3D_CRG_INTERVAL_H
33 #include "SheafSystem/structured_block_3d_crg_interval.h"
34 #endif
35 
36 #ifndef CHART_POINT_3D_H
37 #include "SheafSystem/chart_point_3d.h"
38 #endif
39 
40 namespace fiber_bundle
41 {
42 
47 class SHEAF_DLL_SPEC structured_block_3d : public structured_block
48 {
49 
51 
52  // ===========================================================
54  // ===========================================================
56 
57 public:
58 
62  static const poset_path& static_prototype_path();
63 
68  static host_type& new_host(namespace_type& xns,
69  const poset_path& xhost_path,
70  const poset_path& xschema_path,
71  bool xauto_access);
72 
79  static host_type& standard_host(namespace_type& xns, const poset_path& xhost_path, bool xauto_access);
80 
81 protected:
82 
83 private:
84 
86 
87 
88  // ===========================================================
90  // ===========================================================
92 
93 public:
94 
99 
106  explicit structured_block_3d(const abstract_poset_member& xother,
107  bool xnew_jem = false);
108 
112  virtual ~structured_block_3d();
113 
114  // NEW HANDLE, NEW STATE CONSTRUCTORS:
115 
121  structured_block_3d(poset* xhost,
122  const size_type& xi_size,
123  const size_type& xj_size,
124  const size_type& xk_size,
125  bool xauto_access = true);
126 
127  // NEW HANDLE, EXISTING STATE CONSTRUCTORS:
128 
133  structured_block_3d(const poset* xhost, pod_index_type xhub_id);
134 
139  structured_block_3d(const poset* xhost, const scoped_index& xid);
140 
145  structured_block_3d(const poset* xhost, const std::string& xname);
146 
151  structured_block_3d(const namespace_poset* xnamespace,
152  const poset_path& xpath,
153  bool xauto_access = true);
154 
159  structured_block_3d(const namespace_poset* xnamespace,
160  const scoped_index& xposet_id,
161  const scoped_index& xmember_id);
162 
167  structured_block_3d(const namespace_poset* xnamespace,
168  pod_index_type xposet_id,
169  pod_index_type xmember_id);
170 
171 
172  // EXISTING HANDLE, NEW STATE "CONSTRUCTORS":
173 
179  void new_state(const size_type& xi_size,
180  const size_type& xj_size,
181  const size_type& xk_size,
182  bool xauto_access = true);
183 
189  void new_state(poset* xhost,
190  const size_type& xi_size,
191  const size_type& xj_size,
192  const size_type& xk_size,
193  bool xauto_access = true);
194 
195 
196  // FEATURES:
197 
203  enum static_const_int {DB = 3};
204 
209  size_type i_size() const;
210 
215  size_type j_size() const;
216 
221  size_type k_size() const;
222 
223 protected:
224 
225 // ///
226 // /// The type of row dof tuple for this.
227 // ///
228 // struct SHEAF_DLL_SPEC row_dof_tuple_type
229 // {
230 // ///
231 // /// The base space dimension.
232 // ///
233 // int db;
234 
235 // ///
236 // /// The cell type id.
237 // ///
238 // int type_id;
239 
240 // ///
241 // /// The cell type name.
242 // ///
243 // const char* type_name;
244 
245 // ///
246 // /// The refinement depth.
247 // ///
248 // int refinement_depth;
249 
250 // ///
251 // /// The local cell type id.
252 // ///
253 // int local_cell_type_id;
254 
255 // ///
256 // /// The local cell type name.
257 // ///
258 // const char * local_cell_type_name;
259 
260 // ///
261 // /// The number of local cell instances in this block.
262 // ///
263 // size_type size;
264 
265 // ///
266 // /// The upper bound for index 0.
267 // ///
268 // size_type i_size;
269 
270 // ///
271 // /// The upper bound for index 1.
272 // ///
273 // size_type j_size;
274 
275 // ///
276 // /// The upper bound for index 2.
277 // ///
278 // size_type k_size;
279 // };
280 
281 // ///
282 // /// The row dof tuple for this.
283 // ///
284 // inline row_dof_tuple_type* row_dof_tuple()
285 // {
286 // return reinterpret_cast<row_dof_tuple_type*>(dof_map().dof_tuple());
287 // };
288 
290 
294  static scoped_index
295  new_row_dof_map(poset_state_handle& xhost,
296  size_type xi_size,
297  size_type xj_size,
298  size_type xk_size,
299  bool xauto_access);
300 
301 private:
302 
306  inline pod_index_type offset(pod_index_type i,
307  pod_index_type j,
308  pod_index_type k) const
309  {
310  return (i *= j_size()) += j;
311  };
312 
314 
315 
316  // ===========================================================
318  // ===========================================================
320 
321 public:
322 
323 protected:
324 
325 private:
326 
328 
329 
330  // ===========================================================
332  // ===========================================================
334 
335 public:
336 
342  {
343  return reinterpret_cast<chart_point_3d*>(structured_block::refine_point(xpt));
344  };
345 
350  virtual void refine_point_pa(const chart_point& xpt, chart_point& result) const;
351 
358  virtual void refine_point_pa(const chart_point& xpt,
359  block<chart_point_3d>& result) const;
360 
366  {
367  return reinterpret_cast<chart_point_3d*>(structured_block::refine_point(xpt));
368  };
369 
374  virtual void unrefine_point_pa(const chart_point& xpt, chart_point& result) const;
375 
380  virtual void refine();
381 
386  virtual void unrefine();
387 
392  virtual void simplify();
393 
398  virtual void unsimplify();
399 
400 protected:
401 
402 private:
403 
405 
406 
407  // ===========================================================
409  // ===========================================================
411 
412 public:
413 
417  static const poset_path& static_local_cell_prototype_path();
418 
419 protected:
420 
424  virtual const structured_block_3d_crg_interval& interval() const;
425 
426 private:
427 
429 
430 
431  // ===========================================================
433  // ===========================================================
435 
436 public:
437 
438 protected:
439 
440 private:
441 
443 
444 
445  // ===========================================================
447  // ===========================================================
449 
450 public:
451 
452 protected:
453 
454 private:
455 
457 
458 
459  // ===========================================================
461  // ===========================================================
463 
464 public:
465 
469  virtual structured_block_3d* clone() const;
470 
476  inline structured_block_3d* clone(bool xnew_state, bool xauto_access = true) const
477  {
478  return static_cast<structured_block_3d*>(structured_block::clone(xnew_state, xauto_access));
479  };
480 
481 protected:
482 
483 private:
484 
486 
487 
488  // ===========================================================
490  // ===========================================================
492 
493 public:
494 
499  {
501  };
502 
507  {
508  return static_cast<structured_block_3d*>(base_space_member::least_jem());
509  };
510 
511 
512  // ===========================================================
514  // ===========================================================
516 
517 public:
518 
524  {
525  return static_cast<structured_block_3d*>(base_space_member::p_join(other));
526  };
527 
533  {
534  return static_cast<structured_block_3d*>(base_space_member::p_meet(other));
535  };
536 
537 protected:
538 
539 private:
540 
542 
543 
544  // ===========================================================
546  // ===========================================================
548 
549 public:
550 
556  inline structured_block_3d* l_join(abstract_poset_member* other, bool xnew_jem = true)
557  {
558  return static_cast<structured_block_3d*>(base_space_member::l_join(other, xnew_jem));
559  };
560 
566  inline structured_block_3d* l_meet(abstract_poset_member* other, bool xnew_jem = true)
567  {
568  return static_cast<structured_block_3d*>(base_space_member::l_meet(other, xnew_jem));
569  };
570 
576  inline structured_block_3d* l_not(bool xnew_jem = true) const
577  {
578  return static_cast<structured_block_3d*>(base_space_member::l_not(xnew_jem));
579  };
580 
581 protected:
582 
583 private:
584 
586 
587 
588  // ===========================================================
590  // ===========================================================
592 
593 public:
594 
598  virtual bool invariant() const;
599 
603  virtual bool is_ancestor_of(const any* other) const;
604 
608  virtual structured_block_3d& operator=(const abstract_poset_member& xother);
609 
613  structured_block_3d& operator=(const structured_block_3d& xother);
614 
615 protected:
616 
617 private:
618 
620  };
621 
622 } // namespace fiber_bundle
623 
624 #endif // STRUCTURED_BLOCK_3D_H
chart_point_3d * refine_point(const chart_point &xpt) const
The point in the direct refinement of this which is the same as xpt in this; auto-allocated version...
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...
structured_block_3d * 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...
chart_point * refine_point(const chart_point &xpt) const
A chart point in the direct refinement of this which is the same as xpt in this; auto-allocated versi...
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...
array_poset_dof_map * new_row_dof_map(const poset *xhost, const std::string &xprototype_name, const std::string &xlocal_cell_name, size_type xsize)
OBSOLETE: use scoped_index new_row_dof_map(poset_state_handle& ...) Creates a new row dof map and ini...
A point in a 3D chart space.
The default name space; a poset which contains other posets as members.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
A client handle for a general, abstract partially order set.
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
A point in chart space.
Definition: chart_point.h:52
base_space_member * least_jem() const
The smallest member which is join-equivalent to this.
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...
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...
Struct representing the closed interval [_begin, _end].
Definition: interval_set.h:48
A client handle for a mutable partially ordered set.
Definition: poset.h:40
structured_block_3d * 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...
structured_block_3d * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
chart_point_3d * unrefine_point(const chart_point &xpt) const
The point in this which is the same as xpt in the direct refinement of this; auto-allocated version...
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...
structured_block_3d * least_jem() const
The smallest member which is join-equivalent to this.
A homogeneous collection of connected hexahedra arranged in an i_size() x j_size() x k_size() array...
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_3d * 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...
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
static_const_int
The dimension of this block; static const version.
structured_block_3d * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-, pre-, and self-allocated versions the poset meet is the greates...
virtual structured_block * clone() const =0
Make a new handle, no state instance of current.
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_3d * 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...
An auto_block with a no-initialization initialization policy.
Emulator for a interval of implicit base space members representing a 3 dimensional structured block...
Namespace for the fiber_bundles component of the sheaf system.
structured_block_3d * greatest_jem() const
The largest member which is join-equivalent to this.