69 int components = ( nsd + 1 ) * nsd / 2;
72 for (
int i = 0; i < components; i++ ) {
115 return devdman->giveNumberOfDofs() + 1;
144 if (
id == D_u ||
id == V_u ) {
145 masterContribs.
at(1) = dx.
at(1) / 3.0;
147 masterContribs.
at(2) = dx.
at(1);
148 masterContribs.
at(3) = 0.0;
149 masterContribs.
at(4) = dx.
at(2) / 2.0;
150 }
else if ( nsd == 3 ) {
151 masterContribs.
at(2) = dx.
at(1);
152 masterContribs.
at(3) = 0.0;
153 masterContribs.
at(4) = 0.0;
154 masterContribs.
at(5) = 0.0;
155 masterContribs.
at(6) = dx.
at(3) / 2.0;
156 masterContribs.
at(7) = dx.
at(2) / 2.0;
158 }
else if (
id == D_v ||
id == V_v ) {
159 masterContribs.
at(1) = dx.
at(2) / 3.0;
160 masterContribs.
at(2) = 0.0;
161 masterContribs.
at(3) = dx.
at(2);
162 masterContribs.
at(4) = dx.
at(1) / 2.0;
164 masterContribs.
at(2) = 0.0;
165 masterContribs.
at(3) = dx.
at(2);
166 masterContribs.
at(4) = 0.0;
167 masterContribs.
at(5) = dx.
at(3) / 2.0;
168 masterContribs.
at(6) = 0.0;
169 masterContribs.
at(7) = dx.
at(1) / 2.0;
171 }
else if (
id == D_w ||
id == V_w ) {
172 masterContribs.
at(1) = dx.
at(3) / 3.0;
173 masterContribs.
at(2) = 0.0;
174 masterContribs.
at(3) = 0.0;
175 masterContribs.
at(4) = dx.
at(3);
176 masterContribs.
at(5) = dx.
at(2) / 2.0;
177 masterContribs.
at(6) = dx.
at(1) / 2.0;
178 masterContribs.
at(7) = 0.0;
197 int nsd = dx.giveSize();
199 double dev11, dev22, dev33 = 0., dev12, dev23 = 0., dev13 = 0.;
203 dev12 = dev.
at(3) * 0.5;
208 dev23 = dev.
at(4) * 0.5;
209 dev13 = dev.
at(5) * 0.5;
210 dev12 = dev.
at(6) * 0.5;
214 if (
id == D_u ||
id == V_u ) {
215 val = dx.at(1) / 3.0 * vol;
217 val += dx.at(1) * dev11 + dx.at(2) * dev12;
220 val += dx.at(3) * dev13;
222 }
else if (
id == D_v ||
id == V_v ) {
223 val = dx.at(2) / 3.0 * vol + dx.at(1) * dev12 + dx.at(2) * dev22;
225 val += dx.at(3) * dev23;
228 val = dx.at(3) / 3.0 * vol + dx.at(1) * dev13 + dx.at(2) * dev23 + dx.at(3) * dev33;
252 for (
int i = 1; i <= nsd; ++i ) {
264 std :: unique_ptr< SparseLinearSystemNM > solver(
284 Kfp->buildInternalStructure(rve, 1, fnum, pnum);
288 int neq = Kfp->giveNumberOfRows();
290 int npeq = Kfp->giveNumberOfColumns();
292 if ( npeq != ndev ) {
297 ddev_pert.
resize(ndev, ndev);
299 for (
int i = 1; i <= ndev; ++i ) {
300 int eqn = this->
devdman->giveDofWithID(
dev_id.
at(i))->__givePrescribedEquationNumber();
301 ddev_pert.
at(eqn, i) = -1.0;
303 Kfp->times(ddev_pert, rhs_d);
309 rhs_p.
at(dvol_eq) = -1.0 * rve_size;
317 OOFEM_ERROR(
"MixedGradientPressureDirichlet :: computeTangents - Couldn't create sparse matrix of type %d\n", stype);
319 Kff->buildInternalStructure(rve, 1, fnum);
321 solver->solve(*Kff, rhs_p, s_p);
322 solver->solve(*Kff, rhs_d, s_d);
326 Cp = - s_p.
at(dvol_eq);
328 for (
int i = 1; i <= ndev; ++i ) {
329 Cd.
at(i) = s_d.
at(dvol_eq, i);
336 Kpf->buildInternalStructure(rve, 1, pnum, fnum);
337 Kpp->buildInternalStructure(rve, 1, pnum);
342 Kpp->
times(ddev_pert, tmpMat);
345 Ed.
times(1.0 / rve_size);
347 Ep.
times(1.0 / rve_size);
352 for (
int i = 1; i <= nsd; ++i ) {
362 for (
int j = 1; j <= nsd; ++j ) {
365 mean /= ( double ) nsd;
367 for (
int j = 1; j <= nsd; ++j ) {
402 if ( type != ExternalForcesVector ) {
412 eNorms->
at( vol->
giveDofID() ) = rve_size * pressure * rve_size * pressure;
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.
virtual void computeDofTransformation(ActiveDof *dof, FloatArray &masterContribs)
virtual double giveBcValue(Dof *dof, ValueModeType mode, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
virtual void assembleVector(FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorms=NULL)
Assembles B.C.
REGISTER_BoundaryCondition(BoundaryCondition)
Implementation for assembling internal forces vectors in standard monolithic, nonlinear FE-problems...
#define _IFT_MixedGradientPressure_devGradient
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
virtual Dof * giveMasterDof(ActiveDof *dof, int mdof)
Give the pointer to master dof belonging to active DOF.
virtual void computeFields(FloatArray &stressDev, double &vol, TimeStep *tStep)
Computes the homogenized fields through sensitivity analysis.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
Abstract class representing field of primary variables (those, which are unknown and are typically as...
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
virtual int giveEqn()
Gives number for equation, negative for prescribed equations.
virtual ~MixedGradientPressureDirichlet()
Destructor.
double domainSize()
Computes the size (including pores) by surface integral over the domain.
virtual int giveNumberOfMasterDofs(ActiveDof *dof)
Allows for active boundary conditions to handle their own special DOF.
virtual FloatArray * giveCoordinates()
virtual double giveUnknown(ValueModeType mode, TimeStep *tStep)=0
The key method of class Dof.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Implementation for assembling tangent matrices in standard monolithic FE-problems.
FloatArray devGradient
Prescribed gradient in Voigt form.
Base class for dof managers.
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
int & at(int i)
Coefficient access function.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
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.
virtual int giveNumberOfInternalDofManagers()
Returns the number of internal DOF managers (=2).
virtual bool hasBc(Dof *dof, TimeStep *tStep)
Returns the prescribed value of a dof (if any).
std::unique_ptr< Node > devdman
DOF-manager containing the known deviatoric strain(rate).
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual void computeTangents(FloatMatrix &Ed, FloatArray &Ep, FloatArray &Cd, double &Cp, TimeStep *tStep)
Computes the macroscopic tangents through sensitivity analysis.
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
Implementation for assembling external forces vectors in standard monolithic FE-problems.
void times(double f)
Multiplies receiver by factor f.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
virtual bool isPrimaryDof(ActiveDof *dof)
Checks to see if the dof is a primary DOF.
std::unique_ptr< Node > voldman
DOF-manager containing the unknown volumetric strain(rate).
#define _IFT_MixedGradientPressure_centerCoords
double at(int i, int j) const
Coefficient access function.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class representing "slave" degree of freedom with an active boundary condition.
void subtract(const FloatMatrix &a)
Subtracts matrix from the receiver.
double pressure
Prescribed pressure.
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.
virtual DofManager * giveInternalDofManager(int i)
Returns the volumetric DOF manager for i == 1, and the deviatoric manager for i == 2...
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
The representation of EngngModel default prescribed unknown numbering.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
void zero()
Zeroes all coefficients of receiver.
void times(double s)
Multiplies receiver with scalar.
ClassFactory & classFactory
MixedGradientPressureDirichlet(int n, Domain *d)
Creates boundary condition with given number, belonging to given domain.
double giveUnknown(double vol, const FloatArray &dev, ValueModeType mode, TimeStep *tStep, ActiveDof *dof)
void zero()
Zeroes all coefficient of receiver.
Domain * giveDomain() const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
int giveEquationNumber(const UnknownNumberingScheme &s)
Returns equation number of receiver for given equation numbering scheme.
Abstract base class representing the "problem" under consideration.
DofManager * giveDofManager() const
bool isDevDof(Dof *dof)
Returns true is DOF represents one of the deviatoric parts.
int giveSize() const
Returns the size of receiver.
virtual void setPrescribedDeviatoricGradientFromVoigt(const FloatArray &ddev)
Sets the prescribed tensor from the matrix from given Voigt notation.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class implementing node in finite element mesh.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
FloatArray centerCoord
Center coordinate .
General class for boundary condition that prolongates macroscopic fields to incompressible flow...
void assembleVector(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Assembles characteristic vector of required type from dofManagers, element, and active boundary condi...
Class representing solution step.
int findFirstIndexOf(int value) const
Finds index of first occurrence of given value in array.
void resize(int s)
Resizes receiver towards requested size.