48 double u = lcoords[0];
49 double v = lcoords[1];
50 double w = lcoords[2];
51 double x = 1. - u - v;
73 answer.
at(1) = 0.5 * ( 1. - w ) * ( 1. - u - v );
74 answer.
at(2) = 0.5 * ( 1. - w ) * u;
75 answer.
at(3) = 0.5 * ( 1. - w ) * v;
76 answer.
at(4) = 0.5 * ( 1. + w ) * ( 1. - u - v );
77 answer.
at(5) = 0.5 * ( 1. + w ) * u;
78 answer.
at(6) = 0.5 * ( 1. + w ) * v;
85 double u = lcoords.
at(1);
86 double v = lcoords.
at(2);
87 double w = lcoords.
at(3);
88 double x = 1. - u - v;
116 double u = lcoords.
at(1);
117 double v = lcoords.
at(2);
118 double w = lcoords.
at(3);
122 dN.
at(1, 1) = -0.5 * ( 1. - w );
123 dN.
at(2, 1) = 0.5 * ( 1. - w );
125 dN.
at(4, 1) = -0.5 * ( 1. + w );
126 dN.
at(5, 1) = 0.5 * ( 1. + w );
129 dN.
at(1, 2) = -0.5 * ( 1. - w );
131 dN.
at(3, 2) = 0.5 * ( 1. - w );
132 dN.
at(4, 2) = -0.5 * ( 1. + w );
134 dN.
at(6, 2) = 0.5 * ( 1. + w );
136 dN.
at(1, 3) = -0.5 * ( 1. - u - v );
137 dN.
at(2, 3) = -0.5 * u;
138 dN.
at(3, 3) = -0.5 * v;
139 dN.
at(4, 3) = 0.5 * ( 1. - u - v );
140 dN.
at(5, 3) = 0.5 * u;
141 dN.
at(6, 3) = 0.5 * v;
145std::pair<double, FloatMatrixF<3,6>>
150 for (
int i = 0; i < 6; i++ ) {
153 auto jacT =
dotT(dNduvw, coords);
154 return {
det(jacT),
dot(
inv(jacT), dNduvw)};
163 this->
evaldNdxi(dNduvw, lcoords, cellgeo);
165 for (
int i = 1; i <= 6; i++ ) {
169 inv.beInverseOf(jacobianMatrix);
181 this->
evalN(n, lcoords, cellgeo);
184 for (
int i = 1; i <= 6; i++ ) {
198#define POINT_TOL 1.e-3
205 double convergence_limit, error = 0.0;
215 for (
int nite = 0; nite < 10; nite++ ) {
222 if ( error < convergence_limit ) {
233 if ( error > convergence_limit ) {
235 answer =
Vec3(1. / 3., 1. / 3., 1. / 3.);
241 for (
int i = 1; i <= answer.
giveSize(); i++ ) {
270 this->
evaldNdxi(dNduvw, lcoords, cellgeo);
272 for (
int i = 1; i <= 6; i++ ) {
273 coords.
setColumn(cellgeo.giveVertexCoordinates(i), i);
275 jacobianMatrix.beProductOf(coords, dNduvw);
282 double ksi = lcoords.
at(1);
284 answer.
at(1) = ( 1. - ksi ) * 0.5;
285 answer.
at(2) = ( 1. - ksi ) * 0.5;
302 this->
edgeEvalN(n, iedge, lcoords, cellgeo);
305 for (
int i = 1; i <= n.
giveSize(); ++i ) {
312FEI3dWedgeLin :: computeLocalEdgeMapping(
int iedge)
const
316 }
else if ( iedge == 2 ) {
318 }
else if ( iedge == 3 ) {
320 }
else if ( iedge == 4 ) {
322 }
else if ( iedge == 5 ) {
324 }
else if ( iedge == 6 ) {
326 }
else if ( iedge == 7 ) {
328 }
else if ( iedge == 8 ) {
330 }
else if ( iedge == 9 ) {
333 throw std::range_error(
"invalid edge number");
350 double ksi = lcoords.
at(1);
351 double eta = lcoords.
at(2);
357 answer.
at(3) = 1.0 - ksi - eta;
360 answer.
at(1) = ( 1. + ksi ) * ( 1. + eta ) * 0.25;
361 answer.
at(2) = ( 1. - ksi ) * ( 1. + eta ) * 0.25;
362 answer.
at(3) = ( 1. - ksi ) * ( 1. - eta ) * 0.25;
363 answer.
at(4) = ( 1. + ksi ) * ( 1. - eta ) * 0.25;
369FEI3dWedgeLin :: surfaceLocal2global(
FloatArray &answer,
int isurf,
378 for (
int i = 1; i <= n.
giveSize(); ++i ) {
385FEI3dWedgeLin :: computeLocalSurfaceMapping(
int isurf)
const
389 }
else if ( isurf == 2 ) {
391 }
else if ( isurf == 3 ) {
393 }
else if ( isurf == 4 ) {
395 }
else if ( isurf == 5 ) {
398 throw std::range_error(
"invalid surface number");
405FEI3dWedgeLin :: surfaceGiveTransformationJacobian(
int isurf,
const FloatArray &lcoords,
413std::unique_ptr<IntegrationRule>
416 auto iRule = std::make_unique<GaussIntegrationRule>(1,
nullptr);
421 int pointsTriangle = 1;
422 iRule->SetUpPointsOnWedge(pointsTriangle, pointsZeta, _Unknown);
423 return std::move(iRule);
427std::unique_ptr<IntegrationRule>
430 auto iRule = std::make_unique<GaussIntegrationRule>(1,
nullptr);
431 if ( boundary <= 2 ) {
432 int points = iRule->getRequiredNumberOfIntegrationPoints(
_Triangle,
order + 0);
433 iRule->SetUpPointsOnTriangle(points, _Unknown);
435 int points = iRule->getRequiredNumberOfIntegrationPoints(
_Square,
order + 2);
436 iRule->SetUpPointsOnSquare(points, _Unknown);
438 return std::move(iRule);
void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
IntArray computeLocalSurfaceMapping(int iSurf) const override
void giveJacobianMatrixAt(FloatMatrix &jacobianMatrix, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
static FloatArrayF< 6 > evalN(const FloatArrayF< 3 > &lcoords)
void edgeEvalN(FloatArray &answer, int iedge, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
IntArray computeLocalEdgeMapping(int iedge) const override
void surfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const override
static FloatMatrixF< 3, 6 > evaldNdxi(const FloatArrayF< 3 > &lcoords)
double giveCharacteristicLength(const FEICellGeometry &cellgeo) const
virtual const FloatArray giveVertexCoordinates(int i) const =0
double & at(std::size_t i)
double computeNorm() const
Index giveSize() const
Returns the size of receiver.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
void zero()
Zeroes all coefficients of receiver.
void add(const FloatArray &src)
void setColumn(const FloatArrayF< N > &src, std::size_t c)
void resize(Index rows, Index cols)
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
void setColumn(const FloatArray &src, int c)
double giveDeterminant() const
double at(std::size_t i, std::size_t j) const
bool solveForRhs(const FloatArray &b, FloatArray &answer, bool transpose=false)
#define OOFEM_WARNING(...)
FloatMatrixF< N, P > dotT(const FloatMatrixF< N, M > &a, const FloatMatrixF< P, M > &b)
Computes .
double det(const FloatMatrixF< 2, 2 > &mat)
Computes the determinant.
double dot(const FloatArray &x, const FloatArray &y)
FloatMatrixF< N, N > inv(const FloatMatrixF< N, N > &mat, double zeropiv=1e-24)
Computes the inverse.
double distance(const FloatArray &x, const FloatArray &y)
static FloatArray Vec3(const double &a, const double &b, const double &c)