58FEI2dTrLin Tr21Stokes :: interpolation_lin(1, 2);
61IntArray Tr21Stokes :: momentum_ordering = {1, 2, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15};
62IntArray Tr21Stokes :: conservation_ordering = {3, 6, 9};
63IntArray Tr21Stokes :: edge_ordering [ 3 ] = {
73 this->numberOfGaussPoints = 3;
75 this->numberOfGaussPoints = 4;
79void Tr21Stokes :: computeGaussPoints()
88int Tr21Stokes :: computeNumberOfDofs()
93void Tr21Stokes :: giveDofManDofIDMask(
int inode,
IntArray &answer)
const
96 answer = {V_u, V_v, P_f};
112 if ( mtrx == ExternalForcesVector ) {
114 }
else if ( mtrx == InternalForcesVector ) {
117 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
125 if ( mtrx == TangentStiffnessMatrix ) {
128 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
143 const auto &lcoords = gp->giveNaturalCoordinates();
147 auto detJ = val.first;
148 auto dN = val.second;
149 auto dA = std::abs(detJ) * gp->giveWeight();
154 auto pressure =
dot(Nh, a_pressure);
155 auto epsp =
dot(B, a_velocity);
158 auto devStress = s_r.first;
159 auto r_vol = s_r.second;
161 momentum +=
Tdot(B, devStress * dA) + dNv * (-pressure * dA);
162 conservation += Nh * (r_vol * dA);
178 for (
int i = 1; i <= nLoads; i++ ) {
181 Load *load = this->
domain->giveLoad(load_number);
191 for (
int i = 1; i <= nLoads; i++ ) {
194 if ((bload =
dynamic_cast<BodyLoad*
>(load))) {
206 if ( type != ExternalForcesVector ) {
218 const FloatArray &lcoords = gp->giveNaturalCoordinates();
220 double rho = mat->
give(
'd', gp);
222 double dA = detJ * gp->giveWeight();
225 for (
int j = 0; j < 6; j++ ) {
226 temparray(2 * j) +=
N(j) * rho * gVector(0) * dA;
227 temparray(2 * j + 1) +=
N(j) * rho * gVector(1) * dA;
239 if ( type != ExternalForcesVector ) {
246 int numberOfEdgeIPs = ( int ) ceil( ( load->
giveApproxOrder() + 1. ) / 2. ) * 2;
254 for (
auto &gp: iRule ) {
255 const FloatArray &lcoords = gp->giveNaturalCoordinates();
259 double dS = gp->giveWeight() * detJ;
270 for (
int j = 0; j < 3; j++ ) {
271 f(2 * j) +=
N(j) * t(0) * dS;
272 f(2 * j + 1) +=
N(j) * t(1) * dS;
294 const auto &lcoords = gp->giveNaturalCoordinates();
298 auto dN = detj_dn.second;
299 auto detJ = detj_dn.first;
300 auto dA = std::abs(detJ) * gp->giveWeight();
310 K.plusProductSymmUpper(B,
dot(tangents.dsdd, B), dA);
311 G.plusDyadUnsym(dN_V, Nlin, -dA);
312 Dp.plusDyadUnsym(
Tdot(B, tangents.dsdp), Nlin, dA);
313 DvT.plusDyadUnsym(Nlin,
Tdot(B, tangents.dedd), dA);
314 C.plusDyadSymmUpper(Nlin, tangents.dedp * dA);
346 Element :: updateYourself(tStep);
364 return FMElement :: giveInterface(it);
378 for (
int i = 1; i <= n.
giveSize(); i++ ) {
379 answer(0) += n.
at(i) * velocities.
at(i*2-1);
380 answer(1) += n.
at(i) * velocities.
at(i*2);
383 for (
int i = 1; i <= n_lin.
giveSize(); i++ ) {
384 answer(2) += n_lin.
at(i) * pressures.
at(i);
391 if ( type == IST_Pressure ) {
393 if ( node == 1 || node == 2 || node == 3 ) {
394 answer.
at(1) = this->
giveNode(node)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
398 a = this->
giveNode(1)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
399 b = this->
giveNode(2)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
400 }
else if ( node == 5 ) {
401 a = this->
giveNode(2)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
402 b = this->
giveNode(3)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
404 a = this->
giveNode(3)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
405 b = this->
giveNode(1)->giveDofWithID(P_f)->giveUnknown(VM_Total, tStep);
408 answer.
at(1) = ( a + b ) / 2;
#define REGISTER_Element(class)
bcType giveType() const override
void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode) override
int giveApproxOrder() override=0
EngngModel * giveEngngModel()
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()
problemScale giveProblemScale() const
Returns scale in multiscale simulation.
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)
Index giveSize() const
Returns the size of receiver.
void zero()
Zeroes all coefficients of receiver.
void add(const FloatArray &src)
void resize(Index rows, Index cols)
void zero()
Zeroes all coefficient of receiver.
void assemble(const FloatMatrix &src, const IntArray &loc)
virtual std::pair< FloatArrayF< 3 >, double > computeDeviatoricStress2D(const FloatArrayF< 3 > &eps, double pressure, GaussPoint *gp, TimeStep *tStep) const
virtual Tangents< 3 > computeTangents2D(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
int SetUpPointsOnLine(int nPoints, MaterialMode mode) override
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
double giveWeight()
Returns integration weight of receiver.
virtual bcGeomType giveBCGeoType() const
virtual bcValType giveBCValType() const
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
virtual FormulationType giveFormulationType()
virtual double give(int aProperty, GaussPoint *gp) const
NodalAveragingRecoveryModelInterface()
Constructor.
SpatialLocalizerInterface(Element *element)
static IntArray momentum_ordering
Ordering of dofs in element. Used to assemble the element stiffness.
static IntArray conservation_ordering
void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, TimeStep *tStep)
void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true) override
static FEI2dTrLin interpolation_lin
Interpolation for pressure.
static IntArray edge_ordering[3]
Ordering of dofs on edges. Used to assemble edge loads.
void computeExternalForcesVector(FloatArray &answer, TimeStep *tStep)
void computeInternalForcesVector(FloatArray &answer, TimeStep *tStep)
static FEI2dTrQuad interpolation_quad
Interpolation for geometry and velocity.
void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep) override
ZZNodalRecoveryModelInterface(Element *element)
Constructor.
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.
@ BodyLoadBGT
Distributed body load.
@ EdgeLoadBGT
Distributed edge load.
FloatMatrixF< 3, N *2 > Bmatrix_2d(const FloatMatrixF< 2, N > &dN)
Constructs the B matrix for plane stress momentum balance problems.
double dot(const FloatArray &x, const FloatArray &y)
@ ZZNodalRecoveryModelInterfaceType
@ SpatialLocalizerInterfaceType
@ NodalAveragingRecoveryModelInterfaceType
@ TransmissionBC
Neumann type (prescribed flux).
FloatArrayF< N *M > flatten(const FloatMatrixF< N, M > &m)