61IntArray Tet21Stokes :: momentum_ordering = {1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19,
62 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34};
63IntArray Tet21Stokes :: conservation_ordering = {4, 8, 12, 16};
64IntArray Tet21Stokes :: surf_ordering [ 4 ] = {
65 { 1, 2, 3, 9, 10, 11, 5, 6, 7, 23, 24, 25, 20, 21, 22, 17, 18, 19},
66 { 1, 2, 3, 5, 6, 7, 13, 14, 15, 17, 18, 19, 29, 30, 31, 26, 27, 28},
67 { 5, 6, 7, 9, 10, 11, 13, 14, 15, 20, 21, 22, 32, 33, 34, 29, 30, 31},
68 { 1, 2, 3, 13, 14, 15, 9, 10, 11, 26, 27, 28, 32, 33, 34, 23, 24, 25}
77void Tet21Stokes :: computeGaussPoints()
86int Tet21Stokes :: computeNumberOfDofs()
91void Tet21Stokes :: giveDofManDofIDMask(
int inode,
IntArray &answer)
const
94 answer = {V_u, V_v, V_w, P_f};
96 answer = {V_u, V_v, V_w};
104 if ( mtrx == ExternalForcesVector ) {
106 }
else if ( mtrx == InternalForcesVector ) {
109 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
117 if ( mtrx == TangentStiffnessMatrix ) {
120 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
127 FloatArray a_pressure, a_velocity, devStress, epsp, Nh, dN_V(30);
129 double r_vol, pressure;
136 const FloatArray &lcoords = gp->giveNaturalCoordinates();
140 double dV = detJ * gp->giveWeight();
143 dN_V(k + 0) = B(0, k + 0) = B(3, k + 1) = B(4, k + 2) = dN(j, 0);
144 dN_V(k + 1) = B(1, k + 1) = B(3, k + 0) = B(5, k + 2) = dN(j, 1);
145 dN_V(k + 2) = B(2, k + 2) = B(4, k + 0) = B(5, k + 1) = dN(j, 2);
151 devStress = val.first;
155 momentum.
add(-pressure * dV, dN_V);
156 conservation.
add(r_vol * dV, Nh);
167 int load_number, load_id;
176 for (
int i = 1; i <= nLoads; i++ ) {
179 load = this->
domain->giveLoad(load_number);
189 for (
int i = 1; i <= nLoads; i++ ) {
191 if ((bLoad=
dynamic_cast<BodyLoad*
>(load))) {
203 if ( type != ExternalForcesVector ) {
214 const FloatArray &lcoords = gp->giveNaturalCoordinates();
218 double dA = detJ * gp->giveWeight();
221 for (
int j = 0; j <
N.giveSize(); j++ ) {
222 temparray(3 * j + 0) +=
N(j) * rho * gVector(0) * dA;
223 temparray(3 * j + 1) +=
N(j) * rho * gVector(1) * dA;
224 temparray(3 * j + 2) +=
N(j) * rho * gVector(2) * dA;
236 if ( type != ExternalForcesVector ) {
246 int numberOfSurfaceIPs = ( int ) ceil( ( load->
giveApproxOrder() + 1. ) / 2. ) * 2;
254 for (
auto &gp: iRule ) {
255 const FloatArray &lcoords = gp->giveNaturalCoordinates();
269 for (
int j = 0; j <
N.giveSize(); j++ ) {
270 f(3 * j + 0) +=
N(j) * t(0) * dA;
271 f(3 * j + 1) +=
N(j) * t(1) * dA;
272 f(3 * j + 2) +=
N(j) * t(2) * dA;
291 const auto &lcoords = gp->giveNaturalCoordinates();
295 auto dN = detj_dn.second;
296 auto detJ = detj_dn.first;
297 auto dA = std::abs(detJ) * gp->giveWeight();
307 K.plusProductSymmUpper(B,
dot(tangents.dsdd, B), dA);
308 G.plusDyadUnsym(dN_V, Nlin, -dA);
309 Dp.plusDyadUnsym(
Tdot(B, tangents.dsdp), Nlin, dA);
310 DvT.plusDyadUnsym(Nlin,
Tdot(B, tangents.dedd), dA);
311 C.plusDyadSymmUpper(Nlin, tangents.dedp * dA);
343 Element :: updateYourself(tStep);
361 return FMElement :: giveInterface(it);
365void Tet21Stokes :: EIPrimaryUnknownMI_computePrimaryUnknownVectorAtLocal(ValueModeType mode,
373 for (
int i = 1; i <= n.
giveSize(); i++ ) {
374 answer(0) += n.
at(i) * this->
giveNode(i)->giveDofWithID(V_u)->giveUnknown(mode, tStep);
375 answer(1) += n.
at(i) * this->
giveNode(i)->giveDofWithID(V_v)->giveUnknown(mode, tStep);
376 answer(2) += n.
at(i) * this->
giveNode(i)->giveDofWithID(V_w)->giveUnknown(mode, tStep);
379 for (
int i = 1; i <= n_lin.
giveSize(); i++ ) {
380 answer(3) += n_lin.
at(i) * this->
giveNode(i)->giveDofWithID(P_f)->giveUnknown(mode, tStep);
386 if ( type == IST_Pressure ) {
389 answer.
at(1) = this->
giveNode(node)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
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) );
#define REGISTER_Element(class)
bcType giveType() const override
void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode) override
int giveApproxOrder() override=0
EIPrimaryUnknownMapperInterface()
Node * giveNode(int i) const
IntArray boundaryLoadArray
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
int numberOfDofMans
Number of dofmanagers.
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
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
virtual FormulationType giveFormulationType()
NodalAveragingRecoveryModelInterface()
Constructor.
SpatialLocalizerInterface(Element *element)
void computeExternalForcesVector(FloatArray &answer, TimeStep *tStep)
void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override
static IntArray conservation_ordering
Ordering of conservation dofs in element. Used to assemble the element stiffness.
void computeInternalForcesVector(FloatArray &answer, TimeStep *tStep)
static IntArray momentum_ordering
Ordering of momentum balance dofs in element. Used to assemble the element stiffness.
static FEI3dTetQuad interpolation_quad
Interpolation for geometry and velocity.
static IntArray surf_ordering[4]
Ordering of dofs on surfaces. Used to assemble edge loads (only momentum balance).
static FEI3dTetLin interpolation_lin
Interpolation for pressure.
void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, TimeStep *tStep)
void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep) override
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 .
bcGeomType
Type representing the geometric character of loading.
@ 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
@ EIPrimaryUnknownMapperInterfaceType
@ TransmissionBC
Neumann type (prescribed flux).
FloatArrayF< N *M > flatten(const FloatMatrixF< N, M > &m)