SheafSystem  0.0.0.0
structured_block_2d.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 STRUCTURED_Block_2d
19 
20 #ifndef STRUCTURED_BLOCK_2D_H
21 #define STRUCTURED_BLOCK_2D_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef STRUCTURED_BLOCK_H
28 #include "SheafSystem/structured_block.h"
29 #endif
30 
31 #ifndef STRUCTURED_BLOCK_2D_CRG_INTERVAL_H
32 #include "SheafSystem/structured_block_2d_crg_interval.h"
33 #endif
34 
35 #ifndef CHART_POINT_2D_H
36 #include "SheafSystem/chart_point_2d.h"
37 #endif
38 
39 namespace fiber_bundle
40 {
41 
42 using namespace sheaf;
43 
48 class SHEAF_DLL_SPEC structured_block_2d : public structured_block
49 {
50 
52 
53  // ===========================================================
55  // ===========================================================
57 
58 public:
59 
63  static const poset_path& static_prototype_path();
64 
69  static host_type& new_host(namespace_type& xns,
70  const poset_path& xhost_path,
71  const poset_path& xschema_path,
72  bool xauto_access);
73 
80  static host_type& standard_host(namespace_type& xns, const poset_path& xhost_path, bool xauto_access);
81 
82 protected:
83 
84 private:
85 
87 
88 
89  // ===========================================================
91  // ===========================================================
93 
94 public:
95 
100 
107  explicit structured_block_2d(const abstract_poset_member& xother,
108  bool xnew_jem = false);
109 
113  virtual ~structured_block_2d();
114 
115  // NEW HANDLE, NEW STATE CONSTRUCTORS:
116 
122  structured_block_2d(poset* xhost,
123  const size_type& xi_size,
124  const size_type& xj_size,
125  bool xauto_access);
126 
127  // NEW HANDLE, EXISTING STATE CONSTRUCTORS:
128 
133  structured_block_2d(const poset* xhost, pod_index_type xhub_id);
134 
139  structured_block_2d(const poset* xhost, const scoped_index& xid);
140 
145  structured_block_2d(const poset* xhost, const std::string& xname);
146 
151  structured_block_2d(const namespace_poset* xnamespace,
152  const poset_path& xpath,
153  bool xauto_access = true);
154 
159  structured_block_2d(const namespace_poset* xnamespace,
160  pod_index_type xposet_id,
161  pod_index_type xmember_id);
162 
167  structured_block_2d(const namespace_poset* xnamespace,
168  const scoped_index& xposet_id,
169  const scoped_index& xmember_id);
170 
171 
172  // EXISTING HANDLE, NEW STATE "CONSTRUCTORS":
173 
179  void new_state(const size_type& xi_size, const size_type& xj_size,
180  bool xauto_access = true);
181 
187  void new_state(poset* xhost, const size_type& xi_size,
188  const size_type& xj_size, bool xauto_access = true);
189 
190  // FEATURES:
191 
197  enum static_const_int {DB = 2};
198 
203  size_type i_size() const;
204 
209  size_type j_size() const;
210 
211 protected:
212 
213 // ///
214 // /// The type of row dof tuple for this.
215 // ///
216 // struct SHEAF_DLL_SPEC row_dof_tuple_type
217 // {
218 // ///
219 // /// The base space dimension.
220 // ///
221 // int db;
222 
223 // ///
224 // /// The cell type id.
225 // ///
226 // int type_id;
227 
228 // ///
229 // /// The cell type name.
230 // ///
231 // const char* type_name;
232 
233 // ///
234 // /// The refinement depth.
235 // ///
236 // int refinement_depth;
237 
238 // ///
239 // /// The local cell type id.
240 // ///
241 // int local_cell_type_id;
242 
243 // ///
244 // /// The local cell type name.
245 // ///
246 // const char * local_cell_type_name;
247 
248 // ///
249 // /// The number of local cell instances in this block.
250 // ///
251 // size_type size;
252 
253 // ///
254 // /// The upper bound for index 0.
255 // ///
256 // size_type i_size;
257 
258 // ///
259 // /// The upper bound for index 1.
260 // ///
261 // size_type j_size;
262 // };
263 
264 
265 // ///
266 // /// The row dof tuple for this.
267 // ///
268 // inline row_dof_tuple_type* row_dof_tuple()
269 // {
270 // return reinterpret_cast<row_dof_tuple_type*>(dof_map().dof_tuple());
271 // };
272 
274 
278  static scoped_index
279  new_row_dof_map(poset_state_handle& xhost,
280  size_type xi_size,
281  size_type xj_size,
282  bool xauto_access);
283 
284 
285 private:
286 
290  inline pod_index_type offset(pod_index_type i, pod_index_type j) const
291  {
292  return (i *= j_size()) += j;
293  };
294 
296 
297 
298  // ===========================================================
300  // ===========================================================
302 
303 public:
304 
305 protected:
306 
307 private:
308 
310 
311 
312  // ===========================================================
314  // ===========================================================
316 
317 public:
318 
324  {
325  return reinterpret_cast<chart_point_2d*>(structured_block::refine_point(xpt));
326  };
327 
332  virtual void refine_point_pa(const chart_point& xpt, chart_point& result) const;
333 
340  virtual void refine_point_pa(const chart_point& xpt,
341  block<chart_point_3d>& result) const;
342 
348  {
349  return reinterpret_cast<chart_point_2d*>(structured_block::unrefine_point(xpt));
350  };
351 
356  virtual void unrefine_point_pa(const chart_point& xpt, chart_point& result) const;
357 
362  virtual void refine();
363 
368  virtual void unrefine();
369 
374  virtual void simplify();
375 
380  virtual void unsimplify();
381 
382 protected:
383 
384 private:
385 
387 
388 
389  // ===========================================================
391  // ===========================================================
393 
394 public:
395 
399  static const poset_path& static_local_cell_prototype_path();
400 
401 protected:
402 
406  virtual const structured_block_2d_crg_interval& interval() const;
407 
408 private:
409 
411 
412 
413  // ===========================================================
415  // ===========================================================
417 
418 public:
419 
420 protected:
421 
422 private:
423 
425 
426 
427  // ===========================================================
429  // ===========================================================
431 
432 public:
433 
434 protected:
435 
436 private:
437 
439 
440 
441  // ===========================================================
443  // ===========================================================
445 
446 public:
447 
451  virtual structured_block_2d* clone() const;
452 
458  inline structured_block_2d* clone(bool xnew_state, bool xauto_access = true) const
459  {
460  return static_cast<structured_block_2d*>(structured_block::clone(xnew_state, xauto_access));
461  };
462 
463 protected:
464 
465 private:
466 
468 
469 
470  // ===========================================================
472  // ===========================================================
474 
475 public:
476 
481  {
483  };
484 
489  {
490  return static_cast<structured_block_2d*>(base_space_member::least_jem());
491  };
492 
493 protected:
494 
495 private:
496 
498 
499 
500  // ===========================================================
502  // ===========================================================
504 
505 public:
506 
512  {
513  return static_cast<structured_block_2d*>(base_space_member::p_join(other));
514  };
515 
521  {
522  return static_cast<structured_block_2d*>(base_space_member::p_meet(other));
523  };
524 
525 protected:
526 
527 private:
528 
530 
531 
532  // ===========================================================
534  // ===========================================================
536 
537 public:
538 
544  inline structured_block_2d* l_join(abstract_poset_member* other, bool xnew_jem = true)
545  {
546  return static_cast<structured_block_2d*>(base_space_member::l_join(other, xnew_jem));
547  };
548 
554  inline structured_block_2d* l_meet(abstract_poset_member* other, bool xnew_jem = true)
555  {
556  return static_cast<structured_block_2d*>(base_space_member::l_meet(other, xnew_jem));
557  };
558 
564  inline structured_block_2d* l_not(bool xnew_jem = true) const
565  {
566  return static_cast<structured_block_2d*>(base_space_member::l_not(xnew_jem));
567  };
568 
569 protected:
570 
571 private:
572 
574 
575 
576  // ===========================================================
578  // ===========================================================
580 
581 public:
582 
586  virtual bool invariant() const;
587 
591  virtual bool is_ancestor_of(const any* other) const;
592 
596  virtual structured_block_2d& operator=(const abstract_poset_member& xother);
597 
601  structured_block_2d& operator=(const structured_block_2d& xother);
602 
603 protected:
604 
605 private:
606 
608 };
609 
610 } // namespace fiber_bundle
611 
612 #endif // STRUCTURED_BLOCK_2D_H
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_2d * 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...
structured_block_2d * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
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 homogeneous collection of connected quads arranged in an i_size() x j_size() array.
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.
structured_block_2d * greatest_jem() const
The largest member which is join-equivalent to this.
structured_block_2d * 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...
Emulator for a interval of implicit base space members representing a 2 dimensional structured block...
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...
static_const_int
The dimension of this block; static const version.
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_2d * 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 index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
structured_block_2d * least_jem() const
The smallest member which is join-equivalent to this.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
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...
chart_point_2d * 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...
structured_block_2d * 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_2d * 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...
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...
A point in a 2D chart space.
chart_point * 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...
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.
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.
chart_point_2d * 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...
An auto_block with a no-initialization initialization policy.
Namespace for the fiber_bundles component of the sheaf system.