SheafSystem  0.0.0.0
mesh_partition.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 mesh_partition
19 
20 #ifndef MESH_PARTITION_H
21 #define MESH_PARTITION_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef ANY_H
28 #include "SheafSystem/any.h"
29 #endif
30 
31 #ifndef BASE_SPACE_POSET_H
32 #include "SheafSystem/base_space_poset.h"
33 #endif
34 
35 #ifndef STD_STRING_H
36 #include "SheafSystem/std_string.h"
37 #endif
38 
39 namespace sheaf
40 {
41 class id_block;
42 }
43 
44 namespace fiber_bundle
45 {
46 
47  using namespace sheaf;
48 
55 class SHEAF_DLL_SPEC mesh_partition : public any
56 {
57 
58 public:
59 
60  // =============================================================================
61  // MESH_PARTITION FACET
62  // =============================================================================
63 
68 
72  mesh_partition(const mesh_partition& xother);
73 
77  virtual ~mesh_partition();
78 
82  mesh_partition(const base_space_poset& xmesh, const std::string& xname);
83 
87  const std::string& name() const;
88 
92  const base_space_poset& mesh() const;
93 
97  const subposet& parts() const;
98 
102  int part_ct() const;
103 
107  string part_name(const scoped_index& xp_id) const;
108 
112  void part(const scoped_index& xp_id, id_block& xresult) const;
113 
117  const scoped_index& put_part(const scoped_index& xp_id, id_block& xzones);
118 
122  pod_index_type part_id(const std::string& xname) const;
123 
127  static bool is_valid_name(const std::string& xname);
128 
132  static string name_prefix();
133 
134  // =============================================================================
135  // ANY FACET
136  // =============================================================================
137 
141  virtual bool is_ancestor_of(const any* other) const;
142 
147  virtual mesh_partition* clone() const;
148 
152  mesh_partition& operator=(const mesh_partition& xother);
153 
157  virtual bool invariant() const;
158 
159 private:
160 
164  string _name;
165 
169  base_space_poset* _mesh;
170 
174  subposet _parts;
175 
179  int _part_ct;
180 
184  void initialize_parts_set();
185 
186 };
187 
188 // =============================================================================
189 // NON-MEMBER FUNCTIONS
190 // =============================================================================
191 
192 } // namespace fiber_bundle
193 
194 
195 #endif // ifndef MESH_PARTITION_H
A client handle for a subposet.
Definition: subposet.h:86
A decomposition of a mesh into non-overlapping scopes.
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
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.
Namespace for the fiber_bundles component of the sheaf system.
A block of ids all in the same id space.
Definition: id_block.h:48