61IntArray Hexa21Stokes :: momentum_ordering = {
62 1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19, 21, 22, 23, 25, 26, 27, 29, 30, 31, 33, 34, 35,
63 37, 38, 39, 41, 42, 43, 45, 46, 47, 49, 50, 51, 53, 54, 55, 57, 58, 59, 61, 62, 63, 65, 66, 67, 69, 70, 71,
64 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89, 90, 91, 93, 94, 95, 97, 98, 99, 101, 102, 103, 105, 106, 107};
65IntArray Hexa21Stokes :: conservation_ordering = {4, 8, 12, 16, 20, 24, 28, 32};
66IntArray Hexa21Stokes :: surf_ordering [ 6 ] = {
67 { 5, 6, 7, 1, 2, 3, 13, 14, 15, 9, 10, 11, 33, 34, 35, 42, 43, 44, 39, 40, 41, 36, 37, 38, 69, 70, 71},
68 {17, 18, 19, 21, 22, 23, 25, 26, 27, 29, 30, 31, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 72, 73, 74},
69 { 1, 2, 3, 17, 18, 19, 21, 22, 23, 5, 6, 7, 57, 58, 59, 45, 46, 47, 60, 61, 62, 33, 34, 35, 75, 76, 77},
70 { 5, 6, 7, 9, 10, 11, 25, 26, 27, 21, 22, 23, 36, 37, 38, 63, 64, 65, 48, 49, 50, 60, 61, 62, 78, 79, 80},
71 { 9, 10, 11, 13, 14, 15, 29, 30, 31, 25, 26, 27, 39, 40, 41, 66, 67, 68, 51, 52, 53, 63, 64, 65, 81, 82, 83},
72 {13, 14, 15, 1, 2, 3, 17, 18, 19, 29, 30, 31, 42, 43, 44, 57, 58, 59, 54, 55, 56, 66, 67, 68, 84, 85, 86}
81void Hexa21Stokes :: computeGaussPoints()
90int Hexa21Stokes :: computeNumberOfDofs()
95void Hexa21Stokes :: giveDofManDofIDMask(
int inode,
IntArray &answer)
const
98 answer = {V_u, V_v, V_w, P_f};
100 answer = {V_u, V_v, V_w};
108 if ( mtrx == ExternalForcesVector ) {
110 }
else if ( mtrx == InternalForcesVector ) {
113 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
121 if ( mtrx == TangentStiffnessMatrix ) {
124 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
131 FloatArray a_pressure, a_velocity, devStress, epsp, Nh, dN_V(81);
133 double r_vol, pressure;
140 const FloatArray &lcoords = gp->giveNaturalCoordinates();
144 double dV = detJ * gp->giveWeight();
147 dN_V(k + 0) = B(0, k + 0) = B(5, k + 1) = B(4, k + 2) = dN(j, 0);
148 dN_V(k + 1) = B(1, k + 1) = B(5, k + 0) = B(3, k + 2) = dN(j, 1);
149 dN_V(k + 2) = B(2, k + 2) = B(4, k + 0) = B(3, k + 1) = dN(j, 2);
155 devStress = val.first;
159 momentum.
add(-pressure * dV, dN_V);
160 conservation.
add(r_vol * dV, Nh);
176 for (
int i = 1; i <= nLoads; i++ ) {
179 Load *load = this->
domain->giveLoad(load_number);
188 for (
int i = 1; i <= nLoads; i++ ) {
201 if ( type != ExternalForcesVector ) {
212 const FloatArray &lcoords = gp->giveNaturalCoordinates();
216 double dA = detJ * gp->giveWeight();
219 for (
int j = 0; j <
N.giveSize(); j++ ) {
220 temparray(3 * j + 0) +=
N(j) * rho * gVector(0) * dA;
221 temparray(3 * j + 1) +=
N(j) * rho * gVector(1) * dA;
222 temparray(3 * j + 2) +=
N(j) * rho * gVector(2) * dA;
234 if ( type != ExternalForcesVector ) {
241 int numberOfSurfaceIPs = ( int ) ceil( ( load->
giveApproxOrder() + 1. ) / 2. ) * 2;
249 for (
auto &gp: iRule ) {
250 const FloatArray &lcoords = gp->giveNaturalCoordinates();
264 for (
int j = 0; j <
N.giveSize(); j++ ) {
265 f(3 * j + 0) +=
N(j) * t(0) * dA;
266 f(3 * j + 1) +=
N(j) * t(1) * dA;
267 f(3 * j + 2) +=
N(j) * t(2) * dA;
288 const auto &lcoords = gp->giveNaturalCoordinates();
292 auto dN = detj_dn.second;
293 auto detJ = detj_dn.first;
294 auto dA = std::abs(detJ) * gp->giveWeight();
304 K.plusProductSymmUpper(B,
dot(tangents.dsdd, B), dA);
305 G.plusDyadUnsym(dN_V, Nlin, -dA);
306 Dp.plusDyadUnsym(
Tdot(B, tangents.dsdp), Nlin, dA);
307 DvT.plusDyadUnsym(Nlin,
Tdot(B, tangents.dedd), dA);
308 C.plusDyadSymmUpper(Nlin, tangents.dedp * dA);
338void Hexa21Stokes :: updateYourself(
TimeStep *tStep)
340 Element :: updateYourself(tStep);
355 return FMElement :: giveInterface(it);
370 for (
int i = 1; i <= n.
giveSize(); i++ ) {
371 answer(0) += n.
at(i) * velocities.
at(i*3-2);
372 answer(1) += n.
at(i) * velocities.
at(i*3-1);
373 answer(2) += n.
at(i) * velocities.
at(i*3);
376 for (
int i = 1; i <= n_lin.
giveSize(); i++ ) {
377 answer(3) += n_lin.
at(i) * pressures.
at(i);
385 if ( type == IST_Pressure ) {
388 answer.
at(1) = this->
giveNode(node)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
389 }
else if ( node <= 20 ) {
392 answer.
at(1) = 0.5 * (
393 this->
giveNode( eNodes.at(1) )->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
394 this->
giveNode( eNodes.at(2) )->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) );
395 }
else if ( node <= 26 ) {
398 answer.
at(1) = 0.25 * (
399 this->
giveNode( fNodes.at(1) )->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
400 this->
giveNode( fNodes.at(2) )->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
401 this->
giveNode( fNodes.at(3) )->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
402 this->
giveNode( fNodes.at(4) )->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) );
404 answer.
at(1) = 0.125 * (
405 this->
giveNode(1)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
406 this->
giveNode(2)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
407 this->
giveNode(3)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
408 this->
giveNode(4)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
409 this->
giveNode(5)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
410 this->
giveNode(6)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
411 this->
giveNode(7)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) +
412 this->
giveNode(8)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep) );
#define REGISTER_Element(class)
bcGeomType giveBCGeoType() const override
bcType giveType() const override
void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode) override
int giveApproxOrder() override=0
Node * giveNode(int i) const
IntArray boundaryLoadArray
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
int numberOfDofMans
Number of dofmanagers.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
CrossSection * giveCrossSection()
Domain * domain
Link to domain object, useful for communicating with other FEM components.
void computeVectorOfPressures(ValueModeType mode, TimeStep *tStep, FloatArray &pressures)
void computeVectorOfVelocities(ValueModeType mode, TimeStep *tStep, FloatArray &velocities)
FMElement(int n, Domain *aDomain)
void assemble(const FloatArray &fe, const IntArray &loc)
void plusProduct(const FloatMatrix &b, const FloatArray &s, double dV)
double dotProduct(const FloatArray &x) const
Index giveSize() const
Returns the size of receiver.
void zero()
Zeroes all coefficients of receiver.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void add(const FloatArray &src)
void resize(Index rows, Index cols)
void zero()
Zeroes all coefficient of receiver.
int giveNumberOfRows() const
Returns number of rows of receiver.
void assemble(const FloatMatrix &src, const IntArray &loc)
virtual Tangents< 6 > computeTangents3D(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
virtual std::pair< FloatArrayF< 6 >, double > computeDeviatoricStress3D(const FloatArrayF< 6 > &eps, double pressure, GaussPoint *gp, TimeStep *tStep) const
int SetUpPointsOnTriangle(int nPoints, MaterialMode mode) override
virtual bcGeomType giveBCGeoType() const
virtual bcValType giveBCValType() const
static IntArray surf_ordering[6]
Ordering of dofs on surfaces. Used to assemble edge loads (only momentum balance).
void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override
void computeInternalForcesVector(FloatArray &answer, TimeStep *tStep)
void computeExternalForcesVector(FloatArray &answer, TimeStep *tStep)
void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep) override
static FEI3dHexaTriQuad interpolation_quad
Interpolation for geometry and velocity.
void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, TimeStep *tStep)
static IntArray conservation_ordering
Ordering of conservation dofs in element. Used to assemble the element stiffness.
static FEI3dHexaLin interpolation_lin
Interpolation for pressure.
static IntArray momentum_ordering
Ordering of momentum balance dofs in element. Used to assemble the element stiffness.
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
virtual FormulationType giveFormulationType()
NodalAveragingRecoveryModelInterface()
Constructor.
SpatialLocalizerInterface(Element *element)
FloatMatrixF< M, N > transpose(const FloatMatrixF< N, M > &mat)
Constructs transposed matrix.
FloatMatrixF< N, P > Tdot(const FloatMatrixF< M, N > &a, const FloatMatrixF< M, P > &b)
Computes .
@ SurfaceLoadBGT
Distributed surface load.
@ BodyLoadBGT
Distributed body load.
FloatMatrixF< 6, N *3 > Bmatrix_3d(const FloatMatrixF< 3, N > &dN)
Constructs the B matrix for 3D momentum balance problems.
double dot(const FloatArray &x, const FloatArray &y)
@ SpatialLocalizerInterfaceType
@ NodalAveragingRecoveryModelInterfaceType
@ TransmissionBC
Neumann type (prescribed flux).
FloatArrayF< N *M > flatten(const FloatMatrixF< N, M > &m)