SheafSystem  0.0.0.0
array_field_dof_map.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 array_field_dof_map;
19 // This representation uses contiguous storage with
20 // the fiber index varying most rapidly
21 
22 #ifndef ARRAY_FIELD_DOF_MAP_H
23 #define ARRAY_FIELD_DOF_MAP_H
24 
25 #ifndef SHEAF_DLL_SPEC_H
26 #include "SheafSystem/sheaf_dll_spec.h"
27 #endif
28 
29 #ifndef STD_STRING_H
30 #include "SheafSystem/std_string.h"
31 #endif
32 
33 #ifndef FIELD_DOF_MAP_H
34 #include "SheafSystem/field_dof_map.h"
35 #endif
36 
37 namespace sheaf
38 {
39 class dof_map_factory;
40 }
41 
42 namespace fiber_bundle
43 {
44 
45 class sec_rep_space;
46 
47 
53 class SHEAF_DLL_SPEC array_field_dof_map : public field_dof_map
54 {
55 
56 public:
57 
61  virtual const std::string& class_name() const;
62 
66  static const std::string& static_class_name();
67 
68  // ===========================================================
69  // CANONICAL FACET
70  // ===========================================================
71 
76 
80  virtual array_field_dof_map* clone() const;
81 
86 
90  virtual array_field_dof_map* copy() const;
91 
95  array_field_dof_map& operator=(const array_field_dof_map& xother);
96 
100  virtual ~array_field_dof_map();
101 
105  virtual bool invariant() const;
106 
107  // ===========================================================
108  // MAP FACET
109  // ===========================================================
110 
116  array_field_dof_map(const sec_rep_space* xhost, void* xdofs = 0, size_t xdofs_ub = 0);
117 
118 
119 
123  virtual dof_tuple_type type_id() const
124  {
125  return ARRAY_FIELD_DOF_TUPLE_ID;
126  };
127 
128  using field_dof_map::get_dof;
129  using field_dof_map::put_dof;
130 
131  // ===========================================================
133  // ===========================================================
135 
136 public:
137 
141  virtual void get_dof(pod_index_type xdof_id, void* xdof, size_type xdof_size) const;
142 
146  virtual void put_dof(pod_index_type xdof_id, bool xis_poset_id, const void* xdof, size_type xdof_size);
147 
151  virtual void get_dof(pod_index_type xdisc_id,
152  pod_index_type xfiber_dof_id,
153  void* xdof,
154  size_type xdof_size) const;
155 
159  virtual void put_dof(pod_index_type xdisc_id,
160  pod_index_type xfiber_dof_id,
161  const void* xdof,
162  size_type xdof_size);
163 
167  virtual void get_fiber(pod_index_type xdisc_id, void* xfiber, size_type xfiber_size) const;
168 
172  virtual void put_fiber(pod_index_type xdisc_id, const void* xfiber, size_type xfiber_size);
173 
177  virtual void get_component(pod_index_type xfiber_dof_id, void* xcomponent, size_type xcomponent_size) const;
178 
182  virtual void put_component(pod_index_type xfiber_dof_id, const void* xcomponent, size_type xcomponent_size);
183 
184 protected:
185 
186 private:
187 
190  //
191  sec_vd_dof_type* dof_ptr(pod_index_type xdof_id) const
192  {
193  return reinterpret_cast<sec_vd_dof_type*>(_dofs) + xdof_id;
194  }
195 
198  //
199  void* dof_ptr(pod_index_type xdisc_id, pod_index_type xfiber_dof_id) const
200  {
201  return _dofs + schema().offset(xdisc_id, xfiber_dof_id);
202  }
203 
205 
206 public:
207 
212  virtual void get_dof(const scoped_index& xid, bool xis_poset_id, void *xbuf, size_t xbuf_len) const;
213 
218  virtual void put_dof(const scoped_index& xid, bool xis_poset_id, const void *xbuf, size_t xbuf_len);
219 
225  virtual void get_dofs(const client_index* xclient_ids, int xclient_id_ct, void* xbuf, size_t xbuf_len) const;
226 
232  virtual void put_dofs(const client_index* xclient_ids, int xclient_id_ct, const void* xbuf, size_t xbuf_len);
233 
240  virtual void get_dof(const scoped_index& xbase_id,
241  const scoped_index& xfiber_id,
242  const scoped_index& xmult_id,
243  bool xis_poset_id, void* xbuf, size_t xbuf_len) const;
244 
251  virtual void put_dof(const scoped_index& xbase_id,
252  const scoped_index& xfiber_id,
253  const scoped_index& xmult_id,
254  bool xis_poset_id, const void* xbuf, size_t xbuf_len);
255 
261  virtual void get_dofs(const client_index* xclient_base_ids, int xclient_base_id_ct,
262  const client_index* xclient_fiber_ids, int xclient_fiber_id_ct,
263  void* xbuf, size_t xbuf_len) const;
264 
270  virtual void put_dofs(const client_index* xclient_base_ids, int xclient_base_id_ct,
271  const client_index* xclient_fiber_ids, int xclient_fiber_id_ct,
272  const void* xbuf, size_t xbuf_len);
273 
281  virtual void get_discretization_dofs(const scoped_index& xdisc_id,
282  bool xis_poset_id,
283  void* xbuf,
284  size_t xbuf_len) const;
292  virtual void put_discretization_dofs(const scoped_index& xdisc_id,
293  bool xis_poset_id,
294  const void* xbuf,
295  size_t xbuf_len);
304  virtual void get_component_dofs(void* xbuf,
305  size_t xbuf_len,
306  const scoped_index& xcomp_id,
307  const scoped_index* xdisc_ids = 0,
308  size_type xdisc_ids_ct = 0) const;
309 
318  virtual void put_component_dofs(const void* xbuf,
319  size_t xbuf_len,
320  const scoped_index& xcomp_id,
321  const scoped_index* xdisc_ids = 0,
322  size_type xdisc_ids_ct = 0);
323 
335  virtual void get_component_dofs(void* xbuf,
336  size_t xbuf_len,
337  const client_index& xcomp_id,
338  const id_map* xcomp_client_id_map,
339  const client_index* xdisc_ids = 0,
340  size_type xdisc_ids_ct = 0,
341  const id_map* xdisc_client_id_map = 0) const;
342 
354  virtual void put_component_dofs(const void* xbuf,
355  size_t xbuf_len,
356  const client_index& xcomp_id,
357  const id_map* xcomp_client_id_map,
358  const client_index* xdisc_ids = 0,
359  size_type xdisc_ids_ct = 0,
360  const id_map* xdisc_client_id_map = 0);
364  virtual void* dof_tuple();
365 
369  virtual const void* dof_tuple() const;
370 
374  virtual void get_dof_tuple(void* xbuf, size_t xbuflen) const;
375 
379  virtual void put_dof_tuple(const void* xbuf, size_t xbuflen);
380 
381 
382 protected:
383 
387  virtual void allocate_dofs();
388 
389 private:
390 
394  int _disc_ct;
395 
399  int _fiber_ct;
400 
404  int _local_ct;
405 
409  int _fiber_tuple_size;
410 
414  double* _dofs;
415 
419  bool _this_owns_dofs;
420 
425  static bool _has_prototype;
426 
430  static bool make_prototype();
431 
435  void reserve(int xindex);
436 };
437 
438 } // namespace fiber_bundle
439 
440 #endif // ifndef ARRAY_FIELD_DOF_MAP_H
OBSOLETE: Use array_sec_vd_dof_map or sparse_section_dof_map. The abstract map from section_space_sch...
Definition: field_dof_map.h:48
A contiguous tuple, contiguous fiber representation of the abstract map from section_space_schema_mem...
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
dof_tuple_type
Identifiers for dof tuple types.
virtual dof_tuple_type type_id() const
An identifer for the type of dof tuple this is.
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.
double sec_vd_dof_type
The type of degree of freedom in the section space.
Definition: fiber_bundle.h:78
Namespace for the fiber_bundles component of the sheaf system.
A handle for a poset whose members are numerical representations of sections of a fiber bundle...
Definition: sec_rep_space.h:61