129 answer = {stress[0], stress[1], stress[2], 0.5*(stress[3]+stress[6]), 0.5*(stress[4]+stress[7]), 0.5*(stress[5]+stress[8])};
160 for(
int i = 1; i <= dim; i++) {
171 for(
int i = 1; i <= dim; i++) {
172 for(
int j = 1; j <= dim; j++) {
173 answer.
at(j,i) -= sig.
at(j);
226 for (
int k = 1; k <= 6; ++k ) {
233 numericalATS.
times(1. / hh);
254 mNewlyInitialized(true)
280 em->checkProblemConsistency();
281 em->initMetaStepAttributes( em->giveMetaStep(1) );
285 this->
rve.reset( em );
287 std :: ostringstream name;
288 name << this->
rve->giveOutputBaseFileName() <<
"-gp" << n;
293 this->
rve->letOutputBaseFileNameBe( name.str() );
297 OOFEM_ERROR(
"RVE doesn't have necessary boundary condition; should have a type of PrescribedGradientHomogenization as first b.c.");
339 this->
rve->updateYourself(tStep);
340 this->
rve->terminate(tStep);
354 return this->
rve->saveContext(stream, mode);
366 return this->
rve->restoreContext(stream, mode);
394 OOFEM_ERROR(
"Failed to cast StructuralFE2MaterialStatus.")
412 if ( ext_xMan != NULL ) {
415 std::vector<std::unique_ptr<EnrichmentItem>> eiList;
423 for (
int i = 1; i <= nEI; i++ ) {
437 if ( ei.get() == NULL ) {
438 OOFEM_ERROR(
"unknown enrichment item (%s)", name.c_str() );
441 ei->initializeFrom(mir);
442 ei->instanciateYourself(dataReader);
443 eiList.push_back( std :: move(ei) );
451 rve->forceEquationNumbering();
461 bool deallocateOld =
true;
462 rve->setDomain(1, newDomain, deallocateOld);
465 rve->giveNumericalMethod(NULL)->setDomain(newDomain);
467 rve->postInitialize();
470 rve->initMetaStepAttributes(
rve->giveMetaStep(1) );
480 double crackLength = 0.0;
486 std :: ostringstream name;
487 name << this->
rve->giveOutputBaseFileName() <<
"-gp" << num <<
"crackLength" << crackLength;
494 this->
rve->letOutputBaseFileNameBe( name.str() );
504 if ( xfemSolInt && statStruct ) {
510 int numDofsNew =
rve->giveNumberOfDomainEquations( 1, num );
515 xfemSolInt->xfemUpdatePrimaryField(*statStruct, tStep, u);
518 rve->giveNumericalMethod(NULL)->setDomain(newDomain);
528 int numExpModules =
rve->giveExportModuleManager()->giveNumberOfModules();
529 for (
int i = 1; i <= numExpModules; i++ ) {
532 if ( vtkxmlMod != NULL ) {
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
The representation of EngngModel default unknown numbering.
void letTempStrainVectorBe(const FloatArray &v)
Assigns tempStrainVector to given vector v.
Abstract class representing entity, which is included in the FE model using one (or more) global func...
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
void clearEnrichmentItems()
Remove all enrichment items.
GaussPoint * gp
Associated integration point.
EnrichmentItem * createEnrichmentItem(const char *name, int num, XfemManager *xm, Domain *domain)
Class representing the implementation of a dynamic data reader for in-code use.
virtual const char * giveClassName() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual void computeField(FloatArray &sigma, TimeStep *tStep)=0
Computes the homogenized, macroscopic, field (stress).
#define _IFT_StructuralFE2Material_fileName
void setDomain(Domain *ipDomain)
Class for homogenization of applied gradients.
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedE, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
void setPrescribedGradientVoigt(const FloatArray &t)
Sets the prescribed gradient from the matrix from given voigt notation.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Provides extra solver functionality needed for XFEM.
double & at(int i)
Coefficient access function.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
void postInitialize()
Performs post-initialization for all the domain contents (which is called after initializeFrom).
This class implements a structural material status information.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Solves a static structural problem.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
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.
void computeTangent(TimeStep *tStep)
XfemStructureManager: XFEM manager with extra functionality specific for the sm module.
virtual void computeTangent(FloatMatrix &tangent, TimeStep *tStep)=0
Computes the macroscopic tangent for homogenization problems through sensitivity analysis.
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
MatResponseMode
Describes the character of characteristic material matrix.
XfemManager * giveXfemManager()
FloatMatrix & giveTangent()
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
static void giveFullSymVectorForm(FloatArray &answer, const FloatArray &vec, MaterialMode matMode)
Converts the reduced unsymmetric Voigt vector (2nd order tensor) to full form.
void setTimeStep(TimeStep *tStep)
Copies time step data to RVE.
double giveTimeIncrement()
Returns solution step associated time increment.
PrescribedGradientHomogenization * giveBC()
int giveNumberOfEnrichmentItems() const
EngngModel * InstanciateProblem(DataReader &dr, problemMode mode, int contextFlag, EngngModel *_master, bool parallelFlag)
Instanciates the new problem.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
int giveNumber()
Returns receiver's number.
virtual InputRecord * giveInputRecord(InputRecordType, int recordId)
Returns input record corresponding to given InputRecordType value and its record_id.
void times(double f)
Multiplies receiver by factor f.
virtual void copyStateVariables(const MaterialStatus &iStatus)
Functions for MaterialStatusMapperInterface.
virtual ~StructuralFE2Material()
const FloatArray & giveTempStrainVector() const
Returns the const pointer to receiver's temporary strain vector.
double at(int i, int j) const
Coefficient access function.
std::unique_ptr< EngngModel > rve
The RVE.
Represents VTK (Visualization Toolkit) export module.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
PrescribedGradientHomogenization * bc
Boundary condition in RVE that performs the computational homogenization.
void subtract(const FloatMatrix &a)
Subtracts matrix from the receiver.
Abstract base class representing a material status information.
Class representing vector of real numbers.
StructuralFE2Material(int n, Domain *d)
bool createRVE(int n, GaussPoint *gp, const std::string &inputfile)
Creates/Initiates the RVE problem.
bool isTheCurrentTimeStep()
Check if receiver is current solution step.
StructuralFE2MaterialStatus(int n, Domain *d, GaussPoint *g, const std::string &inputfile)
Implementation of matrix containing floating point numbers.
double computeFrobeniusNorm() const
Computes the Frobenius norm of the receiver.
This class manages the xfem part.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
NodalRecoveryModel * giveSmoother()
Returns the internal smoother.
void letTempStressVectorBe(const FloatArray &v)
Assigns tempStressVector to given vector v.
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
virtual void copyStateVariables(const MaterialStatus &iStatus)
Functions for MaterialStatusMapperInterface.
double norm(const FloatArray &x)
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
void appendEnrichmentItems(std::vector< std::unique_ptr< EnrichmentItem > > &iEIlist)
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual double domainSize(Domain *d, int set)
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.
EnrichmentItem * giveEnrichmentItem(int n)
ClassFactory & classFactory
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Abstract base class for all "structural" constitutive models.
virtual void appendInputRecords(DynamicDataReader &oDR)=0
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
void zero()
Zeroes all coefficient of receiver.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Domain * giveDomain() const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
REGISTER_Material(DummyMaterial)
Abstract base class representing the "problem" under consideration.
double computeTotalCrackLength()
Compute the total length of all cracks in the domain.
int giveSize() const
Returns the size of receiver.
Class representing the implementation of plain text date reader.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
void SetEngngModel(EngngModel *ipEngngModel)
NodalRecoveryModel * givePrimVarSmoother()
Returns the smoother for primary variables (nodal averaging).
#define _IFT_StructuralFE2Material_useNumericalTangent
Class representing integration point in finite element program.
Class representing solution step.
void setNumber(int i)
Set receiver's number.
static void giveReducedSymMatrixForm(FloatMatrix &answer, const FloatMatrix &full, MaterialMode matMode)
Converts the full unsymmetric Voigt matrix (4th order tensor) to reduced form.
void resize(int s)
Resizes receiver towards requested size.