73 #ifdef __PARALLEL_MODE 128 #ifdef __PARALLEL_MODE 137 comm = MPI_COMM_SELF;
161 #ifdef __PARALLEL_MODE 193 for (
int i = 1; i <=
ndomains; i++ ) {
205 bool inputReaderFinish =
true;
208 this->dataOutputFileName = std :: string(dataOutputFileName);
212 this->dataOutputFileName.append(
".oofeg");
233 inputReaderFinish =
false;
253 if ( inputReaderFinish ) {
289 if ( eeTypeId >= 0 ) {
297 #ifdef __PARALLEL_MODE 324 #ifdef __PARALLEL_MODE 341 result &= domain->instanciateYourself(dr);
357 for (
int i = 1; i <= this->
nMetaSteps; i++ ) {
363 for (
int i = 1; i <= this->
nMetaSteps; i++ ) {
424 node->askNewEquationNumbers(currStep);
428 int nnodes = elem->giveNumberOfInternalDofManagers();
429 for (
int k = 1; k <= nnodes; k++ ) {
430 elem->giveInternalDofManager(k)->askNewEquationNumbers(currStep);
435 for (
auto &bc : domain->
giveBcs() ) {
436 int nnodes = bc->giveNumberOfInternalDofManagers();
437 for (
int k = 1; k <= nnodes; k++ ) {
438 bc->giveInternalDofManager(k)->askNewEquationNumbers(currStep);
443 int initialProfile, optimalProfile;
461 OOFEM_LOG_DEBUG(
"Nominal profile %d (old) %d (new)\n", initialProfile, optimalProfile);
503 int smstep = 1, sjstep = 1;
512 for (
int imstep = smstep; imstep <=
nMetaSteps; imstep++, sjstep = 1 ) {
517 int nTimeSteps = activeMStep->giveNumberOfSteps();
518 for (
int jstep = sjstep; jstep <= nTimeSteps; jstep++ ) {
541 OOFEM_LOG_INFO(
"EngngModel info: user time consumed by solution step %d: %.2fs\n",
545 fprintf(this->
giveOutputStream(),
"\nUser time consumed by solution step %d: %.3f [s]\n\n",
549 #ifdef __PARALLEL_MODE 561 int smstep = 1, sjstep = 1;
598 #ifdef __PARALLEL_MODE 619 for (
auto &dman : domain->giveDofManagers() ) {
620 dman->updateYourself(tStep);
624 if ( domain->hasXfemManager() ) {
625 domain->giveXfemManager()->updateYourself(tStep);
629 VERBOSE_PRINT0(
"Updated nodes ", domain->giveNumberOfDofManagers())
633 for (
auto &elem : domain->giveElements() ) {
641 elem->updateYourself(tStep);
645 VERBOSE_PRINT0(
"Updated Elements ", domain->giveNumberOfElements())
700 domCount += domain->giveOutputManager()->testTimeStepOutput(tStep);
703 if ( domCount == 0 ) {
707 fprintf(file,
"\n==============================================================");
709 fprintf(file,
"\n==============================================================\n");
710 for (
auto &domain: domainList ) {
711 fprintf( file,
"Output for domain %3d\n", domain->giveNumber() );
713 domain->giveOutputManager()->doDofManOutput(file, tStep);
714 domain->giveOutputManager()->doElementOutput(file, tStep);
723 int dnum = domain->giveNumber();
724 fprintf( file,
"Output for domain %3d\n", dnum );
725 int nset = nodeSets.
giveSize() < dnum ? 0 : nodeSets.
at(dnum);
726 int eset = elementSets.
giveSize() < dnum ? 0 : elementSets.
at(dnum);
732 this->outputReactionForces(file, *domain, tStep, nset);
741 fprintf(file,
"\n\nNode output:\n------------------\n");
748 dman->printOutputAt(file, tStep);
753 for (
int inode : nodes ) {
761 fprintf(file,
"\n\n");
768 fprintf(file,
"\n\nElement output:\n---------------\n");
775 elem->printOutputAt(file, tStep);
779 for (
int ielem : elements ) {
787 fprintf(file,
"\n\n");
793 printf(
"\nEngineeringModel: instance %s\n", this->
giveClassName() );
812 #pragma omp parallel for shared(answer) private(mat, R, loc) 814 for (
int ielem = 1; ielem <= nelem; ielem++ ) {
828 if ( element->giveRotationMatrix(R) ) {
835 if ( answer.
assemble(loc, mat) == 0 ) {
841 for (
auto &bc : domain->
giveBcs() ) {
848 }
else if ( bc->giveSetNumber() ) {
849 if ( !bc->isImposed(tStep) )
continue;
850 auto load =
dynamic_cast< Load *
>(bc.get());
851 if ( !load )
continue;
858 Set *
set = domain->
giveSet( bc->giveSetNumber() );
860 if ( ( bodyLoad = dynamic_cast< BodyLoad * >(load) ) ) {
861 const IntArray &elements =
set->giveElementList();
862 for (
auto ielem : elements ) {
868 if ( element->giveRotationMatrix(R) ) {
876 }
else if ( ( sLoad = dynamic_cast< SurfaceLoad * >(load) ) ) {
877 const auto &surfaces =
set->giveBoundaryList();
878 for (
int ibnd = 1; ibnd <= surfaces.giveSize() / 2; ++ibnd ) {
879 auto element = domain->
giveElement( surfaces.at(ibnd * 2 - 1) );
880 int boundary = surfaces.at(ibnd * 2);
885 element->giveInterpolation()->boundaryGiveNodes(bNodes, boundary);
886 if ( element->computeDofTransformationMatrix(R, bNodes,
false) ) {
894 }
else if ( ( eLoad = dynamic_cast< EdgeLoad * >(load) ) ) {
895 const auto &edges =
set->giveEdgeList();
896 for (
int ibnd = 1; ibnd <= edges.giveSize() / 2; ++ibnd ) {
897 auto element = domain->
giveElement( edges.at(ibnd * 2 - 1) );
898 int boundary = edges.at(ibnd * 2);
903 element->giveInterpolation()->boundaryEdgeGiveNodes(bNodes, boundary);
904 if ( element->computeDofTransformationMatrix(R, bNodes,
false) ) {
917 OOFEM_ERROR(
"Contact problems temporarily deactivated");
939 #pragma omp parallel for shared(answer) private(mat, R, r_loc, c_loc) 941 for (
int ielem = 1; ielem <= nelem; ielem++ ) {
961 if ( answer.
assemble(r_loc, c_loc, mat) == 0 ) {
967 for (
auto &gbc : domain->
giveBcs() ) {
975 OOFEM_ERROR(
"Contant problems temporarily deactivated");
992 #ifdef __PARALLEL_MODE 995 MPI_Allreduce(& maxdofids, & val, 1, MPI_INT, MPI_MAX, this->
comm);
999 eNorms->
resize(maxdofids);
1029 #pragma omp parallel for shared(answer, eNorms) private(R, charVec, loc, dofids) 1031 for (
int i = 1; i <= nnode; i++ ) {
1054 #pragma omp critical 1078 for (
int i = 1; i <= nbc; ++i ) {
1083 if ( ( abc = dynamic_cast< ActiveBoundaryCondition * >(bc) ) ) {
1097 if ( ( bodyLoad = dynamic_cast< BodyLoad * >(load) ) ) {
1098 const IntArray &elements =
set->giveElementList();
1099 for (
int ielem = 1; ielem <= elements.
giveSize(); ++ielem ) {
1119 }
else if ( ( sLoad = dynamic_cast< SurfaceLoad * >(load) ) ) {
1120 const IntArray &boundaries =
set->giveBoundaryList();
1121 for (
int ibnd = 1; ibnd <= boundaries.
giveSize() / 2; ++ibnd ) {
1125 int boundary = boundaries.
at(ibnd * 2);
1145 }
else if ( ( eLoad = dynamic_cast< EdgeLoad * >(load) ) ) {
1146 const IntArray &edgeBoundaries =
set->giveEdgeList();
1147 for (
int ibnd = 1; ibnd <= edgeBoundaries.
giveSize() / 2; ++ibnd ) {
1150 int boundary = edgeBoundaries.
at(ibnd * 2);
1170 }
else if ( ( nLoad = dynamic_cast< NodalLoad * >(load) ) ) {
1171 const IntArray &nodes =
set->giveNodeList();
1172 for (
int idman = 1; idman <= nodes.
giveSize(); ++idman ) {
1222 #pragma omp parallel for shared(answer, eNorms) private(R, charVec, loc, dofids) 1224 for (
int i = 1; i <= nelem; i++ ) {
1247 #pragma omp critical 1261 for (
int iload=1; iload<=list.
giveSize(); iload++) {
1263 if ((bodyLoad = dynamic_cast< BodyLoad * >(domain->
giveLoad(list.
at(iload))))) {
1288 for (
int j=1; j<=list2.
giveSize()/2; j++) {
1289 int iload = list2.
at(j * 2 - 1) ;
1290 int boundary = list2.
at(j * 2);
1293 if ((eLoad = dynamic_cast< EdgeLoad * >(domain->
giveLoad(iload)))) {
1311 }
else if ((sLoad = dynamic_cast< SurfaceLoad * >(domain->
giveLoad(iload)))) {
1330 OOFEM_ERROR (
"Unsupported element boundary load type");
1356 #pragma omp parallel for shared(answer) private(R, charMatrix, charVec, loc, delta_u) 1358 for (
int i = 1; i <= nelems; i++ ) {
1404 #pragma omp critical 1432 #pragma omp parallel for shared(answer) private(R, charMatrix, charVec, loc, delta_u) 1434 for (
int i = 1; i <= nelems; i++ ) {
1463 #pragma omp critical 1506 for (
auto &elem : domain->giveElements() ) {
1514 elem->initForNewStep();
1577 domain->saveContext(stream, mode);
1616 if ( !stream.
read(istep) ) {
1632 if ( !this->
giveMetaStep(pmstep)->isStepValid(istep - 1) ) {
1664 domain->restoreContext(stream, mode);
1695 sprintf(fext,
".%d.%d.osf", tStepNumber, stepVersion);
1696 return fname + fext;
1705 sprintf(fext,
".domain.%d.%d.din", domainNum, domainSerNum);
1706 return fname + fext;
1713 return std::string(this->
giveClassName()) +
"::" + func +
", Rank: " + std::to_string(
rank);
1722 if ( ( i > 0 ) && ( i <= (
int)this->
domainList.size() ) ) {
1734 if ( i < 1 || i > (
int)this->
domainList.size() ) {
1737 if ( !iDeallocateOld ) {
1748 OOFEM_ERROR(
"context not initialized for this problem");
1767 if ( ( i > 0 ) && ( i <= this->
nMetaSteps ) ) {
1812 rsec = rmin = rhrs = 0;
1813 usec = umin = uhrs = 0;
1821 int rsec = 0, rmin = 0, rhrs = 0;
1822 int usec = 0, umin = 0, uhrs = 0;
1823 time_t endTime = time(NULL);
1832 fprintf(out,
"\nFinishing analysis on: %s\n", ctime(& endTime) );
1833 fprintf(out,
"Real time consumed: %03dh:%02dm:%02ds\n", rhrs, rmin, rsec);
1834 fprintf(out,
"User time consumed: %03dh:%02dm:%02ds\n\n\n", uhrs, umin, usec);
1838 OOFEM_LOG_FORCED(
"Real time consumed: %03dh:%02dm:%02ds\n", rhrs, rmin, rsec);
1839 OOFEM_LOG_FORCED(
"User time consumed: %03dh:%02dm:%02ds\n", uhrs, umin, usec);
1851 result &= domain->checkConsistency();
1874 istep = metaStep.setStepBounds(istep);
1878 domain->postInitialize();
1895 this->
comm = MPI_COMM_WORLD;
1896 MPI_Comm_rank(this->
comm, & this->
rank);
1899 OOFEM_ERROR(
"Can't do it, only compiled for sequential runs");
1901 #ifdef __VERBOSE_PARALLEL 1925 elem->drawYourself(gc, tStep);
1934 dman->drawYourself(gc, tStep);
1944 #ifdef __PARALLEL_MODE 1951 OOFEM_ERROR(
"Can't set up comm maps, parallel support not compiled");
1960 #ifdef __PARALLEL_MODE 1962 #ifdef __VERBOSE_PARALLEL 1967 tmp.
array = & answer;
1971 #ifdef __VERBOSE_PARALLEL 1977 #ifdef __VERBOSE_PARALLEL 1985 OOFEM_ERROR(
"Support for parallel mode not compiled in.");
2000 #ifdef __PARALLEL_MODE 2002 #ifdef __VERBOSE_PARALLEL 2008 #ifdef __VERBOSE_PARALLEL 2014 #ifdef __VERBOSE_PARALLEL 2019 OOFEM_ERROR(
"Receiveng and Unpacking remote element data");
2025 OOFEM_ERROR(
"Support for parallel mode not compiled in.");
2033 #ifdef __PARALLEL_MODE 2040 OOFEM_WARNING(
"No load balancer found, skipping load balancing step");
2063 #ifdef __VERBOSE_PARALLEL 2068 fprintf(stderr,
"\n[%d] Nodal Table\n", myrank);
2069 for (
int i = 1; i <= nnodes; i++ ) {
2071 fprintf( stderr,
"[%d]: %5d[%d] local ", myrank, i,
giveDomain(1)->giveDofManager(i)->giveGlobalNumber() );
2073 fprintf( stderr,
"[%d]: %5d[%d] shared ", myrank, i,
giveDomain(1)->giveDofManager(i)->giveGlobalNumber() );
2077 fprintf( stderr,
"(%d)", dof->giveEquationNumber(dn) );
2080 fprintf(stderr,
"\n");
2089 OOFEM_LOG_INFO(
"[%d] EngngModel info: user time consumed by load rebalancing %.2fs\n",
2105 for (
int i = 1; i <= toSendMap->
giveSize(); i++ ) {
2122 for (
int i = 1; i <= toRecvMap->
giveSize(); i++ ) {
2147 for (
int i = 1; i <= toSendMap->
giveSize(); i++ ) {
2149 for (
Dof *jdof: *dman ) {
2150 if ( jdof->isPrimaryDof() ) {
2151 int eqNum = jdof->giveEquationNumber(s);
2153 result &= pcbuff->
write( src->
at(eqNum) );
2176 for (
int i = 1; i <= toRecvMap->
giveSize(); i++ ) {
2179 for (
Dof *jdof: *dman ) {
2180 int eqNum = jdof->giveEquationNumber(s);
2181 if ( jdof->isPrimaryDof() && eqNum ) {
2182 result &= pcbuff->
read(value);
2184 dest->
at(eqNum) += value;
2186 dest->
at(eqNum) = value;
EngngModelTimer timer
E-model timer.
virtual void updateAttributes(MetaStep *mStep)
Update receiver attributes according to step metaStep attributes.
Class implementing a concentrated load (force, moment,...) that acts directly on a dof manager (node ...
virtual bool isImposed(TimeStep *tStep)
Returns nonzero if receiver representing BC is imposed at given time, otherwise returns zero...
void initialize()
Initialize graph from domain description.
virtual bool isActivated(TimeStep *tStep)
contextIOResultType storeYourself(DataStream &stream) const
Stores array to output stream.
The representation of EngngModel default unknown numbering.
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
void pauseTimer(EngngModelTimerType t)
void subtract(const FloatArray &src)
Subtracts array src to receiver.
int initExchange(int tag)
Initializes data exchange with all problems.
FILE * outputStream
Output stream.
DofManager in active domain is shared only by remote elements (these are only introduced for nonlocal...
#define _IFT_EngngModel_profileOpt
std::string giveContextFileName(int tStepNumber, int stepVersion) const
Returns the filename for the context file for the given step and version.
std::unique_ptr< TimeStep > currentStep
Current time step.
std::string simulationDescription
bool profileOpt
Profile optimized numbering flag (using Sloan's algorithm).
void initMetaStepAttributes(MetaStep *mStep)
Update e-model attributes attributes according to step metaStep attributes.
void askNewOptimalNumbering(TimeStep *tStep)
Numbers all the DOFs according to the optimal renumbering found.
Implementation of FileDataStream representing DataStream interface to file i/o.
char processor_name[PROCESSOR_NAME_LENGTH]
Processor name.
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)=0
Assembles sparse matrix from contribution of local elements.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
void assembleVectorFromDofManagers(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 into given vector.
virtual bool requiresEquationRenumbering(TimeStep *tStep)
Returns true if equation renumbering is required for given solution step.
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
LoadBalancerMonitor * lbm
std::string dataOutputFileName
Path to output stream.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
virtual IRResultType initializeFrom(InputRecord *ir)
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Base class for all matrices stored in sparse format.
enum fMode nonLinFormulation
Type of non linear formulation (total or updated formulation).
int giveNumberOfBoundaryConditions() const
Returns number of boundary conditions in domain.
ContextOutputMode giveContextOutputMode()
Returns domain context output mode.
void startTimer(EngngModelTimerType t)
int packAllData(T *ptr, int(T::*packFunc)(ProcessCommunicator &))
Pack all problemCommunicators data to their send buffers.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
bool isEmpty() const
Checks if receiver is empty (i.e., zero sized).
std::string coreOutputFileName
String with core output file name.
virtual void packMigratingData(TimeStep *tStep)
Packs receiver data when rebalancing load.
std::vector< std::unique_ptr< Domain > > domainList
List of problem domains.
virtual void doStepOutput(TimeStep *tStep)
Prints the ouput of the solution step (using virtual this->printOutputAtservice) to the stream detemi...
problemMode giveProblemMode()
Returns domain mode.
std::unique_ptr< TimeStep > previousStep
Previous time step.
ExportModuleManager * giveExportModuleManager()
Returns receiver's export module manager.
double & at(int i)
Coefficient access function.
MetaStep * giveMetaStep(int i)
Returns the i-th meta step.
void letOutputBaseFileNameBe(const std::string &src)
Sets the base output file name.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
EngngModel(int i, EngngModel *_master=NULL)
Constructor.
int nonlocalExt
Flag indicating if nonlocal extension active, which will cause data to be sent between shared element...
Class implementing element body load, acting over whole element volume (e.g., the dead weight)...
const IntArray & giveBodyLoadList() const
Returns receiver list of bodyloads.
virtual const IntArray & giveDofIDs() const
Array with default dofs which b.c.
virtual void locationFromElement(IntArray &loc, Element &element, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
void clear()
Clears receiver (zero size).
virtual ~EngngModel()
Destructor.
This base class is an abstraction for numerical algorithm.
virtual void matrixFromElement(FloatMatrix &mat, Element &element, TimeStep *tStep) const
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual int instanciateYourself(DataReader &dr, InputRecord *ir)
Reads receiver description from input stream and creates corresponding modules components accordingly...
void outputElements(FILE *file, Domain &domain, TimeStep *tStep, int setNum)
Outputs all elements in the given set.
const IntArray & giveBoundaryLoadList() const
Returns receiver list of boundary loads.
time_t startTime
Solution start time.
int instanciateMetaSteps(DataReader &dr)
Instanciate problem meta steps by calling their instanciateYourself() service.
ErrorEstimator * defaultErrEstimator
Error estimator. Useful for adaptivity, or simply printing errors output.
int numProcs
Total number of collaborating processes.
void initTimer(EngngModelTimerType t)
double giveTargetTime()
Returns target time.
void doInit()
Performs the initialization of individual modules.
bool isParallel() const
Returns true if receiver in parallel mode.
void doOutput(TimeStep *tStep, bool substepFlag=false)
Writes the output.
Abstract base class for all finite elements.
virtual void terminate(TimeStep *tStep)
Terminates the solution of time step.
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
Base class for dof managers.
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
virtual void solveYourself()
Starts solution process.
bool force_load_rebalance_in_first_step
Debug flag forcing load balancing after first step.
void stopTimer(EngngModelTimerType t)
virtual void printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *tStep)
DOF printing routine.
int giveNumber()
Returns domain number.
CommunicationBuffer * giveRecvBuff()
Returns receive buffer of receiver.
Class representing the abstraction for input data source.
int giveNumberOfElements() const
Returns number of elements in domain.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to stream, for given time step.
virtual void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep)
Computes characteristic matrix of receiver of requested type in given time step.
int unpackAndUpdateUnknowns(DataStream &buff, TimeStep *tStep)
Unpack and updates all necessary data of element (according to its parallel_mode) integration points ...
The ProcessCommunicator and corresponding buffers (represented by this class) are separated in order ...
#define _IFT_EngngModel_nonLinFormulation
void outputNodes(FILE *file, Domain &domain, TimeStep *tStep, int setNum)
Outputs all nodes in the given set.
int instanciateDomains(DataReader &dr)
Instanciate problem domains by calling their instanciateYourself() service.
#define OOFEM_LOG_DEBUG(...)
void migrateLoad(Domain *d)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
virtual std::string giveReferenceName() const =0
Gives the reference file name (e.g. file name)
int givePartitionsConnectivitySize()
Returns number of partitions sharing given receiver (=number of shared partitions + local one)...
void terminate()
Terminates the receiver, the corresponding terminate module services are called.
virtual void setUpCommunicationMaps(EngngModel *emodel, bool excludeSelfCommFlag, bool forceReinit=false)=0
Service for setting up the communication patterns with other remote process.
virtual IRResultType initializeFrom(InputRecord *ir)
Instanciates the receiver from input record.
dofManagerParallelMode
In parallel mode, this type indicates the mode of DofManager.
void rotatedWith(FloatMatrix &r, char mode)
Returns the receiver a rotated according the change-of-base matrix r.
ErrorEstimatorType
Determines the type of error estimator.
const UnknownNumberingScheme * numbering
Class representing and implementing InitModuleManager.
int finishExchange()
Finishes the exchange.
#define OOFEM_LOG_RELEVANT(...)
void saveStepContext(TimeStep *tStep, ContextMode mode)
Saves context of given solution step, if required (determined using this->giveContextOutputMode() met...
void setParallelMode(bool newParallelFlag)
Sets the problem to run in parallel (or not).
virtual void assembleFromActiveBC(FloatArray &answer, ActiveBoundaryCondition &bc, TimeStep *tStep, ValueModeType mode, const UnknownNumberingScheme &s, FloatArray *eNorms) const
void assembleExtrapolatedForces(FloatArray &answer, TimeStep *tStep, CharType type, Domain *domain)
Assembles the extrapolated internal forces vector, useful for obtaining a good initial guess in nonli...
problemMode pMode
Domain mode.
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
virtual void giveBoundarySurfaceNodes(IntArray &bNodes, int boundary)
Returns list of receiver boundary nodes for given surface.
const IntArray * giveToSendMap()
Returns receiver to send map.
virtual void initStepIncrements()
Initializes solution of new time step.
void computeVectorOfPrescribed(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of prescribed unknowns.
InitModuleManager * initModuleManager
Initialization module manager.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
bool isTheFirstStep()
Check if receiver is first step.
If required (for backtracking computation).
Class representing and implementing ExportModuleManager.
#define VERBOSE_PRINT0(str, number)
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
bool isNotEmpty() const
Tests for empty matrix.
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.
#define _IFT_EngngModel_parallelflag
#define VERBOSE_PRINTS(str, str1)
virtual void initParallelContexts()
Creates parallel contexts.
bool loadBalancingFlag
If set to true, load balancing is active.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to stream, for given time step.
MetaStep * giveCurrentMetaStep()
Returns current meta step.
std::vector< std::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
int giveSetNumber()
Gives the set number which boundary condition is applied to.
ProblemCommunicator * nonlocCommunicator
NonLocal Communicator. Necessary when nonlocal constitutive models are used.
void assembleVectorFromContacts(FloatArray &answer, TimeStep *tStep, CharType type, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
virtual void preInitializeNextStep()
Does a pre-initialization of the next time step (implement if necessarry)
int giveContextOutputStep()
Returns domain context output step.
virtual bool computeDofTransformationMatrix(FloatMatrix &answer, const IntArray &nodes, bool includeInternal)
Returns transformation matrix for DOFs from global coordinate system to local coordinate system in no...
int packDofManagers(ArrayWithNumbering *src, ProcessCommunicator &processComm)
Packing function for vector values of DofManagers.
int giveNumber()
Returns receiver's number.
#define OOFEM_LOG_INFO(...)
virtual NumericalMethod * giveNumericalMethod(MetaStep *mStep)
Returns reference to receiver's numerical method.
FILE * giveOutputStream()
Returns file descriptor of output file.
Element * giveElement(int n)
Service for accessing particular domain fe element.
Callback class for assembling specific types of vectors.
virtual int write(const int *data, int count)
Writes count integer values from array pointed by data.
virtual int assembleBegin()
Starts assembling the elements.
Class CommunicationBuffer provides abstraction for communication buffer.
NumericalCmpn
Type representing numerical component.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
IntArray domainPrescribedNeqs
Number of prescribed equations per domain.
virtual void drawNodes(oofegGraphicContext &gc)
EngngModelContext * giveContext()
Context requesting service.
virtual void drawElements(oofegGraphicContext &gc)
virtual double giveVariableScale(VarScaleType varId)
Returns the scale factor for given variable type.
Callback class for assembling specific types of matrices.
void clear()
Clears the array (zero size).
int numberOfSteps
Total number of time steps.
int ndomains
Number of receiver domains.
double getWtime(EngngModelTimerType t)
Returns elapsed wall clock time.
virtual void updateComponent(TimeStep *tStep, NumericalCmpn cmpn, Domain *d)
Updates components mapped to numerical method if necessary during solution process.
virtual void vectorFromSurfaceLoad(FloatArray &vec, Element &element, SurfaceLoad *load, int boundary, TimeStep *tStep, ValueModeType mode) const
int rank
Domain rank in a group of collaborating processes (0..groupSize-1).
int updateSharedDofManagers(FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
Exchanges necessary remote DofManagers data.
virtual void assembleFromActiveBC(SparseMtrx &k, ActiveBoundaryCondition &bc, TimeStep *tStep, const UnknownNumberingScheme &s_r, const UnknownNumberingScheme &s_c) const
virtual void balanceLoad(TimeStep *tStep)
Recovers the load balance between processors, if needed.
EngngModelContext * context
Context.
ProcessCommunicatorBuff * giveProcessCommunicatorBuff()
Returns communication buffer.
virtual int estimateError(EE_ErrorMode mode, TimeStep *tStep)=0
Estimates the error on associated domain at given time step.
#define VERBOSEPARALLEL_PRINT(service, str, rank)
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Returns the location array (array of code numbers) of receiver for given numbering scheme...
const IntArray * giveToRecvMap()
Returns receiver to receive map.
Set of elements, boundaries, edges and/or nodes.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
TimeStep * generateNextStep()
Generate new time step (and associate metastep).
virtual void matrixFromSurfaceLoad(FloatMatrix &mat, Element &element, SurfaceLoad *load, int boundary, TimeStep *tStep) const
void rotatedWith(const FloatMatrix &r, char mode= 'n')
Returns the receiver 'a' transformed using give transformation matrix r.
const IntArray & giveNodeList()
Returns list of all nodes within set.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
int giveNumberOfSteps(bool force=false)
Returns total number of steps.
ProblemCommunicator * communicator
Communicator.
Abstract base class representing an edge load (force, momentum, ...) that acts directly on a edge bou...
Class representing process communicator for engineering model.
#define _IFT_EngngModel_suppressOutput
static void convert2HMS(int &nhrs, int &nmin, int &nsec, double tsec)
Converts total seconds into hours, mins, and seconds.
Set * giveSet(int n)
Service for accessing particular domain set.
virtual ParallelContext * giveParallelContext(int n)
Returns the parallel context corresponding to given domain (n) and unknown type Default implementatio...
void giveCompleteMasterDofIDArray(IntArray &dofIDArray) const
Returns the full dof ID array of receiver.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
void setDomain(int i, Domain *ptr, bool iDeallocateOld=true)
Sets i-th domain of receiver.
virtual void drawYourself(oofegGraphicContext &gc)
EngngModel * master
Master e-model; if defined receiver is in maintained (slave) mode.
#define _IFT_EngngModel_contextoutputstep
virtual bool giveRotationMatrix(FloatMatrix &answer)
Transformation matrices updates rotation matrix between element-local and primary DOFs...
CommunicatorBuff * commBuff
Common Communicator buffer.
int nMetaSteps
Number of meta steps.
virtual int giveNumberOfFirstStep(bool force=false)
Returns number of first time step used by receiver.
Abstract base class for all active boundary conditions.
Enable for post-processing.
Abstract base class for all boundary conditions of problem.
#define _IFT_EngngModel_nsteps
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
virtual void postInitialize()
Performs post-initialization for all the problem contents (which is called after initializeFrom).
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
#define _IFT_EngngModel_renumberFlag
ExportModuleManager * exportModuleManager
Export module manager.
void resize(int n)
Checks size of receiver towards requested bounds.
double giveSolutionStepTime()
Returns the user time of the current simulation step in seconds.
Graph representing the undirected graph used for Sloan algorithm for symmetric matrix profile reducti...
ErrorEstimator * createErrorEstimator(ErrorEstimatorType type, int num, Domain *d)
Creates new instance of ErrorEstimator corresponding to given type.
#define _IFT_EngngModel_forceloadBalancingFlag
contextIOResultType restoreYourself(DataStream &stream)
Restores array from image on stream.
#define _IFT_EngngModel_eetype
void terminateAnalysis()
Performs analysis termination after finishing analysis.
virtual InputRecord * giveInputRecord(InputRecordType irType, int recordId)=0
Returns input record corresponding to given InputRecordType value and its record_id.
virtual void unpackMigratingData(TimeStep *tStep)
Unpacks receiver data when rebalancing load.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
virtual void vectorFromNodeLoad(FloatArray &vec, DofManager &dman, NodalLoad *load, TimeStep *tStep, ValueModeType mode) const
void printYourself()
Prints state of receiver. Useful for debugging.
virtual void locationFromElement(IntArray &loc, Element &element, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
Default implementation takes all the DOF IDs.
virtual int forceEquationNumbering()
Forces equation renumbering on all domains associated to engng model.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
std::string giveDomainFileName(int domainNum, int domainSerNum) const
Returns the filename for the given domain (used by adaptivity and restore)
Class representing vector of real numbers.
int unpackAllData(T *ptr, int(T::*unpackFunc)(ProcessCommunicator &))
Unpack all problemCommuncators data from recv buffers.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
virtual int checkConsistency()
Allows programmer to test some receiver's internal data, before computation begins.
IntArray domainNeqs
Number of equations per domain.
virtual int checkProblemConsistency()
Allows programmer to test problem its internal data, before computation begins.
virtual void calculateLoadTransfer()=0
Abstract base class representing a surface load (force, momentum, ...) that acts directly on a surfac...
Input attribute of domain (each n-th step).
Implementation of matrix containing floating point numbers.
virtual void locationFromElementNodes(IntArray &loc, Element &element, const IntArray &bNodes, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
IRResultType
Type defining the return values of InputRecord reading operations.
virtual int instanciateDefaultMetaStep(InputRecord *ir)
Instanciate default metastep, if nmsteps is zero.
virtual bool isDefault() const
Returns true, if receiver is the default engngModel equation numbering scheme; This is useful for som...
#define _IFT_EngngModel_loadBalancingFlag
virtual void initializeYourself(TimeStep *tStep)
Provides the opportunity to initialize state variables stored in element integration points according...
int unpackDofManagers(ArrayWithNumbering *dest, ProcessCommunicator &processComm)
Unpacking function for vector values of DofManagers .
ContactManager * giveContactManager()
void assembleVectorFromBC(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Assembles characteristic vector of required type from boundary conditions.
std::string errorInfo(const char *func) const
Returns string for prepending output (used by error reporting macros).
void giveCompleteLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s) const
Returns full location array of receiver containing equation numbers of all dofs of receiver...
virtual void init()
Initializes the receiver state.
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 bool isElementActivated(int elemNum)
virtual LoadBalancerDecisionType decide(TimeStep *)=0
Returns flag indicating whether rebalancing is necessary; should update node weights as well...
This class provides an communication context for distributed memory parallelism.
CommunicationBuffer * giveSendBuff()
Returns send buffer of receiver.
virtual void vectorFromLoad(FloatArray &vec, Element &element, BodyLoad *load, TimeStep *tStep, ValueModeType mode) const
virtual void vectorFromEdgeLoad(FloatArray &vec, Element &element, EdgeLoad *load, int edge, TimeStep *tStep, ValueModeType mode) const
virtual void matrixFromEdgeLoad(FloatMatrix &mat, Element &element, EdgeLoad *load, int edge, TimeStep *tStep) const
fMode
Type representing the type of formulation (total or updated) of non-linear computation.
int parallelFlag
Flag indicating that the receiver runs in parallel.
MPI_Comm comm
Communication object for this engineering model.
int giveNumberOfDomains()
Returns number of domains in problem.
void resumeTimer(EngngModelTimerType t)
void zero()
Zeroes all coefficients of receiver.
Class implementing single timer, providing wall clock and user time capabilities. ...
void assemblePrescribedExtrapolatedForces(FloatArray &answer, TimeStep *tStep, CharType type, Domain *domain)
std::string referenceFileName
String with reference file name.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to output domain stream, for given time step.
void assembleSquared(const FloatArray &fe, const IntArray &loc)
Assembles the array fe with each component squared.
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1)
int giveMaxDofID()
Gives the current maximum dof ID used.
void times(double s)
Multiplies receiver with scalar.
Class EngngModelContext represents a context, which is shared by all problem engng sub-models...
void initializeCommMaps(bool forceInit=false)
ClassFactory & classFactory
virtual int instanciateYourself(DataReader &dr, InputRecord *ir, const char *outFileName, const char *desc)
Initializes whole problem according to its description stored in inputStream.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
LoadBalancer * lb
Load Balancer.
virtual int assembleEnd()
Returns when assemble is completed.
void initParallel()
Request domain rank and problem size.
Element in active domain is only mirror of some remote element.
IntArray * giveLoadArray()
Returns the array containing applied loadings of the receiver.
bool renumberFlag
Renumbering flag (renumbers equations after each step, necessary if Dirichlet BCs change)...
void initialize()
Initializes output manager.
bool suppressOutput
Flag for suppressing output to file.
virtual int read(int *data, int count)
Reads count integer values into array pointed by data.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void setUDContextOutputMode(int cStep)
Sets user defined context output mode (it sets contextOutputMode to contextOutputMode), setting contextOutputStep to given value.
void giveAnalysisTime(int &rhrs, int &rmin, int &rsec, int &uhrs, int &umin, int &usec)
Returns the real and user time for the analysis.
std::vector< std::unique_ptr< Element > > & giveElements()
void assembleVectorFromElements(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Assembles characteristic vector of required type from elements into given vector. ...
virtual IRResultType initializeFrom(InputRecord *ir)
Instanciates the receiver from input record.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
Load is base abstract class for all loads.
Abstract base class representing the "problem" under consideration.
DofManager in active domain is only mirror of some remote DofManager.
#define OOFEM_LOG_FORCED(...)
int unpackRemoteElementData(ProcessCommunicator &processComm)
Unpacks data for remote elements (which are mirrors of remote partition's local elements).
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
int exchangeRemoteElementData(int ExchangeTag)
Exchanges necessary remote element data with remote partitions.
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
#define _IFT_EngngModel_nmsteps
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool isNotEmpty() const
Returns true if receiver is not empty.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
problemScale pScale
Multiscale mode.
int packRemoteElementData(ProcessCommunicator &processComm)
Packs data of local element to be received by their remote counterpart on remote partitions.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
virtual void matrixFromLoad(FloatMatrix &mat, Element &element, BodyLoad *load, TimeStep *tStep) const
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
int giveOptimalProfileSize()
Returns the optimal profile found.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
std::vector< MetaStep > metaStepList
List of problem metasteps.
ContextOutputMode contextOutputMode
Domain context output mode.
Load * giveLoad(int n)
Service for accessing particular domain load.
bool isNotTheLastStep()
Check if solution step is not the last step.
void giveLocationArray(const IntArray &dofIDArry, IntArray &locationArray, const UnknownNumberingScheme &s) const
Returns location array (array containing for each requested dof related equation number) for given nu...
DofManager is local, there are no contribution from other domains to this DofManager.
virtual LoadBalancer * giveLoadBalancer()
Returns reference to receiver's load balancer.
double getUtime(EngngModelTimerType t)
Returns total user time elapsed.
double getUtime()
Returns total user time elapsed in seconds.
int numberOfPrescribedEquations
Total number or prescribed equations in current time step.
virtual LoadBalancerMonitor * giveLoadBalancerMonitor()
Returns reference to receiver's load balancer monitor.
std::vector< ParallelContext > parallelContextList
List where parallel contexts are stored.
#define OOFEM_WARNING(...)
virtual void giveBoundaryEdgeNodes(IntArray &bNodes, int boundary)
Returns list of receiver boundary nodes for given edge.
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...
Helper struct to pass array and numbering scheme as a single argument.
Class representing solution step.
void tryParameters(int wdeg, int wdis)
Generates the new nodal numbering based on given parameters.
const IntArray & giveElementList()
Returns list of elements within set.
DofManager is shared by neighboring partitions, it is necessary to sum contributions from all contrib...
dofManagerParallelMode giveParallelMode() const
Return dofManagerParallelMode of receiver.
virtual void printSingleOutputAt(FILE *file, TimeStep *tStep, char ch, ValueModeType mode, double scale=1.0)
Prints Dof output (it prints value of unknown related to dof at given timeStep).
virtual void printStatistics() const
Print receiver statistics.
virtual bool computeM2LTransformation(FloatMatrix &answer, const IntArray &dofIDArry)
Computes transformation matrix from local DOFs to master DOFs; .
void Instanciate_init()
Initialization of the receiver state (opening the default output stream, empty domain creation...
void resize(int s)
Resizes receiver towards requested size.
int numberOfEquations
Total number of equation in current time step.
OGC_PlotModeType giveIntVarPlotMode()
virtual const char * giveClassName() const =0
Returns class name of the receiver.
virtual void locationFromElementNodes(IntArray &loc, Element &element, const IntArray &bNodes, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
Default implementation takes all the DOF IDs.
int equationNumberingCompleted
Equation numbering completed flag.