SheafSystem  0.0.0.0
sec_tuple.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 SEC_TUPLE_H
22 #define SEC_TUPLE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef SEC_REP_SPACE_MEMBER_H
29 #include "SheafSystem/sec_rep_space_member.h"
30 #endif
31 
32 #ifndef BLOCK_H
33 #include "SheafSystem/block.h"
34 #endif
35 
36 #ifndef TUPLE_H
37 #include "SheafSystem/tuple.h"
38 #endif
39 
40 namespace fiber_bundle
41 {
42 
43 class sec_tuple_space;
44 class fiber_bundles_namespace;
45 
46 //==============================================================================
47 // CLASS SEC_TUPLE
48 //==============================================================================
49 
53 class SHEAF_DLL_SPEC sec_tuple : public sec_rep_space_member
54 {
55 
56  // ===========================================================
58  // ===========================================================
60 
61 public:
62 
63  // Typedefs:
64 
69 
74 
78  typedef tuple fiber_type;
79 
84 
88  static const poset_path& standard_rep_path();
89 
95  template <typename S>
96  static poset_path standard_host_path(const poset_path& xbase_path,
97  const poset_path& xrep_path,
98  const std::string& xsection_suffix,
99  const std::string& xfiber_suffix);
100 
105  template <typename S>
106  static bool standard_host_is_available(const namespace_poset& xns,
107  const poset_path& xbase_path,
108  const poset_path& xrep_path,
109  const std::string& xsection_suffix,
110  const std::string& xfiber_suffix,
111  bool xauto_access);
112 
117  static host_type& new_host(namespace_type& xns,
118  const poset_path& xhost_path,
119  const poset_path& xschema_path,
120  bool xauto_access);
121 
122 protected:
123 
124 private:
125 
127 
128 
129  //============================================================================
131  //============================================================================
133 
134 
135 public:
136 
140  sec_tuple();
141 
146  sec_tuple(const sec_rep_space* xhost, pod_index_type xhub_id);
147 
152  sec_tuple(const sec_rep_space* xhost, const scoped_index& xid);
153 
158  sec_tuple(const sec_rep_space* xhost, const std::string& xname);
159 
164  sec_tuple(const namespace_poset* xnamespace,
165  const poset_path& xpath,
166  bool xauto_access = true);
167 
171  explicit sec_tuple(sec_rep_space_member* xother);
172 
176  sec_tuple(sec_rep_space* xhost,
177  section_dof_map* xdof_map = 0,
178  bool xauto_access = true);
179 
185  sec_tuple(sec_rep_space* xhost,
186  abstract_poset_member& xbase_mbr,
187  int xbase_version = CURRENT_HOST_VERSION,
188  bool xauto_access = true);
189 
193  virtual sec_tuple& operator=(const abstract_poset_member& xother);
194 
198  sec_tuple& operator=(const sec_tuple& xother);
199 
203  ~sec_tuple();
204 
208  virtual int factor_ct() const;
209 
213  int factor_ct(bool xauto_access) const;
214 
215 protected:
216 
217 private:
218 
220 
221 
222  //============================================================================
224  //============================================================================
226 
227 public:
228 
232  virtual const std::string& class_name() const;
233 
237  static const std::string& static_class_name();
238 
242  virtual sec_tuple* clone() const;
243 
249  inline sec_tuple* clone(bool xnew_state, bool xauto_access = true) const
250  {
251  return static_cast<sec_tuple*>(
252  sec_rep_space_member::clone(xnew_state, xauto_access));
253  }
254 
255 protected:
256 
257 private:
258 
260 
261 
262  // ===========================================================
264  // ===========================================================
266 
267 public:
268 
272  host_type* host() const;
273 
277  virtual bool host_is_ancestor_of(const poset_state_handle* other) const;
278 
279 protected:
280 
281 private:
282 
284 
285 
286  //============================================================================
288  //============================================================================
290 
291 public:
292 
297  bool fiber_is_ancestor_of(const any* xother) const;
298 
302  bool is_ancestor_of(const any* xother) const;
303 
307  bool invariant() const;
308 
310 
314  virtual void restrict_to(const abstract_poset_member* xschema);
315 
320  virtual void restrict_to(pod_index_type xbase_id,
321  pod_index_type xfiber_schema_id);
322 
327  virtual void restrict_to(const abstract_poset_member* xbase, const abstract_poset_member* xfiber_schema);
328 
333  virtual void restrict_to_same(const abstract_poset_member* xother);
334 
339  void unrestrict();
340 
344  scalar_type* comp(int i) const;
345 
349  void set_comp(int i, scalar_type* component);
350 
351  // STATE INTERFACE
352 
356  void detach_from_state();
357 
358 
359 protected:
360 
364  void attach_handle_data_members();
365 
370  inline static std::string create_fiber_name(const std::string& xname)
371  {
372  return xname + "_fiber";
373  }
374 
375 private:
376 
378 
379 };
380 
381 //==============================================================================
382 // NON-MEMBER FUNCTIONS
383 //==============================================================================
384 
389 SHEAF_DLL_SPEC size_t deep_size(const sec_tuple& x0, bool xinclude_shallow = true);
390 
391 } // namespace fiber_bundle
392 
393 #endif // ifndef SEC_TUPLE_H
394 
395 
sec_tuple scalar_type
The scalar type definition.
Definition: sec_tuple.h:83
A Cartesian product section space.
The abstract map from section dof ids to section dof values of heterogeneous type.
A section of a bundle with fiber type tuple.
Definition: sec_tuple.h:53
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 member of a sec_rep_space; a section.
Abstract base class with useful features for all objects.
Definition: any.h:39
virtual sec_rep_space_member * clone() const
Make a new handle, no state instance of current.
static std::string create_fiber_name(const std::string &xname)
Creates a fiber space name for sec class with name xname. Convenience method used by derived class "n...
Definition: sec_tuple.h:370
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
virtual void restrict_to(pod_index_type xbase_id, pod_index_type xfiber_schema_id)
Restricts this section to base with index xbase_id and fiber schema with index xfiber_schema_id.
fiber_bundles_namespace namespace_type
The type of namespace for this type of member.
Definition: sec_tuple.h:68
A member of a Cartesian product space; a tuple of attributes (persistent version).
Definition: tuple.h:191
tuple fiber_type
The fiber type.
Definition: sec_tuple.h:78
sec_tuple * 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...
Definition: sec_tuple.h:249
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
An abstract client handle for a member of a poset.
Namespace for the fiber_bundles component of the sheaf system.
sec_tuple_space host_type
The type of host poset.
Definition: sec_tuple.h:73
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61