15 #include "../config/config.hpp"
16 #include "../general/array.hpp"
32 void Set(
const double *p,
const int dim)
33 {
x = p[0];
if (dim > 1) {
y = p[1];
if (dim > 2)
z = p[2]; } }
35 void Get(
double *p,
const int dim)
const
36 { p[0] =
x;
if (dim > 1) { p[1] =
y;
if (dim > 2) p[2] =
z; } }
38 void Set(
const double x1,
const double x2,
const double x3,
const double w)
43 void Set3(
const double x1,
const double x2,
const double x3)
44 {
x = x1;
y = x2;
z = x3; }
46 void Set3(
const double *p) {
x = p[0];
y = p[1];
z = p[2]; }
48 void Set2w(
const double x1,
const double x2,
const double w)
53 void Set2(
const double x1,
const double x2) {
x = x1;
y = x2; }
55 void Set2(
const double *p) {
x = p[0];
y = p[1]; }
57 void Set1w(
const double x1,
const double w) {
x = x1;
weight = w; }
75 void GrundmannMollerSimplexRule(
int s,
int n = 3);
77 void AddTriMidPoint(
const int off,
const double weight)
80 void AddTriPoints3(
const int off,
const double a,
const double b,
88 void AddTriPoints3(
const int off,
const double a,
const double weight)
89 { AddTriPoints3(off, a, 1. - 2.*a, weight); }
91 void AddTriPoints3b(
const int off,
const double b,
const double weight)
92 { AddTriPoints3(off, (1. - b)/2., b, weight); }
94 void AddTriPoints3R(
const int off,
const double a,
const double b,
95 const double c,
const double weight)
102 void AddTriPoints3R(
const int off,
const double a,
const double b,
104 { AddTriPoints3R(off, a, b, 1. - a - b, weight); }
106 void AddTriPoints6(
const int off,
const double a,
const double b,
107 const double c,
const double weight)
117 void AddTriPoints6(
const int off,
const double a,
const double b,
119 { AddTriPoints6(off, a, b, 1. - a - b, weight); }
122 void AddTetPoints3(
const int off,
const double a,
const double b,
131 void AddTetPoints6(
const int off,
const double a,
const double b,
132 const double c,
const double weight)
142 void AddTetMidPoint(
const int off,
const double weight)
146 void AddTetPoints4(
const int off,
const double a,
const double weight)
149 AddTetPoints3(off + 1, a, 1. - 3.*a, weight);
153 void AddTetPoints4b(
const int off,
const double b,
const double weight)
155 const double a = (1. - b)/3.;
157 AddTetPoints3(off + 1, a, b, weight);
161 void AddTetPoints6(
const int off,
const double a,
const double weight)
163 const double b = 0.5 - a;
164 AddTetPoints3(off, a, b, weight);
165 AddTetPoints3(off + 3, b, a, weight);
169 void AddTetPoints12(
const int off,
const double a,
const double bc,
172 const double cb = 1. - 2*a - bc;
173 AddTetPoints3(off, a, bc, weight);
174 AddTetPoints3(off + 3, a, cb, weight);
175 AddTetPoints6(off + 6, a, bc, cb, weight);
179 void AddTetPoints12bc(
const int off,
const double b,
const double c,
182 const double a = (1. - b - c)/2.;
183 AddTetPoints3(off, a, b, weight);
184 AddTetPoints3(off + 3, a, c, weight);
185 AddTetPoints6(off + 6, a, b, c, weight);
194 for (
int i = 0; i < this->
Size(); i++)
218 int own_rules, refined;
229 if (ir_array.
Size() <= Order)
230 ir_array.
SetSize(Order + 1, NULL);
234 return (ir_array.
Size() > Order && ir_array[Order] != NULL);
int GetNPoints() const
Returns the number of the points in the integration rule.
void Set(const double *p, const int dim)
int Size() const
Logical size of the array.
void Get(double *p, const int dim) const
Class for integration rule.
const IntegrationRule & Get(int GeomType, int Order)
Returns an integration rule for given GeomType and Order.
void Set1w(const double *p)
~IntegrationRules()
Destroys an IntegrationRules object.
Container class for integration rules.
void Set(const double x1, const double x2, const double x3, const double w)
const IntegrationPoint & IntPoint(int i) const
Returns a const reference to the i-th integration point.
void Set3(const double *p)
IntegrationPoint & IntPoint(int i)
Returns a reference to the i-th integration point.
IntegrationRules IntRules(0)
A global object with all integration rules (defined in intrules.cpp)
IntegrationRules(int Ref=0)
~IntegrationRule()
Destroys an IntegrationRule object.
void Set3w(const double *p)
void Set2(const double x1, const double x2)
void Set3(const double x1, const double x2, const double x3)
void Set2w(const double *p)
void SetSize(int nsize)
Change logical size of the array, keep existing entries.
Class for integration point with weight.
void Set2(const double *p)
IntegrationRules RefinedIntRules(1)
A global object with all refined integration rules.
void Set2w(const double x1, const double x2, const double w)
IntegrationRule(int NP)
Construct an integration rule with given number of points.
void Set(int GeomType, int Order, IntegrationRule &IntRule)
void Set1w(const double x1, const double w)