64 tractionsdman(
new Node(-1, d) )
99 if ( this->
order < 0 ) {
104 int total = nsd * nsd * ( int ) pow(
double (
order + 1 ), nsd - 1);
107 for (
int i = 1; i <= total; ++i ) {
134 d.
at(1, 1) = d_voigt.
at(1);
135 d.
at(2, 2) = d_voigt.
at(2);
136 d.
at(3, 3) = d_voigt.
at(3);
137 d.
at(2, 3) = d.
at(3, 2) = d_voigt.
at(4) * 0.5;
138 d.
at(1, 3) = d.
at(3, 1) = d_voigt.
at(5) * 0.5;
139 d.
at(1, 2) = d.
at(2, 1) = d_voigt.
at(6) * 0.5;
140 }
else if ( n == 3 ) {
142 d.
at(1, 1) = d_voigt.
at(1);
143 d.
at(2, 2) = d_voigt.
at(2);
144 d.
at(1, 2) = d.
at(2, 1) = d_voigt.
at(3) * 0.5;
145 }
else if ( n == 1 ) {
147 d.
at(1, 1) = d_voigt.
at(1);
157 if ( type != TangentStiffnessMatrix ) {
161 IntArray loc_r, loc_c, t_loc_r, t_loc_c, e_loc_r, e_loc_c;
168 this->
voldman->giveLocationArray(
v_id, e_loc_r, r_s);
169 this->
voldman->giveLocationArray(
v_id, e_loc_c, c_s);
173 const IntArray &boundaries =
set->giveBoundaryList();
176 cols.resize(boundaries.
giveSize() + 2);
178 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
180 int boundary = boundaries.
at(pos * 2);
187 cols [ i ] = t_loc_c;
190 rows [ i ] = t_loc_r;
196 rows [ i ] = t_loc_r;
197 cols [ i ] = e_loc_c;
200 rows [ i ] = e_loc_r;
201 cols [ i ] = t_loc_c;
209 int total = ( int ) pow(
double (
order + 1 ), surfCoords.
giveSize());
213 for (
int xi = 0; xi < ( this->
order + 1 ); ++xi ) {
215 for (
int yi = 0; yi < ( this->
order + 1 ); ++yi ) {
216 answer(pos) = tx * ty;
229 int total = nsd * nsd * ( int ) pow(
double ( this->
order + 1 ), nsd - 1);
231 surfCoords.
resize(nsd - 1);
232 mMatrix.
resize(nsd, total);
235 for (
int kj = 0; kj < nsd; ++kj ) {
237 for (
int c = 0, q = 0; c < nsd; ++c ) {
239 surfCoords(q) = coords(c);
245 for (
int ti = 0; ti < t.
giveSize(); ++ti ) {
246 for (
int ki = 0; ki < nsd; ++ki ) {
247 mMatrix(ki, pos) = t(ti) * normal(kj);
269 const FloatArray &lcoords = gp->giveNaturalCoordinates();
298 const FloatArray &lcoords = gp->giveNaturalCoordinates();
307 tmpAnswer.plusProduct(mMatrix, vM_vol, detJ * gp->giveWeight());
309 answer.
resize(tmpAnswer.giveSize(), 1);
327 const FloatArray &lcoords = gp->giveNaturalCoordinates();
337 answer.
plusProduct(mMatrix, vM_dev, detJ * gp->giveWeight());
346 const IntArray &boundaries =
set->giveBoundaryList();
353 if ( type == ExternalForcesVector ) {
366 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
368 int boundary = boundaries.
at(pos * 2);
378 }
else if ( type == InternalForcesVector ) {
385 this->
voldman->giveUnknownVector(e,
v_id, mode, tStep);
390 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
392 int boundary = boundaries.
at(pos * 2);
428 if ( type == TangentStiffnessMatrix || type == SecantStiffnessMatrix || type == ElasticStiffnessMatrix ) {
430 IntArray v_loc_r, v_loc_c, t_loc_r, t_loc_c, e_loc_r, e_loc_c;
433 const IntArray &boundaries =
set->giveBoundaryList();
439 this->
voldman->giveLocationArray(
v_id, e_loc_r, r_s);
440 this->
voldman->giveLocationArray(
v_id, e_loc_c, c_s);
442 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
444 int boundary = boundaries.
at(pos * 2);
459 answer.
assemble(t_loc_r, v_loc_c, Ke_v);
460 answer.
assemble(v_loc_r, t_loc_c, Ke_vT);
462 answer.
assemble(t_loc_r, e_loc_c, Ke_e);
463 answer.
assemble(e_loc_r, t_loc_c, Ke_eT);
490 const IntArray &boundaries =
set->giveBoundaryList();
496 for (
int pos = 1; pos <= boundaries.
giveSize() / 2; ++pos ) {
498 int boundary = boundaries.
at(pos * 2);
506 const FloatArray &lcoords = gp->giveNaturalCoordinates();
518 sigma.
times(1. / rve_size);
521 for (
int i = 1; i <= nsd; i++ ) {
522 pressure += sigma.
at(i, i);
530 sigmaDev.
at(4) = 0.5 * ( sigma.
at(2, 3) + sigma.
at(3, 2) );
531 sigmaDev.
at(5) = 0.5 * ( sigma.
at(1, 3) + sigma.
at(3, 1) );
532 sigmaDev.
at(6) = 0.5 * ( sigma.
at(1, 2) + sigma.
at(2, 1) );
533 }
else if ( nsd == 2 ) {
537 sigmaDev.
at(3) = 0.5 * ( sigma.
at(1, 2) + sigma.
at(2, 1) );
550 std :: unique_ptr< SparseLinearSystemNM > solver(
555 const IntArray &boundaries =
set->giveBoundaryList();
561 OOFEM_ERROR(
"Couldn't create sparse matrix of type %d\n", stype);
567 int neq = Kff->giveNumberOfRows();
571 int nd = nsd * ( 1 + nsd ) / 2;
577 this->
voldman->giveLocationArray(
v_id, e_loc, fnum );
588 for (
int i = 1; i <= nd; ++i ) {
590 FloatArray tmp(neq), fe, fetot, ddevVoigt(nd);
591 ddevVoigt.
at(i) = 1.0;
593 for (
int k = 1; k <= boundaries.
giveSize() / 2; ++k ) {
595 int boundary = boundaries.
at(k * 2);
600 tmp.assemble(fetot, t_loc);
606 p_pert.
at( e_loc.at(1) ) = - 1.0 * rve_size;
609 solver->solve(*Kff, ddev_pert, s_d);
610 solver->solve(*Kff, p_pert, s_p);
615 tractions_p.beSubArrayOf(s_p, t_loc);
616 for (
int i = 1; i <= nd; ++i ) {
617 for (
int k = 1; k <= t_loc.giveSize(); ++k ) {
618 tractions_d.
at(k, i) = s_d.
at(t_loc.at(k), i);
623 Cp = - s_p.
at( e_loc.at(1) );
627 Cd.
at(1) = s_d.
at(e_loc.at(1), 1);
628 Cd.
at(2) = s_d.
at(e_loc.at(1), 2);
629 Cd.
at(3) = s_d.
at(e_loc.at(1), 3);
630 Cd.
at(4) = s_d.
at(e_loc.at(1), 4);
631 Cd.
at(5) = s_d.
at(e_loc.at(1), 5);
632 Cd.
at(6) = s_d.
at(e_loc.at(1), 6);
633 }
else if ( nsd == 2 ) {
634 Cd.
at(1) = s_d.
at(e_loc.at(1), 1);
635 Cd.
at(2) = s_d.
at(e_loc.at(1), 2);
636 Cd.
at(3) = s_d.
at(e_loc.at(1), 3);
642 for (
int dpos = 1; dpos <= nd; ++dpos ) {
int giveNumberOfColumns() const
Returns number of columns of receiver.
The representation of EngngModel default unknown numbering.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
REGISTER_BoundaryCondition(BoundaryCondition)
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)=0
Assembles sparse matrix from contribution of local elements.
#define _IFT_MixedGradientPressureWeakPeriodic_order
Order of global polynomial in the unknown tractions. Should be at least 1.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Base class for all matrices stored in sparse format.
double pressure
Prescribed pressure.
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
virtual double boundaryEvalNormal(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the normal on the requested boundary.
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
double domainSize()
Computes the size (including pores) by surface integral over the domain.
void clear()
Clears receiver (zero size).
int giveInterpolationOrder()
Returns the interpolation order.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Implementation for assembling tangent matrices in standard monolithic FE-problems.
std::unique_ptr< Node > tractionsdman
DOF-manager containing the unknown tractions (Lagrange mult. for micro-periodic velocity) ...
void constructMMatrix(FloatMatrix &mMatrix, FloatArray &coords, FloatArray &normal)
Abstract base class for all finite elements.
Base class for dof managers.
MixedGradientPressureWeakPeriodic(int n, Domain *d)
Creates boundary condition with given number, belonging to given domain.
void negated()
Changes sign of receiver values.
int giveNumber()
Returns domain number.
virtual double giveUnknown(PrimaryField &field, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
Computes the value of the dof.
void plusDyadUnsym(const FloatArray &a, const FloatArray &b, double dV)
Adds to the receiver the product .
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, double scale=1.0)
Assembles B.C.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual FEInterpolation * giveInterpolation() const
void beColumnOf(const FloatMatrix &mat, int col)
Reciever will be set to a given column in a matrix.
FloatMatrix devGradient
Prescribed gradient .
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Class representing a general abstraction for finite element interpolation class.
void plusProductUnsym(const FloatMatrix &a, const FloatMatrix &b, double dV)
Adds to the receiver the product .
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &s, Domain *domain)
Assembles characteristic matrix of required type into given sparse matrix.
Class representing "master" degree of freedom.
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
void evaluateTractionBasisFunctions(FloatArray &answer, const FloatArray &coords)
Element * giveElement(int n)
Service for accessing particular domain fe element.
double volGradient
The volumetric part of what was sent in (needed to return the difference).
void integrateTractionVelocityTangent(FloatMatrix &answer, Element *el, int boundary)
void computeStress(FloatArray &sigmaDev, FloatArray &tractions, double rve_size)
void integrateTractionDev(FloatArray &answer, Element *el, int boundary, const FloatMatrix &ddev)
void clear()
Clears the array (zero size).
DofIDItem
Type representing particular dof type.
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
#define _IFT_MixedGradientPressure_pressure
virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Maps the local boundary coordinates to global.
void times(double f)
Multiplies receiver by factor f.
Set of elements, boundaries, edges and/or nodes.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
Wrapper around element definition to provide FEICellGeometry interface.
Set * giveSet(int n)
Service for accessing particular domain set.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
IntArray dofs
Dofs that b.c. is applied to (relevant for Dirichlet type b.c.s).
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix^T and anArray.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
int order
Order if polynomials.
std::unique_ptr< Node > voldman
DOF-manager containing the unknown volumetric gradient (always exactly one dof).
void beNMatrixOf(const FloatArray &n, int nsd)
Assigns the receiver to be a repeated diagonal matrix.
virtual void boundaryGiveNodes(IntArray &answer, int boundary)=0
Gives the boundary nodes for requested boundary number.
int giveNextFreeDofID(int increment=1)
Gives the next free dof ID.
Class representing vector of real numbers.
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
void integrateTractionXTangent(FloatMatrix &answer, Element *el, int boundary)
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 giveLocationArrays(std::vector< IntArray > &rows, std::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
Gives a list of location arrays that will be assembled.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual IntegrationRule * giveBoundaryIntegrationRule(int order, int boundary)
Sets up a suitable integration rule for integrating over the requested boundary.
virtual void assembleVector(FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorm=NULL)
Assembles B.C.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
void zero()
Zeroes all coefficients of receiver.
void assembleSquared(const FloatArray &fe, const IntArray &loc)
Assembles the array fe with each component squared.
virtual void scale(double s)
Scales the receiver according to given value.
virtual void giveBoundaryLocationArray(IntArray &locationArray, const IntArray &bNodes, const UnknownNumberingScheme &s, IntArray *dofIds=NULL)
Returns the location array for the boundary of the element.
void setColumn(const FloatArray &src, int c)
Sets the values of the matrix in specified column.
void beTranspositionOf(const FloatMatrix &src)
Assigns to the receiver the transposition of parameter.
ClassFactory & classFactory
virtual void computeTangents(FloatMatrix &Ed, FloatArray &Ep, FloatArray &Cd, double &Cp, TimeStep *tStep)
Computes the macroscopic tangents through sensitivity analysis.
void zero()
Zeroes all coefficient of receiver.
Domain * giveDomain() const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual ~MixedGradientPressureWeakPeriodic()
Destructor.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Abstract base class representing the "problem" under consideration.
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.
virtual DofManager * giveInternalDofManager(int i)
Returns the volumetric DOF manager for i == 1, and the deviatoric manager for i == 2...
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
Class implementing node in finite element mesh.
virtual int giveNumberOfInternalDofManagers()
Returns the number of internal DOF managers (=2).
void negated()
Switches the sign of every coefficient of receiver.
virtual void computeFields(FloatArray &sigmaDev, double &vol, TimeStep *tStep)
Computes the homogenized fields through sensitivity analysis.
int giveNumberOfRows() const
Returns number of rows of receiver.
General class for boundary condition that prolongates macroscopic fields to incompressible flow...
void computeBoundaryVectorOf(const IntArray &bNodes, const IntArray &dofIDMask, ValueModeType u, TimeStep *tStep, FloatArray &answer, bool padding=false)
Boundary version of computeVectorOf.
void constructFullMatrixForm(FloatMatrix &d, const FloatArray &d_voigt) const
virtual void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the basis functions on the requested boundary.
Class representing integration point in finite element program.
virtual void setPrescribedDeviatoricGradientFromVoigt(const FloatArray &ddev)
Sets the prescribed tensor from the matrix from given Voigt notation.
Class representing solution step.
void add(const FloatArray &src)
Adds array src to receiver.
void resize(int s)
Resizes receiver towards requested size.
void plusProduct(const FloatMatrix &b, const FloatArray &s, double dV)
Adds the product .