49 #define DEBUG_ERR ( 1e-6 ) 67 this->computeDeviatoricStressVector(answer, r_vol, gp, eps, 0.0, tStep);
69 r_vol += eps.
at(1) + eps.
at(2);
71 r_vol += eps.
at(1) + eps.
at(2) + eps.
at(3);
76 " extended macro-formulation which doesn't assume incompressibility is required");
109 if ( mode == TangentStiffness ) {
121 if ( mode == TangentStiffness ) {
135 computeDeviatoricStressVector(sig, epspvol, gp, tempStrain, 0., tStep);
137 for (
int k = 1; k <= 6; ++k ) {
140 double tmp = strain.
at(1) + strain.
at(2) + strain.
at(3);
141 strain.
at(1) -= tmp/3.0;
142 strain.
at(2) -= tmp/3.0;
143 strain.
at(3) -= tmp/3.0;
145 computeDeviatoricStressVector(sigPert, epspvol, gp, strain, 0., tStep);
150 numericalATS.
times(1. / h);
152 printf(
"Analytical deviatoric tangent = ");
154 printf(
"Numerical deviatoric tangent = ");
169 computeDeviatoricStressVector(sig, epspvol, gp, strain, pressure, tStep);
170 computeDeviatoricStressVector(sigh, epspvol, gp, strain, pressure + h, tStep);
176 printf(
"Analytical deviatoric pressure tangent = ");
178 printf(
"Numerical deviatoric pressure tangent = ");
183 OOFEM_ERROR(
"Error in deviatoric pressure tangent");
191 double epspvol, epspvol11, epspvol22, epspvol12, pressure = 0.0;
194 computeDeviatoricStressVector(sig, epspvol, gp, tempStrain, pressure, tStep);
197 computeDeviatoricStressVector(sig, epspvol11, gp, strain, pressure, tStep);
200 computeDeviatoricStressVector(sig, epspvol22, gp, strain, pressure, tStep);
203 computeDeviatoricStressVector(sig, epspvol12, gp, strain, pressure, tStep);
206 dvol.
at(1) = ( epspvol11 - epspvol ) / h;
207 dvol.
at(2) = ( epspvol22 - epspvol ) / h;
208 dvol.
at(3) = ( epspvol12 - epspvol ) / h;
212 printf(
"Analytical volumetric deviatoric tangent = ");
214 printf(
"Numerical volumetric deviatoric tangent = ");
219 OOFEM_ERROR(
"Error in volumetric deviatoric tangent");
227 double epspvol, epspvolh, pressure = 0.0;
230 computeDeviatoricStressVector(sig, epspvol, gp, strain, pressure, tStep);
231 computeDeviatoricStressVector(sig, epspvolh, gp, strain, pressure + h, tStep);
233 double dvol = -( epspvolh - epspvol ) / h;
235 printf(
"Analytical volumetric pressure tangent = %e\n", dedp);
236 printf(
"Numerical volumetric pressure tangent = %e\n", dvol);
238 double norm = fabs(dvol - dedp);
239 if ( norm > fabs(dedp) *
DEBUG_ERR && norm > 0.0 ) {
240 OOFEM_ERROR(
"Error in volumetric pressure tangent");
265 if ( type == IST_VOFFraction ) {
268 }
else if ( type == IST_Pressure ) {
271 }
else if ( type == IST_Undefined ) {
277 double epspvol, epspvolh,
pressure = 0.0;
280 computeDeviatoricStressVector(sig, epspvol, gp, strain, pressure, tStep);
281 computeDeviatoricStressVector(sig, epspvolh, gp, strain, pressure + h, tStep);
283 double dvol = - ( epspvolh - epspvol ) / h;
287 printf(
"Numerical volumetric pressure tangent = %f\n", dvol);
291 OOFEM_ERROR(
"Error in volumetric pressure tangent");
321 if ( !this->
createRVE(n, gp, inputfile) ) {
337 em->checkProblemConsistency();
338 em->initMetaStepAttributes( em->giveMetaStep(1) );
342 this->
rve.reset( em );
344 std :: ostringstream name;
345 name << this->
rve->giveOutputBaseFileName() <<
"-gp" << n;
350 this->
rve->letOutputBaseFileNameBe( name.str() );
354 OOFEM_ERROR(
"RVE doesn't have necessary boundary condition; should have MixedGradientPressure as first b.c. (in first domain)");
367 double fluid_area = this->
rve->giveDomain(1)->giveSize();
372 this->
rve->updateYourself(tStep);
373 this->
rve->terminate(tStep);
388 return this->
rve->saveContext(stream, mode);
399 return this->
rve->restoreContext(stream, mode);
429 v = ( t.
at(1, 1) * 2. - t.
at(1, 2) - t.
at(1, 3) ) / 3. +
430 ( -t.
at(2, 1) + t.
at(2, 2) * 2. - t.
at(2, 3) ) / 3. +
431 ( -t.
at(3, 1) - t.
at(3, 2) + t.
at(3, 3) * 2. ) / 3. +
432 4. * ( t.
at(4, 4) + t.
at(5, 5) + t.
at(6, 6) );
435 v = ( t.
at(1, 1) * 2. - t.
at(1, 2) ) / 3. +
436 ( -t.
at(2, 1) + t.
at(2, 2) * 2. ) / 3. +
void letPressureBe(double val)
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
virtual void updateYourself(TimeStep *)
Update equilibrium history variables according to temp-variables.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
FE2FluidMaterialStatus(int n, Domain *d, GaussPoint *gp, const std::string &inputfile)
Creates new material status.
GaussPoint * gp
Associated integration point.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual double giveEffectiveViscosity(GaussPoint *gp, TimeStep *tStep)
Gives the effective viscosity for the given integration point.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
void computeTangents(TimeStep *tStep)
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
MixedGradientPressureBC * bc
Boundary condition in RVE that performs the computational homogenization.
double & at(int i)
Coefficient access function.
virtual void computeFields(FloatArray &stressDev, double &vol, TimeStep *tStep)=0
Computes the homogenized fields through sensitivity analysis.
double domainSize()
Computes the size (including pores) by surface integral over the domain.
void setTimeStep(TimeStep *tStep)
Copies time step data to RVE.
void letDeviatoricStrainRateVectorBe(FloatArray v)
virtual void giveDeviatoricStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the deviatoric stiffness; .
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
double giveTargetTime()
Returns target time.
bool isParallel() const
Returns true if receiver in parallel mode.
void setTime(double newt)
Sets target and intrinsic time to be equal.
void setTimeIncrement(double newDt)
Sets solution step time increment.
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver's output to given stream.
FloatMatrix & giveDeviatoricTangent()
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.
MatResponseMode
Describes the character of characteristic material matrix.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
double giveTimeIncrement()
Returns solution step associated time increment.
FloatArray & giveVolumetricDeviatoricTangent()
void letDeviatoricStressVectorBe(FloatArray v)
Sets the deviatoric stress.
virtual void setPrescribedPressure(double p)=0
Set prescribed pressure.
double & giveVolumetricPressureTangent()
EngngModel * InstanciateProblem(DataReader &dr, problemMode mode, int contextFlag, EngngModel *_master, bool parallelFlag)
Instanciates the new problem.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
This class implements a transport material status information.
int giveNumber()
Returns receiver's number.
std::unique_ptr< EngngModel > rve
The subscale flow.
void times(double f)
Multiplies receiver by factor f.
virtual ~FE2FluidMaterialStatus()
Destructor.
double at(int i, int j) const
Coefficient access function.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
MixedGradientPressureBC * giveBC()
Class representing material status for the subscale fluid, i.e an Representative Volume Element (RVE)...
FloatArray & giveDeviatoricPressureTangent()
void subtract(const FloatMatrix &a)
Subtracts matrix from the receiver.
Abstract base class representing a material status information.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
Class representing vector of real numbers.
virtual void computeDeviatoricStressVector(FloatArray &stress_dev, double &r_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...
bool isTheCurrentTimeStep()
Check if receiver is current solution step.
Implementation of matrix containing floating point numbers.
double computeFrobeniusNorm() const
Computes the Frobenius norm of the receiver.
IRResultType
Type defining the return values of InputRecord reading operations.
#define _IFT_FE2FluidMaterial_fileName
double norm(const FloatArray &x)
double computeNorm() const
Computes the norm (or length) of the vector.
virtual void printYourself() const
Print receiver on stdout.
bool createRVE(int n, GaussPoint *gp, const std::string &inputfile)
Creates/Initiates the RVE problem.
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
void zero()
Zeroes all coefficients of receiver.
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1)
void setColumn(const FloatArray &src, int c)
Sets the values of the matrix in specified column.
void times(double s)
Multiplies receiver with scalar.
void printYourself() const
Prints matrix to stdout. Useful for debugging.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Domain * giveDomain() const
virtual void computeTangents(FloatMatrix &Ed, FloatArray &Ep, FloatArray &Cd, double &Cp, TimeStep *tStep)=0
Computes the macroscopic tangents through sensitivity analysis.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
REGISTER_Material(DummyMaterial)
Abstract base class representing the "problem" under consideration.
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class representing the implementation of plain text date reader.
the oofem namespace is to define a context or scope in which all oofem names are defined.
General class for boundary condition that prolongates macroscopic fields to incompressible flow...
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class representing integration point in finite element program.
virtual void setPrescribedDeviatoricGradientFromVoigt(const FloatArray &ddev)=0
Sets the prescribed tensor from the matrix from given Voigt notation.
Class representing solution step.
void setNumber(int i)
Set receiver's number.
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.