57 IntArray
Tet1BubbleStokes :: momentum_ordering = {1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15, 17, 18, 19};
60 {1, 2, 3, 9, 10, 11, 5, 6, 7},
61 {1, 2, 3, 5, 6, 7, 13, 14, 15},
62 {5, 6, 7, 9, 10, 11, 13, 14, 15},
63 {1, 2, 3, 13, 14, 15, 9, 10, 11}
97 answer = {V_u, V_v, V_w, P_f};
102 answer = {V_u, V_v, V_w};
115 if ( mtrx == ExternalForcesVector ) {
117 }
else if ( mtrx == InternalForcesVector ) {
120 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
128 if ( mtrx == TangentStiffnessMatrix ) {
131 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
138 FloatArray a_pressure, a_velocity, devStress, epsp,
N, dNv(15);
139 double r_vol, pressure;
149 const FloatArray &lcoords = gp->giveNaturalCoordinates();
153 double dV = detJ * gp->giveWeight();
156 dNv(k + 0) = B(0, k + 0) = B(5, k + 1) = B(4, k + 2) = dN(j, 0);
157 dNv(k + 1) = B(1, k + 1) = B(5, k + 0) = B(3, k + 2) = dN(j, 1);
158 dNv(k + 2) = B(2, k + 2) = B(4, k + 0) = B(3, k + 1) = dN(j, 2);
162 dNv(12) = B(0, 12) = B(5, 13) = B(4, 14) = dN(0, 0) *
N(1) *
N(2) *
N(3) +
N(0) * dN(1, 0) *
N(2) *
N(3) +
N(0) *
N(1) * dN(2, 0) *
N(3) +
N(0) *
N(1) *
N(2) * dN(3, 0);
163 dNv(13) = B(1, 13) = B(5, 12) = B(3, 14) = dN(0, 1) *
N(1) *
N(2) *
N(3) +
N(0) * dN(1, 1) *
N(2) *
N(3) +
N(0) *
N(1) * dN(2, 1) *
N(3) +
N(0) *
N(1) *
N(2) * dN(3, 1);
164 dNv(14) = B(2, 14) = B(4, 12) = B(3, 13) = dN(0, 2) *
N(1) *
N(2) *
N(3) +
N(0) * dN(1, 2) *
N(2) *
N(3) +
N(0) *
N(1) * dN(2, 2) *
N(3) +
N(0) *
N(1) *
N(2) * dN(3, 2);
172 momentum.
add(-pressure * dV, dNv);
173 conservation.
add(r_vol * dV, N);
188 for (
int i = 1; i <= nLoads; i++ ) {
197 OOFEM_ERROR(
"Unsupported boundary condition: %d", load_id);
205 for (
int i = 1; i <= nLoads; i++ ) {
207 if ((bload = dynamic_cast<BodyLoad*>(load))) {
222 if ( type != ExternalForcesVector ) {
228 double dV, detJ, rho;
235 const FloatArray &lcoords = gp->giveNaturalCoordinates();
239 dV = detJ * gp->giveWeight() * rho;
242 for (
int j = 0; j < N.
giveSize(); j++ ) {
243 temparray(3 * j + 0) +=
N(j) * rho * gVector(0) * dV;
244 temparray(3 * j + 1) +=
N(j) * rho * gVector(1) * dV;
245 temparray(3 * j + 2) +=
N(j) * rho * gVector(2) * dV;
248 temparray(12) +=
N(0) *
N(1) *
N(2) *
N(3) * rho * gVector(0) * dV;
249 temparray(13) +=
N(0) *
N(1) *
N(2) *
N(3) * rho * gVector(1) * dV;
250 temparray(14) +=
N(0) *
N(1) *
N(2) *
N(3) * rho * gVector(1) * dV;
262 if ( type != ExternalForcesVector ) {
268 int numberOfIPs = ( int ) ceil( ( load->
giveApproxOrder() + 2. ) / 2. );
277 const FloatArray &lcoords = gp->giveNaturalCoordinates();
281 double dA = gp->giveWeight() * detJ;
292 for (
int j = 0; j < N.
giveSize(); j++ ) {
293 f(3 * j + 0) +=
N(j) * t(0) * dA;
294 f(3 * j + 1) +=
N(j) * t(1) * dA;
295 f(3 * j + 2) +=
N(j) * t(2) * dA;
313 FloatMatrix B(6, 15), EdB, K, G, Dp, DvT, C, Ed, dN;
321 const FloatArray &lcoords = gp->giveNaturalCoordinates();
324 double dV = detJ * gp->giveWeight();
327 for (
int j = 0, k = 0; j < 4; j++, k += 3 ) {
328 dNv(k + 0) = B(0, k + 0) = B(5, k + 1) = B(4, k + 2) = dN(j, 0);
329 dNv(k + 1) = B(1, k + 1) = B(5, k + 0) = B(3, k + 2) = dN(j, 1);
330 dNv(k + 2) = B(2, k + 2) = B(4, k + 0) = B(3, k + 1) = dN(j, 2);
334 dNv(12) = B(0, 12) = B(5, 13) = B(4, 14) = dN(0, 0) *
N(1) *
N(2) *
N(3) +
N(0) * dN(1, 0) *
N(2) *
N(3) +
N(0) *
N(1) * dN(2, 0) *
N(3) +
N(0) *
N(1) *
N(2) * dN(3, 0);
335 dNv(13) = B(1, 13) = B(5, 12) = B(3, 14) = dN(0, 1) *
N(1) *
N(2) *
N(3) +
N(0) * dN(1, 1) *
N(2) *
N(3) +
N(0) *
N(1) * dN(2, 1) *
N(3) +
N(0) *
N(1) *
N(2) * dN(3, 1);
336 dNv(14) = B(2, 14) = B(4, 12) = B(3, 13) = dN(0, 2) *
N(1) *
N(2) *
N(3) +
N(0) * dN(1, 2) *
N(2) *
N(3) +
N(0) *
N(1) * dN(2, 2) *
N(3) +
N(0) *
N(1) *
N(2) * dN(3, 2);
412 for (
int i = 1; i <= n.
giveSize(); i++ ) {
413 answer(0) += n.
at(i) * velocities.
at(i*3-2);
414 answer(1) += n.
at(i) * velocities.
at(i*3-1);
415 answer(2) += n.
at(i) * velocities.
at(i*3);
417 answer(0) += n.
at(1) * n.
at(2) * n.
at(3) * n.
at(4) * velocities.
at(13);
418 answer(1) += n.
at(1) * n.
at(2) * n.
at(3) * n.
at(4) * velocities.
at(14);
419 answer(2) += n.
at(1) * n.
at(2) * n.
at(3) * n.
at(4) * velocities.
at(15);
421 for (
int i = 1; i <= n_lin.
giveSize(); i++ ) {
422 answer(3) += n_lin.
at(i) * pressures.
at(i);
CrossSection * giveCrossSection()
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
static IntArray momentum_ordering
Ordering of dofs in element. Used to assemble the element stiffness.
Abstract base class for all fluid materials.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
void computeInternalForcesVector(FloatArray &answer, TimeStep *tStep)
virtual void computeField(ValueModeType u, TimeStep *tStep, const FloatArray &coords, FloatArray &answer)
Computes the unknown vector interpolated at the specified local coordinates.
Class implementing internal element dof manager having some DOFs.
The element interface required by ZZNodalRecoveryModel.
void computeExternalForcesVector(FloatArray &answer, TimeStep *tStep)
bcGeomType
Type representing the geometric character of loading.
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Class implementing element body load, acting over whole element volume (e.g., the dead weight)...
void clear()
Clears receiver (zero size).
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of interpolation functions (shape functions) at given point.
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
static IntArray surf_ordering[4]
Ordering of dofs on surfaces. Used to assemble surface loads.
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes boundary condition value - its components values at given time.
void plusDyadUnsym(const FloatArray &a, const FloatArray &b, double dV)
Adds to the receiver the product .
virtual void giveStiffnessMatrices(FloatMatrix &dsdd, FloatArray &dsdp, FloatArray &dedd, double &dedp, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the 4 tangents of the compressible material response in 3D.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
MatResponseMode
Describes the character of characteristic material matrix.
virtual void giveInternalDofManDofIDMask(int i, IntArray &answer) const
Returns internal dofmanager dof mask for node.
virtual double giveTransformationJacobian(const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the determinant of the transformation.
virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Maps the local boundary coordinates to global.
Class representing a general abstraction for finite element interpolation class.
Class representing "master" degree of freedom.
virtual void computeVectorOfPressures(ValueModeType mode, TimeStep *tStep, FloatArray &pressures)
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
Tet1BubbleStokes(int n, Domain *d)
virtual void computeDeviatoricStressVector(FloatArray &stress_dev, double &epsp_vol, GaussPoint *gp, const FloatArray &eps, double pressure, TimeStep *tStep)
Computes the deviatoric stress vector and volumetric strain rate from given deviatoric strain and pre...
Abstract base class representing a boundary load (force, momentum, ...) that acts directly on a bound...
virtual int computeNumberOfDofs()
Computes or simply returns total number of element's local DOFs.
virtual void computeVectorOfVelocities(ValueModeType mode, TimeStep *tStep, FloatArray &velocities)
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
virtual double surfaceEvalNormal(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the normal out of the surface at given point.
static FEI3dTetLin interp
Interpolation for pressure.
DofIDItem
Type representing particular dof type.
virtual double giveWeight()
Returns integration weight of receiver.
virtual void giveCharacteristicVector(FloatArray &answer, CharType type, ValueModeType mode, TimeStep *tStep)
Computes characteristic vector of receiver of requested type in given time step.
virtual FormulationType giveFormulationType()
Specifies is load should take local or global coordinates.
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
Neumann type (prescribed flux).
Wrapper around element definition to provide FEICellGeometry interface.
virtual void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep)
Computes characteristic matrix of receiver of requested type in given time step.
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
IntArray bodyLoadArray
Array containing indexes of loads (body loads and boundary loads are kept separately), that apply on receiver.
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
virtual int giveApproxOrder()=0
static IntArray conservation_ordering
virtual double evaldNdx(FloatMatrix &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the matrix of derivatives of interpolation functions (shape functions) at given point...
virtual double surfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the edge jacobian of transformation between local and global coordinates.
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
virtual FEInterpolation * giveInterpolation() const
virtual bcType giveType() const
Returns receiver load type.
Distributed surface load.
virtual int setupIntegrationPoints(IntegrationRule &irule, int npoints, Element *element)
Sets up integration rule for the given element.
int numberOfGaussPoints
Number of integration points as specified by nip.
Class representing vector of real numbers.
void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, TimeStep *tStep)
void plusDyadSymmUpper(const FloatArray &a, double dV)
Adds to the receiver the dyadic product .
This abstract class represent a general base element class for fluid dynamic problems.
virtual void computeLoadVector(FloatArray &answer, BodyLoad *load, CharType type, ValueModeType mode, TimeStep *tStep)
Computes the contribution of the given body load (volumetric).
Implementation of matrix containing floating point numbers.
virtual void surfaceEvalN(FloatArray &answer, int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo)
Evaluates the array of edge interpolation functions (shape functions) at given point.
std::unique_ptr< ElementDofManager > bubble
The extra dofs from the bubble.
void assemble(const FloatArray &fe, const IntArray &loc)
Assembles the array fe (typically, the load vector of a finite element) into the receiver, using loc as location array.
virtual void computeBoundarySurfaceLoadVector(FloatArray &answer, BoundaryLoad *load, int boundary, CharType type, ValueModeType mode, TimeStep *tStep, bool global=true)
Computes the contribution of the given load at the given boundary surface in global coordinate system...
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
void add(const FloatMatrix &a)
Adds matrix to the receiver.
void zero()
Zeroes all coefficients of receiver.
virtual bcGeomType giveBCGeoType() const
Returns geometry character of boundary condition.
virtual Interface * giveInterface(InterfaceType t)
Interface requesting service.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
The spatial localizer element interface associated to spatial localizer.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
void zero()
Zeroes all coefficient of receiver.
InterfaceType
Enumerative type, used to identify interface type.
Load is base abstract class for all loads.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void assemble(const FloatMatrix &src, const IntArray &loc)
Assembles the contribution using localization array into receiver.
virtual bcValType giveBCValType() const
Returns receiver load type.
virtual void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode)
Computes components values of load at given point - global coordinates (coordinates given)...
int giveNumberOfRows() const
Returns number of rows of receiver.
Load * giveLoad(int n)
Service for accessing particular domain load.
void symmetrized()
Initializes the lower half of the receiver according to the upper half.
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Class representing integration point in finite element program.
IntArray boundaryLoadArray
Class representing solution step.
int numberOfDofMans
Number of dofmanagers.
void add(const FloatArray &src)
Adds array src to receiver.
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
virtual ~Tet1BubbleStokes()
virtual int SetUpPointsOnTriangle(int nPoints, MaterialMode mode)
Sets up receiver's integration points on triangular (area coords) integration domain.
Class representing Gaussian-quadrature integration rule.
void resize(int s)
Resizes receiver towards requested size.
void plusProduct(const FloatMatrix &b, const FloatArray &s, double dV)
Adds the product .