SheafSystem  0.0.0.0
unstructured_block.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 UNSTRUCTURED_BLOCK
19 
20 #ifndef UNSTRUCTURED_BLOCK_H
21 #define UNSTRUCTURED_BLOCK_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef HOMOGENEOUS_BLOCK_H
28 #include "SheafSystem/homogeneous_block.h"
29 #endif
30 
31 namespace fiber_bundle
32 {
33 
34  using namespace sheaf;
35 
36 class unstructured_block_builder;
37 
43 // to create the host poset for instances of this class.
45 class SHEAF_DLL_SPEC unstructured_block : public homogeneous_block
46 {
47 
48  friend class unstructured_block_builder;
49 
50 public:
51 
52  // ===========================================================
53  // HOST FACTORY FACET
54  // ===========================================================
55 
59  static const poset_path& static_prototype_path();
60 
65  static host_type& new_host(namespace_type& xns,
66  const poset_path& xhost_path,
67  const poset_path& xschema_path,
68  int xmax_db,
69  bool xauto_access);
70 
77  static host_type& standard_host(namespace_type& xns,
78  const poset_path& xhost_path,
79  int xmax_db,
80  bool xauto_access);
81 
82 
83  // ===========================================================
84  // ANY FACET
85  // ===========================================================
86 
90  virtual bool invariant() const;
91 
95  virtual bool is_ancestor_of(const any* other) const;
96 
100  virtual unstructured_block& operator=(const abstract_poset_member& xother);
101 
105  unstructured_block& operator=(const unstructured_block& xother);
106 
107  // ===========================================================
108  // ABSTRACT POSET MEMBER FACET
109  // ===========================================================
110 
114  virtual unstructured_block* clone() const;
115 
121  inline unstructured_block* clone(bool xnew_state, bool xauto_access = true) const
122  {
123  return static_cast<unstructured_block*>(homogeneous_block::clone(xnew_state, xauto_access));
124  }
125 
126  // ===========================================================
127  // ORDERING RELATION FACET
128  // ===========================================================
129 
134  {
135  return static_cast<unstructured_block*>(homogeneous_block::greatest_jem());
136  };
137 
142  {
143  return static_cast<unstructured_block*>(homogeneous_block::least_jem());
144  };
145 
146 
147  // ===========================================================
148  // POSET ALGEBRA FACET
149  // ===========================================================
150 
156  {
157  return static_cast<unstructured_block*>(homogeneous_block::p_join(other));
158  };
159 
165  {
166  return static_cast<unstructured_block*>(homogeneous_block::p_meet(other));
167  };
168 
169 
170  // ===========================================================
171  // LATTICE ALGEBRA FACET
172  // ===========================================================
173 
179  inline unstructured_block* l_join(abstract_poset_member* other, bool xnew_jem = true)
180  {
181  return static_cast<unstructured_block*>(homogeneous_block::l_join(other, xnew_jem));
182  };
183 
189  inline unstructured_block* l_meet(abstract_poset_member* other, bool xnew_jem = true)
190  {
191  return static_cast<unstructured_block*>(homogeneous_block::l_meet(other, xnew_jem));
192  };
193 
199  inline unstructured_block* l_not(bool xnew_jem = true) const
200  {
201  return static_cast<unstructured_block*>(homogeneous_block::l_not(xnew_jem));
202  };
203 
204 
205  // ===========================================================
206  // UNSTRUCTURED_BLOCK FACET
207  // ===========================================================
208 
214  enum static_const_int {DB = -1};
215 
216  // ===========================================================
217  // CANONICAL CONSTRUCTORS
218  // ===========================================================
219 
224 
231  explicit unstructured_block(const abstract_poset_member& xother,
232  bool xnew_jem = false);
233 
237  virtual ~unstructured_block();
238 
239  // ===========================================================
240  // NEW HANDLE, NEW STATE CONSTRUCTORS
241  // ===========================================================
242 
250  //*/
251  unstructured_block(poset* xhost,
252  const std::string& xlocal_cell_prototype_name,
253  bool xis_prototype_name,
254  bool xauto_access);
255 
262  unstructured_block(poset* xhost,
263  const poset_path& xlocal_cell_prototype_path,
264  const scoped_index* xids,
265  int xub,
266  bool xauto_access);
267 
268 
274  unstructured_block(poset* xhost,
275  const base_space_member& xlocal_cell_prototype,
276  const scoped_index* xids,
277  int xub,
278  bool xauto_access);
279 
286  unstructured_block(poset* xhost,
287  const poset_path& xlocal_cell_prototype_path,
288  const pod_index_type* xids,
289  int xub,
290  bool xauto_access);
291 
292 
298  unstructured_block(poset* xhost,
299  const base_space_member& xlocal_cell_prototype,
300  const pod_index_type* xids,
301  int xub,
302  bool xauto_access);
303 
311  unstructured_block(poset* xhost,
312  const poset_path& xlocal_cell_prototype_path,
313  const size_type& xi_size,
314  bool xauto_access = true);
315 
316 
323  unstructured_block(poset* xhost,
324  const base_space_member& xlocal_cell_prototype,
325  const size_type& xi_size,
326  bool xauto_access = true);
327 
335  unstructured_block(poset* xhost,
336  const poset_path& xlocal_cell_prototype_path,
337  const size_type& xi_size,
338  const size_type& xj_size,
339  bool xauto_access = true);
340 
341 
349  unstructured_block(poset* xhost,
350  const base_space_member& xlocal_cell_prototype,
351  const size_type& xi_size,
352  const size_type& xj_size,
353  bool xauto_access = true);
354 
362  unstructured_block(poset* xhost,
363  const poset_path& xlocal_cell_prototype_path,
364  const size_type& xi_size,
365  const size_type& xj_size,
366  const size_type& xk_size,
367  bool xauto_access = true);
368 
369 
377  unstructured_block(poset* xhost,
378  const base_space_member& xlocal_cell_prototype,
379  const size_type& xi_size,
380  const size_type& xj_size,
381  const size_type& xk_size,
382  bool xauto_access = true);
383 
384 
385  // ===========================================================
386  // NEW HANDLE, EXISTING STATE CONSTRUCTORS
387  // ===========================================================
388 
393  unstructured_block(const poset* xhost, scoped_index xindex);
394 
399  unstructured_block(const poset* xhost, const std::string& xname);
400 
405  unstructured_block(const namespace_poset* xnamespace,
406  const poset_path& xpath,
407  bool xauto_access = true);
408 
413  unstructured_block(const namespace_poset* xnamespace,
414  const scoped_index& xposet_id,
415  const scoped_index& xmember_id);
416 
417  // ===========================================================
418  // EXISTING HANDLE, NEW STATE "CONSTRUCTORS"
419  // ===========================================================
420 
425  virtual void new_state(poset* xhost,
426  const std::string& xlocal_cell_prototype_name,
427  bool xauto_access);
428 
432  virtual void new_state(const poset_path& xlocal_cell_prototype_path,
433  const scoped_index* ids,
434  int xub,
435  bool xauto_access);
436 
440  virtual void new_state(const base_space_member& xlocal_cell_prototype,
441  const scoped_index* ids,
442  int xub,
443  bool xauto_access);
444 
448  virtual void new_state(poset* xhost,
449  const poset_path& xlocal_cell_prototype_path,
450  const scoped_index* ids,
451  int xub,
452  bool xauto_access);
453 
457  virtual void new_state(poset* xhost,
458  const base_space_member& xlocal_cell_prototype,
459  const scoped_index* ids,
460  int xub,
461  bool xauto_access);
462 
466  virtual void new_state(const poset_path& xlocal_cell_prototype_path,
467  const pod_index_type* ids,
468  int xub,
469  bool xauto_access);
470 
474  virtual void new_state(const base_space_member& xlocal_cell_prototype,
475  const pod_index_type* ids,
476  int xub,
477  bool xauto_access);
478 
482  virtual void new_state(poset* xhost,
483  const poset_path& xlocal_cell_prototype_path,
484  const pod_index_type* ids,
485  int xub,
486  bool xauto_access);
487 
491  virtual void new_state(poset* xhost,
492  const base_space_member& xlocal_cell_prototype,
493  const pod_index_type* ids,
494  int xub,
495  bool xauto_access);
496 
500  virtual void new_state(const poset_path& xlocal_cell_prototype_path,
501  const size_type& xi_size,
502  bool xauto_access);
503 
507  virtual void new_state(const base_space_member& xlocal_cell_prototype,
508  const size_type& xi_size,
509  bool xauto_access);
510 
514  virtual void new_state(poset* xhost,
515  const poset_path& xlocal_cell_prototype_path,
516  const size_type& xi_size,
517  bool xauto_access);
518 
522  virtual void new_state(poset* xhost,
523  const base_space_member& xlocal_cell_prototype,
524  const size_type& xi_size,
525  bool xauto_access);
526 
527 
531  virtual void new_state(const poset_path& xlocal_cell_prototype_path,
532  const size_type& xi_size,
533  const size_type& xj_size,
534  bool xauto_access);
535 
539  virtual void new_state(const base_space_member& xlocal_cell_prototype,
540  const size_type& xi_size,
541  const size_type& xj_size,
542  bool xauto_access);
543 
547  virtual void new_state(poset* xhost,
548  const poset_path& xlocal_cell_prototype_path,
549  const size_type& xi_size,
550  const size_type& xj_size,
551  bool xauto_access);
552 
556  virtual void new_state(poset* xhost,
557  const base_space_member& xlocal_cell_prototype,
558  const size_type& xi_size,
559  const size_type& xj_size,
560  bool xauto_access);
561 
565  virtual void new_state(const poset_path& xlocal_cell_prototype_path,
566  const size_type& xi_size,
567  const size_type& xj_size,
568  const size_type& xk_size,
569  bool xauto_access);
570 
574  virtual void new_state(const base_space_member& xlocal_cell_prototype,
575  const size_type& xi_size,
576  const size_type& xj_size,
577  const size_type& xk_size,
578  bool xauto_access);
579 
583  virtual void new_state(poset* xhost,
584  const poset_path& xlocal_cell_prototype_path,
585  const size_type& xi_size,
586  const size_type& xj_size,
587  const size_type& xk_size,
588  bool xauto_access);
589 
593  virtual void new_state(poset* xhost,
594  const base_space_member& xlocal_cell_prototype,
595  const size_type& xi_size,
596  const size_type& xj_size,
597  const size_type& xk_size,
598  bool xauto_access);
599 
600  // ===========================================================
601  // ROW DOFS
602  // ===========================================================
603 
604  // ===========================================================
605  // OTHER FEATURES
606  // ===========================================================
607 
613  void refine(const poset_path& xlocal_cell_prototype_path,
614  const scoped_index* ids,
615  int xub,
616  bool xauto_access);
617 
623  void refine(const base_space_member& xlocal_cell_prototype,
624  const scoped_index* ids,
625  int xub,
626  bool xauto_access);
627 
632  static bool host_created_with_new_host(const poset_state_handle& xhost);
633 
637  static void make_standard_subposets_persistent(poset_state_handle& xhost);
638 
639 protected:
640 
641 private:
642 
643 };
644 
645 } // namespace fiber_bundle
646 
647 #endif // UNSTRUCTURED_BLOCK_H
OBSOLETE: use zone_nodes_block or point_block_*d. A builder object for constructing unstructured bloc...
homogeneous_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...
homogeneous_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...
unstructured_block * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
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...
homogeneous_block * least_jem() const
The smallest member which is join-equivalent to this.
homogeneous_block * greatest_jem() const
The largest member which is join-equivalent to this.
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
virtual homogeneous_block * clone() const =0
Make a new handle, no state instance of current.
OBSOLETE: use zone_nodes_block or point_block_*d. A client handle for a base space member which repre...
A client handle for a member of a base space poset.
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...
unstructured_block * greatest_jem() const
The largest member which is join-equivalent to this.
homogeneous_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 mutable partially ordered set.
Definition: poset.h:40
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
A client handle for a base space member which represents a homgeneous collection of local cells...
unstructured_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...
homogeneous_block * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of thisposet with other, auto-, pre-, and self-allocated versions the lattice meet is th...
unstructured_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...
homogeneous_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...
unstructured_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...
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.
unstructured_block * least_jem() const
The smallest member which is join-equivalent to this.
An abstract client handle for a member of a poset.
unstructured_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...
Namespace for the fiber_bundles component of the sheaf system.
static_const_int
The dimension of this block; static const version.
unstructured_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...