OOFEM 3.0
Loading...
Searching...
No Matches
feibspline.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 - 2025 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 feibspline_h
36#define feibspline_h
37
38#include "feinterpol.h"
39#include "floatarray.h"
40#include <array>
41
43
44#define _IFT_BSplineInterpolation_degree "degree"
45#define _IFT_BSplineInterpolation_knotVectorU "knotvectoru"
46#define _IFT_BSplineInterpolation_knotVectorV "knotvectorv"
47#define _IFT_BSplineInterpolation_knotVectorW "knotvectorw"
48#define _IFT_BSplineInterpolation_knotMultiplicityU "knotmultiplicityu"
49#define _IFT_BSplineInterpolation_knotMultiplicityV "knotmultiplicityv"
50#define _IFT_BSplineInterpolation_knotMultiplicityW "knotmultiplicityw"
52
53namespace oofem {
54class FloatMatrix;
55class FloatArray;
56class IntArray;
57class ParamKey;
58
63{
64protected:
66 int nsd;
68 std::array<int, 3> degree; // eg. 2
70 std::array<FloatArray, 3> knotValues; // eg. 0 1 2 3 4 5
72 std::array<IntArray, 3> knotMultiplicity; // eg. 3 1 1 1 2 3
74
78 std::array<int, 3> numberOfControlPoints;
80 std::array<FloatArray, 3> knotVector; // eg. 0 0 0 1 2 3 4 4 5 5 5
82 std::array<int, 3> numberOfKnotSpans; // eg. 5 (0-1,1-2,2-3,3-4,4-5)
83
91
92public:
96
98 if ( nsd == 3 ) {
99 return _Cube;
100 } else if ( nsd == 2 ) {
101 return _Square;
102 } else if ( nsd == 1 ) {
103 return _Line;
104 } else {
106 }
107 }
108 const Element_Geometry_Type giveGeometryType() const override { return EGT_unknown; }
109 const Element_Geometry_Type giveBoundaryGeometryType(int boundary) const override { return EGT_unknown; }
110
111
113 if ( nsd == 3 ) {
114 return _Square;
115 } else if ( nsd == 2 ) {
116 return _Line;
117 } else if ( nsd == 1 ) {
118 return _Point;
119 } else {
121 }
122 }
124 if ( nsd == 3 ) {
125 return _Square;
126 } else if ( nsd == 2 ) {
127 return _Square;
128 } else {
130 }
131 }
133 if ( nsd >= 2 ) {
134 return _Line;
135 } else {
137 }
138 }
139
140 int giveNsd(const Element_Geometry_Type) const override { return nsd; }
141 void initializeFrom(InputRecord &ir, ParameterManager&pm, int elnum, int priority) override;
142 void postInitialize(ParameterManager&pm, int elnum) override;
143
144 IntArray boundaryEdgeGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const override
145 { OOFEM_ERROR("Functions not supported for this interpolator.");}
146 void boundaryEdgeEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
147 { OOFEM_ERROR("Functions not supported for this interpolator."); }
148 double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
149 { OOFEM_ERROR("Functions not supported for this interpolator.");}
150 void boundaryEdgeLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
151 { OOFEM_ERROR("Functions not supported for this interpolator."); }
152 double boundaryEdgeEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
153 { OOFEM_ERROR("Functions not supported for this interpolator."); }
154
155
158 void boundarySurfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
159 { OOFEM_ERROR("Functions not supported for this interpolator."); }
160 void boundarySurfaceEvaldNdx(FloatMatrix &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
161 { OOFEM_ERROR("Functions not supported for this interpolator."); }
162 double boundarySurfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
163 { OOFEM_ERROR("Functions not supported for this interpolator."); }
164 void boundarySurfaceLocal2global(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
165 { OOFEM_ERROR("Functions not supported for this interpolator."); }
166 double boundarySurfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
167 { OOFEM_ERROR("Functions not supported for this interpolator."); }
168 IntArray boundarySurfaceGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const override
169 { OOFEM_ERROR("Functions not supported for this interpolator.");}
170
171
172
173 IntArray boundaryGiveNodes(int boundary, const Element_Geometry_Type) const override
174 { OOFEM_ERROR("Not implemented"); }
175 void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
176 { OOFEM_ERROR("Not implemented"); }
177 double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
178 { OOFEM_ERROR("Not implemented"); }
179 double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
180 { OOFEM_ERROR("boundaryGiveTransformationJacobian - Not implemented"); }
181 void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
182 { OOFEM_ERROR("boundaryLocal2Global - Not implemented"); }
183
184
185 int giveNumberOfKnotSpans(int dim) const override { return numberOfKnotSpans [ dim - 1 ]; }
186 virtual int giveNumberOfControlPoints(int dim) const { return numberOfControlPoints [ dim - 1 ]; }
187 const FloatArray *giveKnotVector() const override {
188 return this->knotVector.data();
189 }
190 const IntArray *giveKnotMultiplicity(int dim) const override { return & this->knotMultiplicity [ dim - 1 ]; }
191 const FloatArray *giveKnotValues(int dim) const override { return & this->knotValues [ dim - 1 ]; }
192 void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override;
193 double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override;
194 void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override;
195 int global2local(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override {
196 OOFEM_ERROR("Not yet implemented.");
197 }
198 void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override;
199 int giveKnotSpanBasisFuncMask(const IntArray &knotSpan, IntArray &mask) const override;
200 int giveNumberOfKnotSpanBasisFunctions(const IntArray &knotSpan) const override;
201
202 const char *giveClassName() const { return "BSplineInterpolation"; }
203 bool hasSubPatchFormulation() const override { return true; }
204
205 std::unique_ptr<IntegrationRule> giveIntegrationRule(int order, const Element_Geometry_Type) const override
206 { OOFEM_ERROR("Not supported."); }
207 std::unique_ptr<IntegrationRule> giveBoundaryIntegrationRule(int order, int boundary, Element_Geometry_Type) const override
208 { OOFEM_ERROR("Not supported."); }
209 std::unique_ptr<IntegrationRule> giveBoundaryEdgeIntegrationRule(int order, int boundary, Element_Geometry_Type) const override
210 { OOFEM_ERROR("Not supported."); }
211
212protected:
222 void basisFuns(FloatArray &N, int span, double u, int p, const FloatArray &U) const;
244 void dersBasisFuns(int n, double u, int span, int p, const FloatArray &U, FloatMatrix &ders) const;
259 int findSpan(int n, int p, double u, const FloatArray &U) const;
263 void giveNonzeroBasisFuncInterval(int span, int deg, int &s, int &e) const {
264 s = span - deg;
265 e = span;
266 }
267};
268} // end namespace oofem
269#endif // feibspline_h
#define N(a, b)
int giveNsd(const Element_Geometry_Type) const override
Definition feibspline.h:140
const Element_Geometry_Type giveGeometryType() const override
Definition feibspline.h:108
std::array< int, 3 > numberOfKnotSpans
Nonzero spans in each directions [nsd].
Definition feibspline.h:82
static ParamKey IPK_BSplineInterpolation_degree
Definition feibspline.h:84
void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:175
double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:148
integrationDomain giveBoundaryIntegrationDomain(int ib, const Element_Geometry_Type) const override
Returns boundary integration domain.
Definition feibspline.h:112
std::array< int, 3 > degree
Degree in each direction.
Definition feibspline.h:68
double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:177
std::array< FloatArray, 3 > knotVector
Knot vectors [nsd][knot_vector_size].
Definition feibspline.h:80
std::array< int, 3 > numberOfControlPoints
numberOfControlPoints[nsd]
Definition feibspline.h:78
void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:181
virtual int giveNumberOfControlPoints(int dim) const
Definition feibspline.h:186
double boundarySurfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:166
const Element_Geometry_Type giveBoundaryGeometryType(int boundary) const override
Definition feibspline.h:109
bool hasSubPatchFormulation() const override
Definition feibspline.h:203
static ParamKey IPK_BSplineInterpolation_knotMultiplicityV
Definition feibspline.h:89
void boundaryEdgeEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:146
std::unique_ptr< IntegrationRule > giveIntegrationRule(int order, const Element_Geometry_Type) const override
Definition feibspline.h:205
static ParamKey IPK_BSplineInterpolation_knotVectorV
Definition feibspline.h:86
std::unique_ptr< IntegrationRule > giveBoundaryEdgeIntegrationRule(int order, int boundary, Element_Geometry_Type) const override
Definition feibspline.h:209
IntArray boundarySurfaceGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const override
Definition feibspline.h:168
const char * giveClassName() const
Definition feibspline.h:202
IntArray boundaryGiveNodes(int boundary, const Element_Geometry_Type) const override
Definition feibspline.h:173
void boundarySurfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:158
static ParamKey IPK_BSplineInterpolation_knotVectorW
Definition feibspline.h:87
int giveNumberOfKnotSpans(int dim) const override
Definition feibspline.h:185
const FloatArray * giveKnotValues(int dim) const override
Definition feibspline.h:191
static ParamKey IPK_BSplineInterpolation_knotVectorU
Definition feibspline.h:85
void boundarySurfaceLocal2global(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:164
std::unique_ptr< IntegrationRule > giveBoundaryIntegrationRule(int order, int boundary, Element_Geometry_Type) const override
Definition feibspline.h:207
void giveNonzeroBasisFuncInterval(int span, int deg, int &s, int &e) const
Definition feibspline.h:263
integrationDomain giveBoundarySurfaceIntegrationDomain(int isurf, const Element_Geometry_Type) const override
Returns boundary integration domain.
Definition feibspline.h:123
int global2local(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:195
double boundarySurfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:162
std::array< IntArray, 3 > knotMultiplicity
Knot multiplicity [nsd].
Definition feibspline.h:72
integrationDomain giveIntegrationDomain(const Element_Geometry_Type egt) const override
Definition feibspline.h:97
integrationDomain giveBoundaryEdgeIntegrationDomain(int iedge, const Element_Geometry_Type) const override
Returns boundary integration domain.
Definition feibspline.h:132
static ParamKey IPK_BSplineInterpolation_knotMultiplicityW
Definition feibspline.h:90
const FloatArray * giveKnotVector() const override
Definition feibspline.h:187
const IntArray * giveKnotMultiplicity(int dim) const override
Definition feibspline.h:190
void boundaryEdgeLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:150
static ParamKey IPK_BSplineInterpolation_knotMultiplicityU
Definition feibspline.h:88
int nsd
Number of spatial directions.
Definition feibspline.h:66
IntArray boundaryEdgeGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const override
Definition feibspline.h:144
std::array< FloatArray, 3 > knotValues
Knot values [nsd].
Definition feibspline.h:70
double boundaryEdgeEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:152
double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:179
void boundarySurfaceEvaldNdx(FloatMatrix &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
Definition feibspline.h:160
const double * data() const
Definition floatarray.h:130
#define OOFEM_ERROR(...)
Definition error.h:79
@ _UnknownIntegrationDomain
#define OOFEM_EXPORT
Definition oofemcfg.h:7

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011