55MacroLSpace :: MacroLSpace(
int n,
Domain *aDomain) :
LSpace(n, aDomain)
65MacroLSpace :: ~MacroLSpace() { }
68void MacroLSpace :: initializeFrom(
InputRecord &ir,
int priority)
70 LSpace :: initializeFrom(ir, priority);
79 if ( fopen(this->stiffMatrxFileName,
"r") != NULL ) {
80 stiffMatrxFile = fopen(this->stiffMatrxFileName,
"r");
83 if ( ( stiffMatrxFile = fopen(this->stiffMatrxFileName,
"w") ) == NULL ) {
84 OOFEM_ERROR(
"Can not create a new file %s\n", this->stiffMatrxFileName);
92void MacroLSpace :: postInitialize()
94 LSpace :: postInitialize();
120 OOFEM_ERROR(
"Micromaterial is already used on another element. Only one micromaterial can be assigned to one macro element");
143 OOFEM_LOG_INFO(
"\n** Assembling %s stiffness matrix of microproblem on macroElement %d, micTimeStep %d, micTime %f\n", __MatResponseModeToString(rMode), this->
giveNumber(), this->
microEngngModel->giveCurrentStep()->giveNumber(), this->microEngngModel->giveCurrentStep()->giveTargetTime() );
149 this->
microMaterial->giveMacroStiffnessMatrix(answer, this->
microEngngModel->giveCurrentStep(), rMode, this->microMasterNodes, this->microBoundaryNodes);
161void MacroLSpace :: changeMicroBoundaryConditions(
TimeStep *tStep)
166 FloatArray displ_x(8), displ_y(8), displ_z(8);
172 displ_x.at(i) = this->
giveNode(i)->giveDofWithID(D_u)->giveUnknown(VM_Total, tStep);
173 displ_y.at(i) = this->
giveNode(i)->giveDofWithID(D_v)->giveUnknown(VM_Total, tStep);
174 displ_z.
at(i) = this->
giveNode(i)->giveDofWithID(D_w)->giveUnknown(VM_Total, tStep);
186 OOFEM_ERROR(
"Couldn't create constant time function");
188 timeFunct->initializeFrom(ir_func);
199 for (
auto &DofMan :
microDomain->giveDofManagers() ) {
204 for (
Dof *dof: *DofMan ) {
206 dof->setBcId(counter);
208 displ = n.dotProduct(
id == D_u ? displ_x : (
id == D_v ? displ_y : displ_z ) );
214 OOFEM_ERROR(
"Couldn't create boundary condition.");
216 bc->initializeFrom(ir_bc);
217 microDomain->setBoundaryCondition(counter, std::move(bc));
221 for (
auto &dof: *DofMan ) {
231void MacroLSpace :: giveInternalForcesVector(
FloatArray &answer,
TimeStep *tStep,
int useUpdatedGpRecord)
236 double reactionForce;
244 if ( useUpdatedGpRecord ) {
247 OOFEM_LOG_INFO(
"\n*** Solving reactions of macroElement %d, micTimeStep %d, macIteration %d, micTime %f\n", this->
giveNumber(), this->
microEngngModel->giveCurrentStep()->giveNumber(), this->iteration, this->microEngngModel->giveCurrentStep()->giveTargetTime() );
270 reactionForce = reactions.
at(3 * i + j - 3);
271 for (
int k = 1; k <= 8; k++ ) {
272 answer.
at(3 * k + j - 3) += reactionForce * n.
at(k);
285void MacroLSpace :: evalInterpolation(
FloatArray &answer,
const std::vector< FloatArray > &coords,
const FloatArray &gcoords)
302 iRule->updateYourself(tStep);
#define _IFT_BoundaryCondition_PrescribedValue
[rn,optional] Prescribed value of all DOFs
#define REGISTER_Element(class)
int giveNumberOfDofs() const
const FloatArray & giveCoordinates() const
Node * giveNode(int i) const
virtual bool isActivated(TimeStep *tStep)
virtual int giveNumberOfNodes() const
virtual Material * giveMaterial()
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
Domain * giveDomain() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
int number
Component number.
void zero()
Zeroes all coefficients of receiver.
static FEI3dHexaLin interpolation
virtual void evalInterpolation(FloatArray &answer, const std::vector< FloatArray > &coords, const FloatArray &gcoords)
IntArray microBoundaryNodes
IntArray microMasterNodes
Array containing the node mapping from microscale (which microMasterNodes corresponds to which macroN...
IntArray microBoundaryDofManager
Stores node number on the boundary in the triplets.
MicroMaterial * microMaterial
EngngModel * microEngngModel
FloatArray internalMacroForcesVector
Array containg the force vector from nodes (if condensation is skipped, use this vector).
static ParamKey IPK_MacroLSpace_stiffMatrixFileName
TimeStep * lastStiffMatrixTimeStep
Last time step when stiffness matrix was assembled.
static ParamKey IPK_MacroLSpace_microMasterNodes
virtual void changeMicroBoundaryConditions(TimeStep *tStep)
Related to setting the boundary conditions of micro problem.
int stiffMatrxFileNoneReadingWriting
Process with external file for the storage of stiffness matrix 0-None, 1-read, 2-write.
static ParamKey IPK_MacroLSpace_microBoundaryNodes
int iteration
Information of iteration number.
void computeReaction(FloatArray &answer, TimeStep *tStep, int di)
double giveTargetTime()
Returns target time.
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
#define _IFT_ConstantFunction_f
#define _IFT_GeneralBoundaryCondition_timeFunct
#define OOFEM_LOG_INFO(...)
#define _IFT_MacroLspace_stiffMatrxFileName
ClassFactory & classFactory
#define PM_ELEMENT_ERROR_IFNOTSET(_pm, _componentnum, _paramkey)
#define PM_UPDATE_PARAMETER(_val, _pm, _ir, _componentnum, _paramkey, _prio)