SheafSystem  0.0.0.0
field_vd.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 FIELD_VD_H
22 #define FIELD_VD_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ANY_H
29 #include "SheafSystem/any.h"
30 #endif
31 
32 #ifndef FIELDS_H
33 #include "SheafSystem/fields.h"
34 #endif
35 
36 namespace sheaf
37 {
38 class name_multimap;
39 class namespace_poset;
40 class poset_path;
41 class subposet;
42 }
43 
44 namespace fiber_bundle
45 {
46 class base_space_member;
47 class sec_ed;
48 class sec_vd;
49 class sec_at0;
50 class vd;
51 class vd_lite;
52 }
53 
54 namespace geometry
55 {
56 class sec_ed_invertible;
57 }
58 
59 namespace fields
60 {
61 class discretization_push_action;
62 class property_disc_iterator;
63 class put_property_dofs_action;
64 
65 
69 class SHEAF_DLL_SPEC field_vd : public any
70 {
71  //===========================================================================
73  //===========================================================================
75 
76 public:
77 
82  field_vd();
83 
88  field_vd(const field_vd& xother, bool xauto_access);
89 
93  field_vd(const sec_ed& xcoordinates, const sec_vd& xproperty,
94  bool xauto_access);
95 
101  const poset_path& xcoordinates_path,
102  const poset_path& xproperty_path,
103  bool xauto_access);
104 
108  virtual ~field_vd();
109 
113  int dc() const;
114 
118  int dp() const;
119 
123  int db() const;
124 
128  namespace_poset& name_space() const;
129 
133  sec_ed_invertible& coordinates() const;
134 
138  sec_vd& property() const;
139 
143  base_space_member& base_space() const;
144 
148  property_disc_iterator* new_property_disc_iterator() const;
149 
154  typedef void (*property_dof_function_type)
155  (block<sec_vd_value_type>& xglobal_coords,
156  block<sec_vd_dof_type>& xproperty_dofs);
157 
163  static void property_dof_function_example(
164  block<sec_vd_value_type>& xglobal_coords,
165  block<sec_vd_dof_type>& xproperty_dofs);
166 
167 
171  void put_property_dofs(property_dof_function_type xproperty_dofs_fcn,
172  bool xauto_access);
173 
174 
179  static void put_property_dofs(const sec_vd& xcoordinates,
180  sec_vd& xproperty,
181  property_dof_function_type xproperty_dofs_fcn,
182  bool xauto_access);
183 
188  void put_property_dofs(put_property_dofs_action& xproperty_dofs_action,
189  bool xauto_access);
190 
195  static void put_property_dofs(const sec_vd& xcoordinates,
196  sec_vd& xproperty,
197  put_property_dofs_action& xproperty_dofs_action,
198  bool xauto_access);
199 
208  void print_property_dofs(std::ostream& xos,
209  property_dof_function_type xproperty_dofs_fcn,
210  const std::string& xtitle_text,
211  bool xzero_specified,
212  bool xauto_access) const;
213 
217  bool same_property_fiber_schema(const field_vd& xother,
218  bool xauto_access) const;
219 
224  bool same_evaluation() const;
225 
230  bool same_discretization() const;
231 
235  void property_at_coordinates(const vd_lite& xcoord, vd_lite& xprop) const;
236 
240  void property_at_coordinates(const block<sec_vd_value_type>& xcoord,
241  block<sec_vd_value_type>& xprop) const;
242 
246  void property_at_coordinates(sec_vd_value_type xcoord_base[],
247  int xcoord_ct,
248  sec_vd_value_type xprop_base[],
249  int xprop_ub) const;
250 
257  subposet* embed_property(const std::string& xresult_name,
258  name_multimap& xresult_member_names,
259  bool xauto_access);
260 
267  static void delete_field_spaces(field_vd* xfield,
268  bool xdelete_coord_fiber,
269  bool xdelete_prop_fiber);
270 
271 protected:
272 
276  field_vd(sec_vd* xproperty,
277  sec_ed_invertible* xcoordinates,
278  base_space_member* xbase_space);
279 
280 //private:
281 
285 
290 
295 
300 
301 private:
302 
304 
305  //===========================================================================
307  //===========================================================================
309 
310 public:
311 
319 
328  static bool access_control_disabled();
329 
330  // ///
331  // /// Disables access control.
332  // /// Disabled (true) is equivalent to having read-write access
333  // /// at all times, irrespective of any access control requests.
334  // /// Synonym for read_write_monitor::disable_access_control().
335  // /// Should only be invoked once at beginning of a program, before any
336  // /// other SheafSystem calls. Once disabled, access control can not be re-enabled.
337  // ///
338  // static void disable_access_control();
339 
346  static void enable_access_control();
347 
351  virtual bool is_attached() const;
352 
358  bool state_is_read_only_accessible() const;
359 
365  bool state_is_not_read_only_accessible() const;
366 
371  bool state_is_read_accessible() const;
372 
377  bool state_is_not_read_accessible() const;
378 
384  bool state_is_read_write_accessible(bool xbase_access = false) const;
385 
391  bool state_is_not_read_write_accessible(bool xbase_access = false) const;
392 
397  int access_request_depth() const;
398 
402  virtual void get_read_access() const;
403 
412  virtual void get_read_write_access(bool xbase_access,
413  bool xrelease_read_only_access);
414 
419  virtual void release_access(bool xall = false) const;
420 
425  bool state_is_modified() const;
426 
430  void clear_state_is_modified();
431 
433 
434  //===========================================================================
436  //===========================================================================
438 
439 public:
440 
444  virtual const std::string& class_name() const;
445 
449  static const std::string& static_class_name();
450 
454  virtual bool is_ancestor_of(const any* xother) const;
455 
460  virtual field_vd* clone() const;
461 
465  virtual field_vd& operator=(const field_vd& xother);
466 
470  field_vd& operator=(const sec_vd& xsection);
471 
475  field_vd& operator=(const vd& xfiber);
476 
480  field_vd& operator=(const vd_lite& xfiber);
481 
485  virtual bool invariant() const;
486 
488 
489 };
490 
491 //=============================================================================
492 // NON-MEMBER FUNCTIONS
493 //=============================================================================
494 
498 SHEAF_DLL_SPEC
499 void push(const field_vd& xsrc, field_vd& xdst, bool xauto_access);
500 
504 SHEAF_DLL_SPEC
505 field_vd& operator>>(const field_vd& xsrc, field_vd& xdst);
506 
510 SHEAF_DLL_SPEC
511 std::ostream& operator<<(std::ostream& xos, const field_vd& xfield);
512 
513 } // namespace fields
514 
515 
516 //==============================================================================
517 
519 
520 #include "SheafSystem/field_vd_funcs.h"
521 
522 
523 #endif // ifndef FIELD_VD_H
524 
525 
526 
527 
A client handle for a subposet.
Definition: subposet.h:86
Namespace for fields component of sheaf system.
The default name space; a poset which contains other posets as members.
base_space_member * _base_space
The base space of this field.
Definition: field_vd.h:299
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 partial multi-valued relation with total injective inverse between names and indices of type index_...
Definition: name_multimap.h:63
A client handle for a member of a base space poset.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
Definition: sec_ed.h:47
Abstract base class with useful features for all objects.
Definition: any.h:39
Abstract vector space over dof_type (volatile version).
Definition: vd.h:111
An abstract invertible section of a fiber bundle with a d-dimensional base space and a d-dimensional ...
SHEAF_DLL_SPEC void push(const field_vd &xsrc, field_vd &xdst, bool xauto_access)
Pushes xsrc.property() to xdst.property().
Definition: field_vd.cc:1904
A vd-valued property as a function of global coordinates.
Definition: field_vd.h:69
void(* property_dof_function_type)(block< sec_vd_value_type > &xglobal_coords, block< sec_vd_dof_type > &xproperty_dofs)
The type of the function for computing the property dofs at given global coordinates.
Definition: fields.h:64
A section of a fiber bundle with a d-dimensional vector space fiber.
Definition: sec_vd.h:54
SHEAF_DLL_SPEC std::istream & operator>>(std::istream &is, dof_tuple_type &xdt)
Extract dof_tuple_type xdt from istream& is.
An abstract discretization push action for field_vds::put_property_dofs.
sec_ed_invertible * _coordinates
The independent variable of this field.
Definition: field_vd.h:294
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
Namespace for the sheaves component of the sheaf system.
sec_vd * _property
The dependent variable of this field.
Definition: field_vd.h:289
Namespace for the fiber_bundles component of the sheaf system.
Namespace for geometry component of sheaf system.
Definition: field_vd.h:54
vd_value_type sec_vd_value_type
The type of component in the value of a section at a point.
Definition: fiber_bundle.h:73
Abstract vector space over dof_type.
Definition: vd.h:350
Abstract iterator over the discretization of the property section of a field_vd. Concurrently travers...