SheafSystem  0.0.0.0
linear_2d.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 linear_2d
19 
20 #ifndef LINEAR_2D_H
21 #define LINEAR_2D_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef LINEAR_FCN_SPACE_H
28 #include "SheafSystem/linear_fcn_space.h"
29 #endif
30 
31 namespace fiber_bundle
32 {
33 
39 class SHEAF_DLL_SPEC linear_2d : public linear_fcn_space
40 {
41 
42  // ===========================================================
44  // ===========================================================
46 
47 public:
48 
52  linear_2d();
53 
57  linear_2d(const linear_2d& xother);
58 
62  virtual ~linear_2d();
63 
64  // ///
66  // ///
67  // double inverse_jacobian(const double xjacobian[3][3],
68  // double xinverse_jacobian[3][3]);
69 
70  // ///
72  // ///
73  // double determinant(const dof_type xcoord_dofs[],
74  // size_type xcoord_dofs_ub,
75  // const coord_type xlocal_coords[],
76  // size_type xlocal_coords_ub);
77 
78 protected:
79 
80 private:
81 
87  enum static_const_int {DL = 3};
88 
92  value_type _basis_value_buffer[DL];
93 
97  value_type _basis_deriv_value_buffer[2*DL];
98 
102  //value_type _jacobian_value_buffer[4];
103  value_type _jacobian_value_buffer[128];
104 
105  //block<int[2]> _jacobian_value_block;
106  //vector<int[2]> _jacobian_value_vector;
107 
109 
110  // ===========================================================
112  // ===========================================================
114 
115 public:
116 
120  virtual int dl() const;
121 
125  virtual void basis_at_coord(const dof_type xlocal_coord[], size_type xlocal_coord_ub);
126 
131  void basis_derivs_at_coord(const dof_type xlocal_coord[],
132  size_type xlocal_coord_ub);
133 
134 protected:
135 
136 private:
137 
139 
140  // ===========================================================
142  // ===========================================================
144 
145 public:
146 
150  value_type jacobian_determinant(const dof_type xcoord_dofs[],
151  size_type xcoord_dofs_ub,
152  size_type xdf,
153  const coord_type xlocal_coords[],
154  size_type xlocal_coords_ub);
155 
156  value_type volume(const dof_type xcoord_dofs[],
157  size_type xcoord_dofs_ub, size_type xdf);
158 
162  virtual void integrate(const dof_type xcoord_dofs[],
163  size_type xcoord_dofs_ub,
164  size_type xdf,
165  const dof_type xintegrands[],
166  size_type xintegrands_ub,
167  value_type xresult_integrals[],
168  size_type xresult_integrals_ub);
169 
173  virtual void integrate(const dof_type xcoord_dofs[],
174  size_type xcoord_dofs_ub,
175  size_type xdf,
176  const dof_type xintegrands[],
177  value_type xresult_integrals[],
178  size_type xresult_integrals_ub);
179 
183  virtual void integrate(const dof_type xcoord_dofs[],
184  size_type xcoord_dofs_ub,
185  size_type xdf,
186  const dof_type xintegrand,
187  value_type xresult_integrals[],
188  size_type xresult_integrals_ub);
189 
190 protected:
191 
192  void gauss_point(pod_index_type xindex,
193  coord_type xresult[],
194  size_type xresult_ub);
195 
196 private:
197 
199 
200  // ===========================================================
202  // ===========================================================
204 
205 public:
206 
211  virtual void dxi_local(size_type xlocal_coord_index,
212  const dof_type xsource_dofs[],
213  size_type xsource_dofs_ub,
214  dof_type xresult_dofs[],
215  size_type xresult_dofs_ub) const;
216 
220  void jacobian(const dof_type xcoord_dofs[],
221  size_type xcoord_dofs_ub,
222  size_type xdf,
223  const dof_type xlocal_coords[],
224  size_type xlocal_coords_ub);
225 
226  // ///
228  // ///
229  // double jacobian(const dof_type xcoord_dofs[],
230  // size_type xcoord_dofs_ub,
231  // const coord_type xlocal_coords[],
232  // size_type xlocal_coords_ub,
233  // double xjacobian[3][3] = NULL);
234 
235 protected:
236 
237 private:
238 
240 
241  // ===========================================================
243  // ===========================================================
245 
246 public:
247 
252  virtual int db() const;
253 
257  virtual void local_coordinates(pod_index_type xindex,
258  coord_type xresult[],
259  size_type xresult_ub) const;
263  virtual void center(coord_type xresult[], size_type xresult_ub) const;
264 
268  void edge_center(pod_index_type xi, coord_type xresult[], size_type xresult_ub) const;
269 
273  void edge_center(pod_index_type xi, block<coord_type>& xresult) const;
274 
279  virtual bool in_standard_domain(const dof_type xlocal_coords[], size_type xlocal_coords_ub) const;
280 
281 protected:
282 
283 private:
284 
286 
287  // ===========================================================
289  // ===========================================================
291 
292 public:
293 
299  virtual void coord_at_value(const dof_type xdofs[],
300  size_type xdofs_ub,
301  const dof_type xglobal_coords[],
302  size_type xglobal_coord_ub,
303  dof_type xlocal_coords[],
304  size_type xlocal_coords_ub) const;
305 
306 protected:
307 
308 private:
309 
311 
312  // ===========================================================
314  // ===========================================================
316 
317 public:
318 
322  virtual linear_2d* clone() const;
323 
327  virtual linear_2d& operator=(const section_evaluator& xother);
328 
332  linear_2d& operator=(const linear_2d& xother);
333 
337  virtual bool invariant() const;
338 
342  virtual bool is_ancestor_of(const any* xother) const;
343 
344 protected:
345 
346 private:
347 
349 
350 };
351 
352 } // namespace fiber_bundle
353 
354 #endif // ifndef LINEAR_2D_H
sec_vd_dof_type dof_type
The type of degree of freedom.
Abstract base class with useful features for all objects.
Definition: any.h:39
An abstract integrable section evaluator which is a member of a linear function space.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
chart_point_coord_type coord_type
The type of local coordinate; the scalar type for the local coordinate vector space.
vd_value_type value_type
The type of component in the value; the scalar type in the range vector space.
An abstract local section evaluator; a map from {local coordinates x dofs} to section value...
A section evaluator using linear interpolation over a triangular 2D domain.
Definition: linear_2d.h:39
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
An auto_block with a no-initialization initialization policy.
Namespace for the fiber_bundles component of the sheaf system.