SheafSystem  0.0.0.0
bilinear_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 bilinear_2d
19 
20 #ifndef BILINEAR_2D_H
21 #define BILINEAR_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 #ifndef BLOCK_H
32 #include "SheafSystem/block.h"
33 #endif
34 
35 namespace fiber_bundle
36 {
37 
42 class SHEAF_DLL_SPEC bilinear_2d : public linear_fcn_space
43 {
44 
45  // ===========================================================
47  // ===========================================================
49 
50 public:
51 
55  bilinear_2d();
56 
60  bilinear_2d(const bilinear_2d& xother);
61 
65  virtual ~bilinear_2d();
66 
70  double inverse_jacobian(const double xjacobian[2][2],
71  double xinverse_jacobian[2][2]);
72 
73 protected:
74 
75 private:
76 
82  enum static_const_int {DL = 4};
83 
87  value_type _basis_value_buffer[DL];
88 
92  value_type _basis_deriv_value_buffer[2*DL];
93 
97  //value_type _jacobian_value_buffer[4];
98  value_type _jacobian_value_buffer[128];
99 
100  //block<int[2]> _jacobian_value_block;
101  //vector<int[2]> _jacobian_value_vector;
102 
120  double solve_quadratic(double xcoefficients[]);
121 
141  int solve_quadratic(double xcoefficients[], double xresult[]);
142 
144 
145  // ===========================================================
147  // ===========================================================
149 
150 public:
151 
155  virtual int dl() const;
156 
161  virtual void basis_at_coord(const dof_type xlocal_coord[],
162  size_type xlocal_coord_ub);
163 
168  virtual void basis_derivs_at_coord(const dof_type xlocal_coords[],
169  size_type xlocal_coords_ub);
170 
171 protected:
172 
173 private:
174 
176 
177  // ===========================================================
179  // ===========================================================
181 
182 public:
183 
188  virtual value_type jacobian_determinant(const dof_type xcoord_dofs[],
189  size_type xcoord_dofs_ub,
190  size_type xdf,
191  const coord_type xlocal_coords[],
192  size_type xlocal_coords_ub);
193 
198  virtual value_type volume(const dof_type xcoord_dofs[],
199  size_type xcoord_dofs_ub,
200  size_type xdf);
201 
205  virtual void integrate(const dof_type xcoord_dofs[],
206  size_type xcoord_dofs_ub,
207  size_type xdf,
208  const dof_type xintegrands[],
209  size_type xintegrands_ub,
210  value_type xresult_integrals[],
211  size_type xresult_integrals_ub);
212 
216  virtual void integrate(const dof_type xcoord_dofs[],
217  size_type xcoord_dofs_ub,
218  size_type xdf,
219  const dof_type xintegrand,
220  value_type xresult_integrals[],
221  size_type xresult_integrals_ub);
222 
226  virtual void gauss_point(pod_index_type xindex,
227  coord_type xresult[],
228  size_type xresult_ub);
229 
230 protected:
231 
232 private:
233 
235 
236  // ===========================================================
238  // ===========================================================
240 
241 public:
242 
247  void dxi_local(size_type xlocal_coord_index,
248  const dof_type xsource_dofs[],
249  size_type xsource_dofs_ub,
250  dof_type xresult_dofs[],
251  size_type xresult_dofs_ub) const;
252 
257  virtual void jacobian(const dof_type xcoord_dofs[],
258  size_type xcoord_dofs_ub,
259  size_type xdf,
260  const dof_type xlocal_coords[],
261  size_type xlocal_coords_ub);
262 
263 protected:
264 
265 private:
266 
268 
269  // ===========================================================
271  // ===========================================================
273 
274 public:
275 
280  virtual int db() const;
281 
285  virtual void local_coordinates(pod_index_type xindex,
286  coord_type xresult[],
287  size_type xresult_ub) const;
288 
292  void edge_center(pod_index_type xi, coord_type xresult[], size_type xresult_ub) const;
293 
297  void edge_center(pod_index_type xi, block<coord_type>& xresult) const;
298 
303  virtual bool in_standard_domain(const 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 
324  virtual void coord_at_value(const dof_type xdofs[],
325  size_type xdofs_ub,
326  const dof_type xglobal_coords[],
327  size_type xglobal_coord_ub,
328  dof_type xlocal_coords[],
329  size_type xlocal_coords_ub) const;
330 
331 protected:
332 
333 private:
334 
336 
337  // ===========================================================
339  // ===========================================================
341 
342 public:
343 
347  virtual bilinear_2d* clone() const;
348 
352  virtual bilinear_2d& operator=(const section_evaluator& xother);
353 
357  bilinear_2d& operator=(const bilinear_2d& xother);
358 
362  virtual bool invariant() const;
363 
367  virtual bool is_ancestor_of(const any* xother) const;
368 
369 protected:
370 
371 private:
372 
374 
375 };
376 
377 } // namespace fiber_bundle
378 
379 #endif // ifndef BILINEAR_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...
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.
A section evaluator using bilinear interpolation over a square 2D domain.
Definition: bilinear_2d.h:42