SheafSystem  0.0.0.0
sec_tp.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_TP_H
22 #define SEC_TP_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef SEC_VD_H
29 #include "SheafSystem/sec_vd.h"
30 #endif
31 
32 #ifndef TP_H
33 #include "SheafSystem/tp.h"
34 #endif
35 
36 namespace fiber_bundle
37 {
38 
39 class sec_at1;
40 class sec_tp_space;
41 
42 //==============================================================================
43 // CLASS SEC_TP
44 //==============================================================================
45 
49 class SHEAF_DLL_SPEC sec_tp : public sec_vd
50 {
51 
52  // ===========================================================
54  // ===========================================================
56 
57 public:
58 
63 
68 
72  typedef tp fiber_type;
73 
79  static host_type& new_host(namespace_type& xns,
80  const poset_path& xhost_path,
81  const poset_path& xschema_path,
82  const poset_path& xvector_space_path,
83  bool xauto_access);
84 
85 protected:
86 
87 private:
88 
90 
91 
92  //============================================================================
94  //============================================================================
96 
97 public:
98 
102  sec_tp();
103 
108  sec_tp(const sec_rep_space* xhost, pod_index_type xhub_id);
109 
114  sec_tp(const sec_rep_space* xhost, const scoped_index& xid);
115 
120  sec_tp(const sec_rep_space* xhost, const std::string& xname);
121 
126  sec_tp(const namespace_poset* xnamespace,
127  const poset_path& xpath,
128  bool xauto_access = true);
129 
133  explicit sec_tp(sec_rep_space_member* xother);
134 
138  sec_tp(sec_rep_space* xhost,
139  section_dof_map* xdof_map = 0,
140  bool xauto_access = true);
141 
147  sec_tp(sec_rep_space* xhost,
148  abstract_poset_member& xbase_mbr,
149  int xbase_version = CURRENT_HOST_VERSION,
150  bool xauto_access = true);
151 
155  virtual sec_tp& operator=(const abstract_poset_member& xother);
156 
160  sec_tp& operator=(const sec_tp& xother);
161 
165  sec_tp& operator=(const tp& xfiber);
166 
170  sec_tp& operator=(const tp_lite& xfiber);
171 
175  ~sec_tp();
176 
180  virtual const fiber_type& fiber_prototype() const;
181 
186  virtual int p() const;
187 
192  int p(bool xauto_access) const;
193 
197  virtual int dd() const;
198 
202  virtual int dd(bool xauto_access) const;
203 
207  poset_path vector_space_path() const;
208 
212  poset_path vector_space_path(bool xauto_access) const;
213 
217  virtual sec_tp_space& vector_space() const;
218 
222  virtual sec_tp_space& vector_space(bool xauto_access) const;
223 
227  static const std::string create_tensor_space_name(const std::string& xvector_space_name, const std::string& xname);
228 
232  virtual tensor_variance variance(bool xauto_access) const;
233 
238  virtual bool variance(int xi, bool xauto_access) const;
239 
243  void put_variance(const tensor_variance& xvariance, bool xauto_access);
244 
248  void put_variance(int xi, bool xvariance, bool xauto_access);
249 
253  virtual bool is_covariant(bool xauto_access) const;
254 
258  virtual bool is_covariant(int xi, bool xauto_access) const;
259 
263  virtual void put_is_covariant(bool xauto_access);
264 
268  void put_is_covariant(int xi, bool xauto_access);
269 
273  virtual bool is_contravariant(bool xauto_access) const;
274 
278  virtual bool is_contravariant(int xi, bool xauto_access) const;
279 
283  virtual void put_is_contravariant(bool xauto_access);
284 
288  void put_is_contravariant(int xi, bool xauto_access);
289 
290 protected:
291 
292 private:
293 
295 
296 
297  //============================================================================
299  //============================================================================
301 
302 public:
303 
304 protected:
305 
306 private:
307 
309 
310 
311  //============================================================================
313  //============================================================================
315 
316 public:
317 
318 protected:
319 
320 private:
321 
323 
324 
325  //============================================================================
327  //============================================================================
329 
330 public:
331 
335  virtual const std::string& class_name() const;
336 
340  static const std::string& static_class_name();
341 
345  virtual sec_tp* clone() const;
346 
352  inline sec_tp* clone(bool xnew_state, bool xauto_access = true) const
353  {
354  return static_cast<sec_tp*>(sec_vd::clone(xnew_state, xauto_access));
355  }
356 
357 protected:
358 
359 private:
360 
362 
363 
364  // ===========================================================
366  // ===========================================================
368 
369 public:
370 
374  host_type* host() const;
375 
379  virtual bool host_is_ancestor_of(const poset_state_handle* other) const;
380 
381 protected:
382 
383 private:
384 
386 
387 
388  //============================================================================
390  //============================================================================
392 
393 public:
394 
398  bool fiber_is_ancestor_of(const any* xother) const;
399 
403  bool is_ancestor_of(const any* xother) const;
404 
408  bool invariant() const;
409 
410 protected:
411 
412 private:
413 
415 
416 };
417 
418 //==============================================================================
419 // NON-MEMBER FUNCTIONS
420 //==============================================================================
421 
426 namespace sec_tp_algebra
427 {
428 
433 SHEAF_DLL_SPEC void alt(const sec_tp& x0, sec_atp& xresult, bool xauto_access);
434 
439 SHEAF_DLL_SPEC void sym(const sec_tp& x0, sec_stp& xresult, bool xauto_access);
440 
448 SHEAF_DLL_SPEC void contract(const sec_tp& x0, int xp, int xq, sec_tp& xresult,
449  bool xauto_access);
450 
454 SHEAF_DLL_SPEC void tensor(const sec_tp& x0, const sec_tp& x1, sec_tp& xresult,
455  bool xauto_access);
456 
457 //==============================================================================
458 
459 } // namespace sec_tp_algebra
460 
461 } // namespace fiber_bundle
462 
463 #endif // ifndef SEC_TP_H
void alt(const GT &x0, AT &xresult, bool xauto_access)
Definition: sec_tp.impl.h:140
void sym(const GT &x0, ST &xresult, bool xauto_access)
Definition: sec_tp.impl.h:184
sec_at1 vector_space_type
The type of the underlying vector space.
Definition: sec_tp.h:67
The "type" of a tensor; specifies the degree and the co- or contra-variance for each index of a tenso...
The abstract map from section dof ids to section dof values of heterogeneous type.
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.
sec_tp_space host_type
The type of host poset.
Definition: sec_tp.h:62
A section of a bundle with fiber type at1.
Definition: sec_at1.h:48
A general tensor of "degree" p and given "variance" over an abstract vector space.
Definition: tp.h:253
Abstract base class with useful features for all objects.
Definition: any.h:39
An abstract tensor section space of degree p.
Definition: sec_tp_space.h:53
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
A section of a bundle with fiber type atp.
Definition: sec_atp.h:48
A section of a bundle with fiber type stp.
Definition: sec_stp.h:48
SHEAF_DLL_SPEC tensor_variance contract(const tensor_variance &x0, int xp, int xq)
The variance of the contration of a tensor with variance x0 on indices xp and xq. ...
A general tensor of degree p over an abstract vector space (volatile version). Volatile version does ...
Definition: tp.h:59
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
tp fiber_type
The fiber type.
Definition: sec_tp.h:72
sec_tp * 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_tp.h:352
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
virtual sec_vd * clone() const
Make a new handle, no state instance of current.
Definition: sec_vd.cc:1318
An abstract client handle for a member of a poset.
Namespace for the fiber_bundles component of the sheaf system.
void tensor(const S0 &x0, const S1 &x1, SR &xresult, bool xauto_access)
Definition: sec_tp.impl.h:228
A section of a bundle with fiber type tp.
Definition: sec_tp.h:49
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61