OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
feinterpol.h
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #ifndef feinterpol_h
36 #define feinterpol_h
37 
38 #include "oofemcfg.h"
39 #include "error.h"
40 #include "inputrecord.h"
41 #include "intarray.h"
42 #include "integrationdomain.h"
43 #include "elementgeometrytype.h"
44 #include "materialmode.h"
45 #include "node.h"
46 #include "element.h"
47 
48 namespace oofem {
49 class Element;
50 class FloatArray;
51 class FloatMatrix;
52 class IntArray;
53 class IntegrationRule;
54 
62 class OOFEM_EXPORT FEICellGeometry
63 {
64 public:
66  virtual ~FEICellGeometry() { }
67  virtual int giveNumberOfVertices() const = 0;
68  virtual const FloatArray *giveVertexCoordinates(int i) const = 0;
69 };
70 
71 
76 class OOFEM_EXPORT FEIVoidCellGeometry : public FEICellGeometry
77 {
78 public:
80  virtual ~FEIVoidCellGeometry() { }
81  int giveNumberOfVertices() const {
82  OOFEM_ERROR("no reference geometry");
83  return 0;
84  }
85  const FloatArray *giveVertexCoordinates(int i) const {
86  OOFEM_ERROR("no reference geometry");
87  return NULL;
88  }
89  std :: string errorInfo(const char *func) const { return func; }
90 };
91 
95 class OOFEM_EXPORT FEIElementGeometryWrapper : public FEICellGeometry
96 {
97 protected:
98  const Element *elem;
99 public:
101  this->elem = elem;
102  }
104  int giveNumberOfVertices() const;
105  inline const FloatArray *giveVertexCoordinates(int i) const
106  {
107  return &(elem->giveNode(i)->giveNodeCoordinates());
108  }
109 };
110 
111 
116 {
117 protected:
118  const std::vector< FloatArray > &coords;
119 
120 public:
121  FEIVertexListGeometryWrapper(const std::vector< FloatArray > &coords) :
122  FEICellGeometry(), coords(coords) { }
124  int giveNumberOfVertices() const { return (int)this->coords.size(); }
125  const FloatArray *giveVertexCoordinates(int i) const { return &this->coords [ i - 1 ]; }
126 };
127 
132 class OOFEM_EXPORT FEInterpolation
133 {
134 protected:
135  int order;
136 
137 public:
139  order = o;
140  }
141  virtual ~FEInterpolation() { }
144 
145 
146  /* @name basic interpolation services */
148 
151  virtual integrationDomain giveIntegrationDomain() const = 0;
155  virtual Element_Geometry_Type giveGeometryType() const = 0;
159  int giveInterpolationOrder() { return order; }
166  virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) = 0;
175  virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) = 0;
183  virtual void evald2Ndx2(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) {
184  OOFEM_ERROR("not implemented");
185  }
193  virtual void evaldNdxi(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) {
194  OOFEM_ERROR("not implemented");
195  }
199  virtual void giveLocalNodeCoords(FloatMatrix &answer) {
200  OOFEM_ERROR("FEInterpolation::giveLocalNodeCoords: not implemented");
201  }
208  virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) = 0;
218  virtual int global2local(FloatArray &answer, const FloatArray &gcoords, const FEICellGeometry &cellgeo) = 0;
225  virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo);
232  virtual void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
233  { OOFEM_ERROR("Not overloaded."); }
234 
240  virtual IntegrationRule *giveIntegrationRule(int order);
242 
243 
258  virtual void boundaryEdgeEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0;
267  virtual double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0;
276  virtual void boundaryEdgeLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0;
278  virtual integrationDomain giveBoundaryEdgeIntegrationDomain(int boundary) const = 0;
285  virtual IntegrationRule *giveBoundaryEdgeIntegrationRule(int order, int boundary);
291  virtual void boundaryEdgeGiveNodes(IntArray &answer, int boundary)=0;
293 
305  virtual void boundarySurfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) = 0;
314  virtual void boundarySurfaceEvaldNdx(FloatMatrix &answer, int isurf,
315  const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0;
324  virtual double boundarySurfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords,
325  const FEICellGeometry &cellgeo)=0;
326 
335  virtual void boundarySurfaceLocal2global(FloatArray &answer, int isurf,
336  const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0;
344  virtual double boundarySurfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords,
345  const FEICellGeometry &cellgeo)=0;
347  virtual integrationDomain giveBoundarySurfaceIntegrationDomain(int boundary) const = 0;
354  virtual IntegrationRule *giveBoundarySurfaceIntegrationRule(int order, int boundary);
360  virtual void boundarySurfaceGiveNodes(IntArray &answer, int boundary)=0;
361 
363 
376  virtual void boundaryGiveNodes(IntArray &answer, int boundary) = 0;
386  virtual void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) = 0;
395  virtual double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) = 0;
404  virtual double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) = 0;
413  virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) = 0;
420  virtual double evalNXIntegral(int boundary, const FEICellGeometry &cellgeo) {
421  OOFEM_ERROR("Not implemented");
422  return 0.;
423  }
425  virtual integrationDomain giveBoundaryIntegrationDomain(int boundary) const = 0;
432  virtual IntegrationRule *giveBoundaryIntegrationRule(int order, int boundary) ;
433 
435 
444  virtual int giveKnotSpanBasisFuncMask(const IntArray &knotSpan, IntArray &mask) { return 0; }
449  virtual int giveNumberOfKnotSpanBasisFunctions(const IntArray &knotSpan) { return 0; }
453  virtual bool hasSubPatchFormulation() { return false; }
457  virtual const double *const *giveKnotVector() {
458  return NULL;
459  }
463  virtual int giveNumberOfKnotSpans(int dim) { return 0; }
467  virtual const FloatArray *giveKnotValues(int dim) { return NULL; }
471  virtual const IntArray *giveKnotMultiplicity(int dim) { return NULL; }
475  virtual int giveNsd() = 0;
479  virtual int giveNumberOfEdges() const
480  { OOFEM_ERROR("FEInterpolation :: giveNumberOfEdges : Not overloaded."); return -1;}
482 
486  virtual int giveNumberOfNodes() const
487  { OOFEM_ERROR("giveNumberOfNodes: Not overloaded."); return -1;}
489 
490  std :: string errorInfo(const char *func) const { return func; }
491 };
492 } // end namespace oofem
493 #endif // feinterpol_h
virtual const FloatArray * giveKnotValues(int dim)
Returns the knot values of the receiver.
Definition: feinterpol.h:467
virtual void giveLocalNodeCoords(FloatMatrix &answer)
Returns a matrix containing the local coordinates for each node corresponding to the interpolation...
Definition: feinterpol.h:199
integrationDomain
Used by integrator class to supply integration points for proper domain to be integrated (Area...
virtual void evaldNdxi(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
Definition: feinterpol.h:193
virtual void evald2Ndx2(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of second derivatives of interpolation functions (shape functions) at given poin...
Definition: feinterpol.h:183
Element_Geometry_Type
Enumerative type used to classify element geometry Possible values are: EGT_point - point in space EG...
virtual const IntArray * giveKnotMultiplicity(int dim)
Returns the knot multiplicity of the receiver.
Definition: feinterpol.h:471
Wrapper around cell with vertex coordinates stored in FloatArray**.
Definition: feinterpol.h:115
Class representing a general abstraction for cell geometry.
Definition: feinterpol.h:62
virtual int giveNumberOfKnotSpans(int dim)
Returns the number of knot spans of the receiver.
Definition: feinterpol.h:463
int giveInterpolationOrder()
Returns the interpolation order.
Definition: feinterpol.h:159
Abstract base class for all finite elements.
Definition: element.h:145
std::string errorInfo(const char *func) const
Definition: feinterpol.h:490
virtual double evalNXIntegral(int boundary, const FEICellGeometry &cellgeo)
Computes the integral .
Definition: feinterpol.h:420
virtual int giveKnotSpanBasisFuncMask(const IntArray &knotSpan, IntArray &mask)
Returns indices (zero based) of nonzero basis functions for given knot span.
Definition: feinterpol.h:444
virtual int giveNumberOfKnotSpanBasisFunctions(const IntArray &knotSpan)
Returns the number of nonzero basis functions at individual knot span,.
Definition: feinterpol.h:449
Class implementing an array of integers.
Definition: intarray.h:61
virtual int giveNumberOfNodes() const
Returns the number of geometric nodes of the receiver.
Definition: feinterpol.h:486
virtual ~FEInterpolation()
Definition: feinterpol.h:141
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: feinterpol.h:143
Abstract base class representing integration rule.
FEIElementGeometryWrapper(const Element *elem)
Definition: feinterpol.h:100
Class representing a general abstraction for finite element interpolation class.
Definition: feinterpol.h:132
#define OOFEM_ERROR(...)
Definition: error.h:61
Wrapper around element definition to provide FEICellGeometry interface.
Definition: feinterpol.h:95
virtual ~FEICellGeometry()
Definition: feinterpol.h:66
virtual bool hasSubPatchFormulation()
Returns true, if receiver is formulated on sub-patch basis.
Definition: feinterpol.h:453
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
const FloatArray & giveNodeCoordinates() const
As giveCoordinates, but non-virtual and therefore faster (because it can be inlined).
Definition: node.h:120
virtual void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Gives the jacobian matrix at the local coordinates.
Definition: feinterpol.h:232
virtual const double *const * giveKnotVector()
Returns the subdivision of patch parametric space.
Definition: feinterpol.h:457
Class representing the general Input Record.
Definition: inputrecord.h:101
Void cell geometry wrapper.
Definition: feinterpol.h:76
const FloatArray * giveVertexCoordinates(int i) const
Definition: feinterpol.h:125
int giveNumberOfVertices() const
Definition: feinterpol.h:81
virtual int giveNumberOfEdges() const
Returns number of edges.
Definition: feinterpol.h:479
const std::vector< FloatArray > & coords
Definition: feinterpol.h:118
virtual ~FEIVoidCellGeometry()
Definition: feinterpol.h:80
const FloatArray * giveVertexCoordinates(int i) const
Definition: feinterpol.h:105
FEIVertexListGeometryWrapper(const std::vector< FloatArray > &coords)
Definition: feinterpol.h:121
the oofem namespace is to define a context or scope in which all oofem names are defined.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Definition: element.h:610
std::string errorInfo(const char *func) const
Definition: feinterpol.h:89
const FloatArray * giveVertexCoordinates(int i) const
Definition: feinterpol.h:85

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:28 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011