58IntArray Tr1BubbleStokes :: momentum_ordering = {1, 2, 4, 5, 7, 8, 10, 11};
59IntArray Tr1BubbleStokes :: conservation_ordering = {3, 6, 9};
60IntArray Tr1BubbleStokes :: edge_ordering [ 3 ] = {
71 this->
bubble = std::make_unique<ElementDofManager>(1, aDomain,
this);
76void Tr1BubbleStokes :: computeGaussPoints()
85int Tr1BubbleStokes :: computeNumberOfDofs()
90void Tr1BubbleStokes :: giveDofManDofIDMask(
int inode,
IntArray &answer)
const
92 answer = {V_u, V_v, P_f};
95void Tr1BubbleStokes :: giveInternalDofManDofIDMask(
int i,
IntArray &answer)
const
100int Tr1BubbleStokes :: giveNumberOfInternalDofManagers()
const
106DofManager *Tr1BubbleStokes :: giveInternalDofManager(
int i)
const
108 return this->
bubble.get();
117void Tr1BubbleStokes :: giveCharacteristicVector(
FloatArray &answer,
CharType mtrx, ValueModeType mode,
121 if ( mtrx == ExternalForcesVector ) {
123 }
else if ( mtrx == InternalForcesVector ) {
126 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
130void Tr1BubbleStokes :: giveCharacteristicMatrix(
FloatMatrix &answer,
133 if ( mtrx == TangentStiffnessMatrix ) {
136 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
151 const auto &lcoords = gp->giveNaturalCoordinates();
153 auto N = this->
interp.evalN( lcoords );
155 auto detJ = val.first;
156 auto dN = val.second;
157 auto dA = std::abs(detJ) * gp->giveWeight();
161 for (
int j = 0, k = 0; j < 3; j++, k += 2 ) {
162 dNv[k] = B(0, k) = B(2, k + 1) = dN(0, j);
163 dNv[k + 1] = B(1, k + 1) = B(2, k) = dN(1, j);
167 dNv[6] = B(0, 6) = B(2, 7) = 27. * ( dN(0, 0) *
N[1] *
N[2] +
N[0] * dN(1, 0) *
N[2] +
N[0] *
N[1] * dN(2, 0) );
168 dNv[7] = B(1, 7) = B(2, 6) = 27. * ( dN(0, 1) *
N[1] *
N[2] +
N[0] * dN(1, 1) *
N[2] +
N[0] *
N[1] * dN(2, 1) );
170 auto pressure =
dot(
N, a_pressure);
171 auto epsp =
dot(B, a_velocity);
174 auto devStress = s_r.first;
175 auto r_vol = s_r.second;
177 momentum +=
Tdot(B, devStress * dA) + dNv * (-pressure * dA);
178 conservation +=
N * (r_vol * dA);
194 for (
int i = 1; i <= nLoads; i++ ) {
197 Load *load = this->
domain->giveLoad(load_number);
207 for (
int i = 1; i <= nLoads; i++ ) {
210 if ((bLoad =
dynamic_cast<BodyLoad*
>(load))) {
223 if ( type != ExternalForcesVector ) {
234 const FloatArray &lcoords = gp->giveNaturalCoordinates();
238 double dA = detJ * gp->giveWeight();
241 for (
int j = 0; j < 3; j++ ) {
242 temparray(2 * j) +=
N(j) * rho * gVector(0) * dA;
243 temparray(2 * j + 1) +=
N(j) * rho * gVector(1) * dA;
246 temparray(6) +=
N(0) *
N(1) *
N(2) * rho * gVector(0) * dA;
247 temparray(7) +=
N(0) *
N(1) *
N(2) * rho * gVector(1) * dA;
258 if ( type != ExternalForcesVector ) {
265 int numberOfEdgeIPs = ( int ) ceil( ( load->
giveApproxOrder() + 2. ) / 2. );
273 for (
auto &gp: iRule ) {
274 const FloatArray &lcoords = gp->giveNaturalCoordinates();
278 double dS = gp->giveWeight() * detJ;
289 for (
int j = 0; j < 2; j++ ) {
290 f(2 * j) +=
N(j) * t(0) * dS;
291 f(2 * j + 1) +=
N(j) * t(1) * dS;
314 const auto &lcoords = gp->giveNaturalCoordinates();
316 auto N = this->
interp.evalN( lcoords );
318 auto dN = detj_dn.second;
319 auto detJ = detj_dn.first;
320 auto dA = std::abs(detJ) * gp->giveWeight();
324 for (
int j = 0, k = 0; j < 3; j++, k += 2 ) {
325 dN_V[k] = B(0, k) = B(2, k + 1) = dN(0, j);
326 dN_V[k + 1] = B(1, k + 1) = B(2, k) = dN(1, j);
330 dN_V[6] = B(0, 6) = B(2, 7) = 27. * ( dN(0, 0) *
N[1] *
N[2] +
N[0] * dN(1, 0) *
N[2] +
N[0] *
N[1] * dN(2, 0) );
331 dN_V[7] = B(1, 7) = B(2, 6) = 27. * ( dN(0, 1) *
N[1] *
N[2] +
N[0] * dN(1, 1) *
N[2] +
N[0] *
N[1] * dN(2, 1) );
338 K.plusProductSymmUpper(B,
dot(tangents.dsdd, B), dA);
339 G.plusDyadUnsym(dN_V,
N, -dA);
340 Dp.plusDyadUnsym(
Tdot(B, tangents.dsdp),
N, dA);
341 DvT.plusDyadUnsym(
N,
Tdot(B, tangents.dedd), dA);
342 C.plusDyadSymmUpper(
N, tangents.dedp * dA);
368void Tr1BubbleStokes :: updateYourself(
TimeStep *tStep)
370 Element :: updateYourself(tStep);
385 return FMElement :: giveInterface(it);
399 for (
int i = 1; i <= n.
giveSize(); i++ ) {
400 answer(0) += n.
at(i) * velocities.
at(i*2-1);
401 answer(1) += n.
at(i) * velocities.
at(i*2);
403 answer(0) += n.
at(1) * n.
at(2) * n.
at(3) * velocities.
at(7);
404 answer(1) += n.
at(1) * n.
at(2) * n.
at(3) * velocities.
at(8);
406 for (
int i = 1; i <= n_lin.
giveSize(); i++ ) {
407 answer(2) += n_lin.
at(i) * pressures.
at(i);
#define REGISTER_Element(class)
bcType giveType() const override
void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode) override
int giveApproxOrder() override=0
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)
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()
SpatialLocalizerInterface(Element *element)
void computeInternalForcesVector(FloatArray &answer, TimeStep *tStep)
void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep) override
void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, TimeStep *tStep)
static IntArray momentum_ordering
Ordering of dofs in element. Used to assemble the element stiffness.
static IntArray edge_ordering[3]
Ordering of dofs on edges. Used to assemble edge loads.
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
std ::unique_ptr< ElementDofManager > bubble
The extra dofs from the bubble.
static FEI2dTrLin interp
Interpolation for pressure.
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.
double dot(const FloatArray &x, const FloatArray &y)
@ ZZNodalRecoveryModelInterfaceType
@ SpatialLocalizerInterfaceType
@ TransmissionBC
Neumann type (prescribed flux).