BSIQuadrature.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
11 //#include <Geom/msgeomstructs_typedefs.h>
12 
13 #ifdef __cplusplus
14 
18 class GEOMDLLIMPEXP BSIVectorIntegrand
19 {
20 public:
22 GEOMAPI_VIRTUAL void EvaluateVectorIntegrand (double t, double *pF) = 0;
23 GEOMAPI_VIRTUAL int GetVectorIntegrandCount () = 0;
24 };
25 
30 {
31 public:
33 // Return true to continue integration.
34 GEOMAPI_VIRTUAL bool AnnounceIntermediateIntegral (double t, double *pIntegrals) = 0;
35 };
36 
37 
39 {
40 public:
41 GEOMAPI_VIRTUAL void EvaluateVectorIntegrand (double x, double y, double *pF) = 0;
43 };
44 
45 
51 struct GEOMDLLIMPEXP BSIQuadraturePoints
52 {
53 private:
54  static int const MaxPoints = 20;
55  double mWi[MaxPoints];
56  double mUi[MaxPoints];
57  int mNumEval;
58 
59  double mU0, mU1; // Limits of idealized interval.
60  double mDivDU; // Precomputed 1/ (mU1 - mU0);
61  double mConvergencePower; // Expected degree of convergence.
62 
63  bool AddEval (double u, double w);
64  void Init(double u0, double u1);
65 public:
66 
77 int InitUniform (int numEval);
78 
84 int InitGauss (int numEval);
85 
90 int InitGaussLobatto (int numEval);
91 
97 int InitGaussKronrod (int numEval, BSIQuadraturePoints &gaussPartner);
98 
111 bool GetEval (int i, double a0, double a1, double &a, double &w) const;
112 
125 static bool GetXYEval (
126  BSIQuadraturePoints const &xRule, int ix, double x0, double x1,
127  BSIQuadraturePoints const &yRule, int iy, double y0, double y1,
128  double &x, double &y, double &w
129  );
130 
131 
132 
136 int GetNumEval () const;
137 
142 double GetConvergencePower () const;
143 
152 void AccumulateWeightedSums
153 (
154 BSIVectorIntegrand &function,
155 double t0,
156 double t1,
157 double *pSums,
158 int numInterval
159 );
160 
161 /*----------------------------------------------------------------*/
180 bool IntegrateWithRombergExtrapolation
181 (
183 double t0,
184 double t1,
185 uint32_t numInterval,
186 double &totalErrorBound
187 );
192 };
193 
194 
195 
201 struct GEOMDLLIMPEXP BSITriangleQuadraturePoints
202 {
203 private:
204  static int const MaxPoints = 20;
205  double mWi[MaxPoints];
206  double mUi[MaxPoints];
207  double mVi[MaxPoints];
208  int mNumEval;
209 
210  double mConvergencePower; // Expected degree of convergence.
211 
212  bool AddEval (double u, double v, double w);
213  void Init();
214 public:
215 
216 
231 int InitStrang (int selector);
232 
242 bool GetEval (int i, double &u, double &v, double &w) const;
243 
247 int GetNumEval () const;
248 
253 double GetConvergencePower () const;
254 
260 
261 void AccumulateWeightedSums(BSIVectorIntegrandXY &function, double *pSums);
262 
263 void AccumulateWeightedSumsMapped
264  (
265  BSIVectorIntegrandXY &function, double *pSums,
266  double ax, double ay,
267  double bx, double by,
268  double cx, double cy
269  );
270 
271 };
272 
273 
274 
275 #endif
GEOMAPI_VIRTUAL void EvaluateVectorIntegrand(double x, double y, double *pF)=0
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
Abstract interface for multi-variate function of a single variable.
Definition: BSIQuadrature.h:18
Definition: BSIQuadrature.h:38
Support class for numerical quadature Constructor BSIQuadraturePoints () initializes for Simpson's ru...
Definition: BSIQuadrature.h:51
Abstract interface for multi-variate function of a single variable.
Definition: BSIQuadrature.h:29
#define GEOMAPI_VIRTUAL
Definition: GeomApi.h:18
GEOMAPI_VIRTUAL ~BSIVectorIntegrand()
Definition: BSIQuadrature.h:21
Support class for numerical quadature OVER TRIANGLE Constructor BSIQuadraturePoints () initializes fo...
Definition: BSIQuadrature.h:201
GEOMAPI_VIRTUAL ~BSIIncrementalVectorIntegrand()
Definition: BSIQuadrature.h:32
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
unsigned int uint32_t
Definition: Bentley.r.h:93
GEOMAPI_VIRTUAL int GetVectorIntegrandCount()=0

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.