OOFEM 3.0
Loading...
Searching...
No Matches
oofem::TransientTransportProblem Class Reference

#include <transienttransportproblem.h>

Inheritance diagram for oofem::TransientTransportProblem:
Collaboration diagram for oofem::TransientTransportProblem:

Public Member Functions

 TransientTransportProblem (int i, EngngModel *master=nullptr)
void solveYourselfAt (TimeStep *tStep) override
void updateComponent (TimeStep *tStep, NumericalCmpn cmpn, Domain *d) override
bool newDofHandling () override
void updateSolution (FloatArray &solutionVector, TimeStep *tStep, Domain *d) override
void updateInternalRHS (FloatArray &answer, TimeStep *tStep, Domain *d, FloatArray *eNorm) override
void updateMatrix (SparseMtrx &mat, TimeStep *tStep, Domain *d) override
double giveUnknownComponent (ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof) override
void saveContext (DataStream &stream, ContextMode mode) override
void restoreContext (DataStream &stream, ContextMode mode) override
virtual void applyIC ()
int requiresUnknownsDictionaryUpdate () override
int giveUnknownDictHashIndx (ValueModeType mode, TimeStep *tStep) override
void updateDomainLinks () override
FunctiongiveDtFunction ()
double giveDeltaT (int n)
double giveDiscreteTime (int iStep)
TimeStepgiveNextStep () override
 Returns next time step (next to current step) of receiver.
TimeStepgiveSolutionStepWhenIcApply (bool force=false) override
NumericalMethodgiveNumericalMethod (MetaStep *mStep) override
 Returns reference to receiver's numerical method.
void initializeFrom (InputRecord &ir) override
bool requiresEquationRenumbering (TimeStep *tStep) override
int forceEquationNumbering () override
void printOutputAt (FILE *file, TimeStep *tStep) override
void updateYourself (TimeStep *tStep) override
int checkConsistency () override
FieldPtr giveField (FieldType key, TimeStep *tStep) override
const char * giveInputRecordName () const
const char * giveClassName () const override
 Returns class name of the receiver.
fMode giveFormulation () override
 EngngModel (int i, EngngModel *_master=NULL)
virtual ~EngngModel ()
 Destructor.
 EngngModel (const EngngModel &)=delete
EngngModeloperator= (const EngngModel &)=delete
DomaingiveDomain (int n)
void setDomain (int i, Domain *ptr, bool iDeallocateOld=true)
int giveNumberOfDomains ()
 Returns number of domains in problem.
const std::string & giveDescription () const
const time_t & giveStartTime ()
bool giveSuppressOutput () const
virtual ErrorEstimatorgiveDomainErrorEstimator (int n)
virtual MaterialInterfacegiveMaterialInterface (int n)
void setNumberOfEquations (int id, int neq)
FILE * giveOutputStream ()
 Returns file descriptor of output file.
std::string giveOutputBaseFileName ()
std::string giveReferenceFileName ()
void letOutputBaseFileNameBe (const std ::string &src)
ContextOutputMode giveContextOutputMode () const
int giveContextOutputStep () const
void setContextOutputMode (ContextOutputMode contextMode)
void setUDContextOutputMode (int cStep)
double giveDeltaT ()
 Returns time step size from the time step controlelr.
void setDeltaT (double dT)
 Returns time step size through the time step controlelr.
void setProblemMode (problemMode pmode)
void setParallelMode (bool newParallelFlag)
problemMode giveProblemMode () const
 Returns domain mode.
void setProblemScale (problemScale pscale)
problemScale giveProblemScale () const
 Returns scale in multiscale simulation.
virtual void setRenumberFlag ()
 Sets the renumber flag to true.
virtual void resetRenumberFlag ()
 Sets the renumber flag to false.
double giveSolutionStepTime ()
void giveAnalysisTime (int &rhrs, int &rmin, int &rsec, int &uhrs, int &umin, int &usec)
void terminateAnalysis ()
virtual void solveYourself ()
virtual void restartYourself (TimeStep *tS)
virtual void terminate (TimeStep *tStep)
virtual void doStepOutput (TimeStep *tStep)
void saveStepContext (TimeStep *tStep, ContextMode mode)
virtual void initializeYourself (TimeStep *tStep)
virtual int initializeAdaptive (int tStepNumber)
virtual int giveNumberOfDomainEquations (int di, const UnknownNumberingScheme &num)
virtual FieldPtr giveField (InternalStateType key, TimeStep *)
EngngModelgiveMasterEngngModel ()
 Returns the master engnmodel.
virtual double giveLoadLevel ()
 Returns the current load level.
virtual double giveEigenValue (int eigNum)
 Only relevant for eigen value analysis. Otherwise returns zero.
virtual void setActiveVector (int i)
 Only relevant for eigen value analysis. Otherwise does noting.
int updateSharedDofManagers (FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
int exchangeRemoteElementData (int ExchangeTag)
virtual int giveCurrentNumberOfIterations ()
MPI_Comm giveParallelComm ()
 Returns the communication object of reciever.
int packRemoteElementData (ProcessCommunicator &processComm)
int unpackRemoteElementData (ProcessCommunicator &processComm)
int packDofManagers (ArrayWithNumbering *src, ProcessCommunicator &processComm)
int unpackDofManagers (ArrayWithNumbering *dest, ProcessCommunicator &processComm)
ProblemCommunicatorgiveProblemCommunicator (EngngModelCommType t)
void initializeCommMaps (bool forceInit=false)
virtual int instanciateYourself (DataReader &dr, InputRecord &ir, const char *outFileName, const char *desc)
void Instanciate_init ()
int instanciateDomains (DataReader &dr)
 Instanciate problem domains by calling their instanciateYourself() service.
int instanciateMetaSteps (DataReader &dr)
 Instanciate problem meta steps by calling their instanciateYourself() service.
virtual int instanciateDefaultMetaStep (InputRecord &ir)
 Instanciate default metastep, if nmsteps is zero.
virtual void updateAttributes (MetaStep *mStep)
void initMetaStepAttributes (MetaStep *mStep)
MetaStepgiveCurrentMetaStep ()
 Returns current meta step.
virtual TimeStepgiveCurrentStep (bool force=false)
virtual void adaptTimeStep (double nIter)
virtual TimeStepgivePreviousStep (bool force=false)
virtual void preInitializeNextStep ()
 Does a pre-initialization of the next time step (implement if necessarry).
virtual int giveNumberOfFirstStep (bool force=false)
int giveNumberOfMetaSteps ()
 Return number of meta steps.
MetaStepgiveMetaStep (int i)
 Returns the i-th meta step.
int giveNumberOfSteps (bool force=false)
virtual double giveEndOfTimeOfInterest ()
 Returns end of time interest (time corresponding to end of time integration).
int giveNumberOfTimeStepWhenIcApply ()
 Returns the time step number, when initial conditions should apply.
ExportModuleManagergiveExportModuleManager ()
 Returns receiver's export module manager.
EngngModelTimergiveTimer ()
 Returns reference to receiver timer (EngngModelTimer).
virtual double giveInitialTime ()
 return time at the begining of analysis
virtual double giveFinalTime ()
virtual int giveNewEquationNumber (int domain, DofIDItem)
virtual int giveNewPrescribedEquationNumber (int domain, DofIDItem)
std::string giveContextFileName (int tStepNumber, int stepVersion) const
std::string giveDomainFileName (int domainNum, int domainSerNum) const
virtual void initForNewIteration (Domain *d, TimeStep *tStep, int iterationNumber, const FloatArray &solution)
virtual void initStepIncrements ()
virtual int forceEquationNumbering (int i)
virtual void updateDofUnknownsDictionary (DofManager *, TimeStep *)
virtual ParallelContextgiveParallelContext (int n)
virtual void initParallelContexts ()
virtual void assemble (SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &s, Domain *domain)
virtual void assemble (SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s, Domain *domain)
void assembleVector (FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
void assembleVectorFromDofManagers (FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
void assembleVectorFromElements (FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
void assembleVectorFromBC (FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
void assembleExtrapolatedForces (FloatArray &answer, TimeStep *tStep, CharType type, Domain *domain)
void assemblePrescribedExtrapolatedForces (FloatArray &answer, TimeStep *tStep, CharType type, Domain *domain)
virtual int checkProblemConsistency ()
virtual void init ()
virtual void postInitialize ()
virtual void printOutputAt (FILE *file, TimeStep *tStep, const IntArray &nodeSets, const IntArray &elementSets)
void outputNodes (FILE *file, Domain &domain, TimeStep *tStep, int setNum)
void outputElements (FILE *file, Domain &domain, TimeStep *tStep, int setNum)
void printYourself ()
 Prints state of receiver. Useful for debugging.
virtual void printDofOutputAt (FILE *stream, Dof *iDof, TimeStep *tStep)
virtual int useNonlocalStiffnessOption ()
 Returns nonzero if nonlocal stiffness option activated.
bool isParallel () const
 Returns true if receiver in parallel mode.
int giveRank () const
 Returns domain rank in a group of collaborating processes (0..groupSize-1).
int giveNumberOfProcesses () const
 Returns the number of collaborating processes.
EngngModelContextgiveContext ()
 Context requesting service.
virtual int giveNumberOfSlaveProblems ()
 Returns number of slave problems.
virtual EngngModelgiveSlaveProblem (int i)
 Returns i-th slave problem.
virtual bool giveEquationScalingFlag ()
 Returns the Equation scaling flag, which is used to indicate that governing equation(s) are scaled, or non-dimensionalized.
virtual double giveVariableScale (VarScaleType varId)
 Returns the scale factor for given variable type.
virtual int estimateMaxPackSize (IntArray &commMap, DataStream &buff, int packUnpackType)
virtual void balanceLoad (TimeStep *tStep)
virtual LoadBalancergiveLoadBalancer ()
virtual LoadBalancerMonitorgiveLoadBalancerMonitor ()
void initParallel ()
 Request domain rank and problem size.
EngngModelgiveEngngModel ()
 Returns reference to itself -> required by communicator.h.
virtual bool isElementActivated (int elemNum)
virtual bool isElementActivated (Element *e)
TimeStepControllergiveTimeStepController ()
 Returns the time step controller.
virtual void drawYourself (oofegGraphicContext &gc)
virtual void drawElements (oofegGraphicContext &gc)
virtual void drawNodes (oofegGraphicContext &gc)
virtual void showSparseMtrxStructure (int type, oofegGraphicContext &gc, TimeStep *tStep)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Protected Attributes

SparseMtrxType sparseMtrxType = SMT_Skyline
std ::unique_ptr< DofDistributedPrimaryField > field
std ::unique_ptr< SparseMtrxeffectiveMatrix
FloatArray solution
FloatArray internalForces
FloatArray eNorm
std ::unique_ptr< SparseNonLinearSystemNMnMethod
 Numerical method used to solve the problem.
double alpha = 0.5
int dtFunction = 0
FloatArray prescribedTimes
double initT = 0.
 Initial time from which the computation runs. Default is zero.
double deltaT = 1.
bool keepTangent = false
bool hasTangent = false
bool lumped = false
IntArray exportFields
Protected Attributes inherited from oofem::EngngModel
int ndomains
 Number of receiver domains.
std ::vector< std ::unique_ptr< Domain > > domainList
 List of problem domains.
int numberOfSteps
 Total number of time steps.
int numberOfEquations
 Total number of equation in current time step.
int numberOfPrescribedEquations
 Total number or prescribed equations in current time step.
IntArray domainNeqs
 Number of equations per domain.
IntArray domainPrescribedNeqs
 Number of prescribed equations per domain.
bool renumberFlag
 Renumbering flag (renumbers equations after each step, necessary if Dirichlet BCs change).
bool profileOpt
 Profile optimized numbering flag (using Sloan's algorithm).
int equationNumberingCompleted
 Equation numbering completed flag.
int nMetaSteps
 Number of meta steps.
std ::vector< MetaStepmetaStepList
 List of problem metasteps.
std ::unique_ptr< TimeStepstepWhenIcApply
 Solution step when IC (initial conditions) apply.
std ::unique_ptr< TimeStepcurrentStep
 Current time step.
std ::unique_ptr< TimeSteppreviousStep
 Previous time step.
int number
 Receivers id.
std::string dataOutputFileName
 Path to output stream.
std::string coreOutputFileName
 String with core output file name.
FILE * outputStream
 Output stream.
std::string referenceFileName
 String with reference file name.
ContextOutputMode contextOutputMode
 Domain context output mode.
int contextOutputStep
ExportModuleManager exportModuleManager
 Export module manager.
InitModuleManager initModuleManager
 Initialization module manager.
MonitorManager monitorManager
 Monitor manager.
problemMode pMode
 Domain mode.
problemScale pScale
 Multiscale mode.
time_t startTime
 Solution start time.
EngngModelmaster
 Master e-model; if defined receiver is in maintained (slave) mode.
EngngModelContextcontext
 Context.
EngngModelTimer timer
 E-model timer.
int parallelFlag
 Flag indicating that the receiver runs in parallel.
enum fMode nonLinFormulation
 Type of non linear formulation (total or updated formulation).
std::unique_ptr< ErrorEstimatordefaultErrEstimator
 Error estimator. Useful for adaptivity, or simply printing errors output.
std::unique_ptr< TimeStepControllertimeStepController
 Time Step controller is responsible for collecting data from analysis, elements, and materials, and select the appropriate timestep size for the next step, or reduce the step in case of convergence problems.
int rank
 Domain rank in a group of collaborating processes (0..groupSize-1).
int numProcs
 Total number of collaborating processes.
int nonlocalExt
 Flag indicating if nonlocal extension active, which will cause data to be sent between shared elements before computing the internal forces.
char processor_name [PROCESSOR_NAME_LENGTH]
 Processor name.
MPI_Comm comm
 Communication object for this engineering model.
std::unique_ptr< LoadBalancerlb
 Load Balancer.
std::unique_ptr< LoadBalancerMonitorlbm
bool loadBalancingFlag
 If set to true, load balancing is active.
bool force_load_rebalance_in_first_step
 Debug flag forcing load balancing after first step.
CommunicatorBuffcommBuff
 Common Communicator buffer.
ProblemCommunicatorcommunicator
 Communicator.
ProblemCommunicatornonlocCommunicator
 NonLocal Communicator. Necessary when nonlocal constitutive models are used.
std ::vector< ParallelContextparallelContextList
 List where parallel contexts are stored.
bool suppressOutput
 Flag for suppressing output to file.
std::string simulationDescription

Additional Inherited Members

Public Types inherited from oofem::EngngModel
enum  EngngModel_UpdateMode { EngngModel_Unknown_Mode , EngngModel_SUMM_Mode , EngngModel_SET_Mode }
enum  EngngModelCommType { PC_default , PC_nonlocal }
enum  InitialGuess { IG_None = 0 , IG_Tangent = 1 }
Protected Types inherited from oofem::EngngModel
enum  {
  InternalForcesExchangeTag , MassExchangeTag , LoadExchangeTag , ReactionExchangeTag ,
  RemoteElementExchangeTag
}
 Message tags. More...
virtual void packMigratingData (TimeStep *tStep)
virtual void unpackMigratingData (TimeStep *tStep)

Detailed Description

Solves general nonlinear transient transport problems.

Author
Mikael Öhman

Definition at line 66 of file transienttransportproblem.h.

Constructor & Destructor Documentation

◆ TransientTransportProblem()

oofem::TransientTransportProblem::TransientTransportProblem ( int i,
EngngModel * master = nullptr )

Member Function Documentation

◆ applyIC()

◆ checkConsistency()

int oofem::TransientTransportProblem::checkConsistency ( )
overridevirtual

Allows programmer to test some receiver's internal data, before computation begins.

Returns
Nonzero if receiver check is o.k.

Reimplemented from oofem::EngngModel.

Definition at line 509 of file transienttransportproblem.C.

References oofem::EngngModel::giveDomain(), and OOFEM_WARNING.

◆ forceEquationNumbering()

int oofem::TransientTransportProblem::forceEquationNumbering ( )
overridevirtual

Forces equation renumbering on all domains associated to engng model. All equation numbers in all domains for all dofManagers are invalidated, and new equation numbers are generated starting from 1 on each domain. It will update numberOfEquations variable accordingly. Should be used at startup to force equation numbering and therefore sets numberOfEquations. Must be used if model supports changes of static system to assign new valid equation numbers to dofManagers.

Reimplemented from oofem::EngngModel.

Definition at line 384 of file transienttransportproblem.C.

References effectiveMatrix.

◆ giveClassName()

const char * oofem::TransientTransportProblem::giveClassName ( ) const
inlineoverridevirtual

Returns class name of the receiver.

Implements oofem::EngngModel.

Definition at line 132 of file transienttransportproblem.h.

◆ giveDeltaT()

double oofem::TransientTransportProblem::giveDeltaT ( int n)

◆ giveDiscreteTime()

double oofem::TransientTransportProblem::giveDiscreteTime ( int iStep)

Definition at line 143 of file transienttransportproblem.C.

References initT, OOFEM_ERROR, and prescribedTimes.

Referenced by giveDeltaT().

◆ giveDtFunction()

Function * oofem::TransientTransportProblem::giveDtFunction ( )

◆ giveField()

FieldPtr oofem::TransientTransportProblem::giveField ( FieldType key,
TimeStep *  )
overridevirtual

Returns the smart pointer to requested field, Null otherwise. The return value uses shared_ptr, as some registered fields may be owned (and maintained) by emodel, while some may be created on demand and thus reliable reference counting mechanism is essential.

Reimplemented from oofem::EngngModel.

Definition at line 531 of file transienttransportproblem.C.

References field, oofem::EngngModel::giveContext(), oofem::EngngModel::giveCurrentStep(), oofem::FieldManager::giveField(), oofem::EngngModelContext::giveFieldManager(), and OOFEM_ERROR.

◆ giveFormulation()

fMode oofem::TransientTransportProblem::giveFormulation ( )
inlineoverridevirtual

Indicates type of non linear computation (total or updated formulation). This is used for example on Nodal level to update coordinates if updated formulation is done, or on element level, when non linear contributions are computed.

Reimplemented from oofem::EngngModel.

Definition at line 133 of file transienttransportproblem.h.

References oofem::TL.

◆ giveInputRecordName()

const char * oofem::TransientTransportProblem::giveInputRecordName ( ) const
inline

Definition at line 131 of file transienttransportproblem.h.

References _IFT_TransientTransportProblem_Name.

◆ giveNextStep()

TimeStep * oofem::TransientTransportProblem::giveNextStep ( )
overridevirtual

Returns next time step (next to current step) of receiver.

Reimplemented from oofem::EngngModel.

Definition at line 155 of file transienttransportproblem.C.

References alpha, oofem::EngngModel::currentStep, giveDeltaT(), giveSolutionStepWhenIcApply(), and oofem::EngngModel::previousStep.

◆ giveNumericalMethod()

NumericalMethod * oofem::TransientTransportProblem::giveNumericalMethod ( MetaStep * mStep)
overridevirtual

Returns reference to receiver's numerical method.

Reimplemented from oofem::EngngModel.

Definition at line 64 of file transienttransportproblem.C.

References oofem::EngngModel::giveDomain(), and nMethod.

Referenced by solveYourselfAt(), and updateDomainLinks().

◆ giveSolutionStepWhenIcApply()

TimeStep * oofem::TransientTransportProblem::giveSolutionStepWhenIcApply ( bool force = false)
overridevirtual

Returns the solution step when Initial Conditions (IC) apply.

Parameters
forcewhen set to true then receiver reply is returned instead of master (default)

Reimplemented from oofem::EngngModel.

Definition at line 170 of file transienttransportproblem.C.

References alpha, giveDeltaT(), oofem::EngngModel::giveNumberOfTimeStepWhenIcApply(), initT, oofem::EngngModel::master, and oofem::EngngModel::stepWhenIcApply.

Referenced by applyIC(), and giveNextStep().

◆ giveUnknownComponent()

double oofem::TransientTransportProblem::giveUnknownComponent ( ValueModeType ,
TimeStep * ,
Domain * ,
Dof *  )
overridevirtual

Returns requested unknown. Unknown at give time step is characterized by its type and mode and by its equation number. This function is used by Dofs, when they are requested for their associated unknowns.

See also
Dof::giveUnknown

Reimplemented from oofem::EngngModel.

Definition at line 124 of file transienttransportproblem.C.

References field.

◆ giveUnknownDictHashIndx()

int oofem::TransientTransportProblem::giveUnknownDictHashIndx ( ValueModeType mode,
TimeStep * tStep )
overridevirtual

This method is responsible for computing unique dictionary id (ie hash value) from given valueModeType and time step. This function is used by particular dofs to access unknown identified by given parameters from its dictionary using computed index. Usually the hash algorithm should produce index that depend on time step relatively to actual one to avoid storage of complete history.

Reimplemented from oofem::EngngModel.

Definition at line 496 of file transienttransportproblem.C.

References oofem::TimeStep::giveNumber().

◆ initializeFrom()

void oofem::TransientTransportProblem::initializeFrom ( InputRecord & ir)
overridevirtual

◆ newDofHandling()

bool oofem::TransientTransportProblem::newDofHandling ( )
inlineoverridevirtual

Temporary method for allowing code to seamlessly convert from the old to new way of handling DOF values. (the new way expects the field to store all values, regardless of if they are computed, from BC, or IC.) This is used by MasterDof

Todo
When all models have converted to using a field, this should be removed.

Reimplemented from oofem::EngngModel.

Definition at line 97 of file transienttransportproblem.h.

◆ printOutputAt()

◆ requiresEquationRenumbering()

bool oofem::TransientTransportProblem::requiresEquationRenumbering ( TimeStep * tStep)
overridevirtual

Returns true if equation renumbering is required for given solution step. This may of course change the number of equation and in general there is no guarantee that for a certain dof the same equation will be assigned. So the use of DOF unknowns dictionaries is generally recommended.

Todo
This method should be set as the default behavior instead of relying on a user specified flag. Then this function should be removed.

Reimplemented from oofem::EngngModel.

Definition at line 361 of file transienttransportproblem.C.

References oofem::Domain::giveBcs(), oofem::EngngModel::giveDomain(), oofem::GeneralBoundaryCondition::giveNumberOfInternalDofManagers(), oofem::TimeStep::givePreviousStep(), oofem::TimeStep::isTheFirstStep(), and oofem::ActiveBoundaryCondition::requiresActiveDofs().

◆ requiresUnknownsDictionaryUpdate()

int oofem::TransientTransportProblem::requiresUnknownsDictionaryUpdate ( )
overridevirtual

Indicates if EngngModel requires Dofs dictionaries to be updated. If EngngModel does not support changes of static system, the dof forwards the requests for its unknowns to EngngModel, where unknowns are naturally kept. This is possible, because dof equation number is same during whole solution. But when changes of static system are allowed, several problem arise. For example by solving simple incremental static with allowed static changes, the incremental displacement vector of structure can not be added to total displacement vector of structure, because equation numbers may have changed, and one can not simply add these vector to obtain new total displacement vector, because incompatible displacement will be added. To solve this problem, unknown dictionary at dof level has been assumed. Dof then keeps its unknowns in its own private dictionary. After computing increment of solution, engngModel updates for each dof its unknowns in its dictionary (using updateUnknownsDictionary function). For aforementioned example engngModel updates incremental values but also total value by asking dof for previous total value (dof will use its dictionary, does not asks back EngngModel) adds corresponding increment and updates total value in dictionary.

Reimplemented from oofem::EngngModel.

Definition at line 503 of file transienttransportproblem.C.

◆ restoreContext()

void oofem::TransientTransportProblem::restoreContext ( DataStream & stream,
ContextMode mode )
overridevirtual

Restores the state of model from output stream. Restores not only the receiver state, but also same function is invoked for all DofManagers and Elements in associated domain. Note that by restoring element context also contexts of all associated integration points (and material statuses) are restored. Each context is associated with unique time step. Only one context per time step is allowed. Restore context function will restore such context, which is related (through its step number) to time step number and version given in obj parameter. Restoring context will change current time step in order to correspond to newly restored context.

Parameters
streamContext file.
modeDetermines amount of info in stream.
Exceptions
ContextIOERRexception if error encountered.

Reimplemented from oofem::EngngModel.

Definition at line 488 of file transienttransportproblem.C.

References field.

◆ saveContext()

void oofem::TransientTransportProblem::saveContext ( DataStream & stream,
ContextMode mode )
overridevirtual

Stores the state of model to output stream. Stores not only the receiver state, but also same function is invoked for all DofManagers and Elements in associated domain. Note that by storing element context also contexts of all associated integration points (and material statuses) are stored.

Parameters
streamContext stream.
modeDetermines amount of info in stream.
Exceptions
ContextIOERRIf error encountered.

Reimplemented from oofem::EngngModel.

Definition at line 480 of file transienttransportproblem.C.

References field.

◆ solveYourselfAt()

void oofem::TransientTransportProblem::solveYourselfAt ( TimeStep * tStep)
overridevirtual

Solves problem for given time step. Should assemble characteristic matrices and vectors if necessary and solve problem using appropriate numerical method. After finishing solution, this->updateYourself function for updating solution state and then this->terminate function (for updating nodal and element values) should be called.

Todo
Hack to ensure that internal RHS is evaluated before the tangent. This is not ideal, causing this to be evaluated twice for a linearproblem. We have to find a better way to handle this.

Reimplemented from oofem::EngngModel.

Definition at line 187 of file transienttransportproblem.C.

References applyIC(), oofem::EngngModel::assembleVector(), oofem::classFactory, effectiveMatrix, eNorm, field, oofem::EngngModel::giveCurrentMetaStep(), oofem::EngngModel::giveDomain(), oofem::TimeStep::giveNumber(), oofem::EngngModel::giveNumberOfDomainEquations(), giveNumericalMethod(), oofem::TimeStep::giveTargetTime(), internalForces, oofem::TimeStep::isTheFirstStep(), oofem::EngngModel::LoadExchangeTag, nMethod, OOFEM_LOG_INFO, solution, sparseMtrxType, updateInternalRHS(), oofem::EngngModel::updateSharedDofManagers(), and oofem::FloatArray::zero().

◆ updateComponent()

void oofem::TransientTransportProblem::updateComponent ( TimeStep * tStep,
NumericalCmpn cmpn,
Domain * d )
overridevirtual
Todo
NRSolver should report when the solution changes instead of doing it this way.
Todo
Need to reset the boundary conditions properly since some "update" is doing strange things such as applying the (wrong) boundary conditions. This call will be removed when that code can be removed.
Todo
Fix this, assembleVector shouldn't zero eNorm inside the functions. / Mikael

Reimplemented from oofem::EngngModel.

Definition at line 287 of file transienttransportproblem.C.

References alpha, oofem::assemble(), oofem::EngngModel::assembleVector(), oofem::FloatArray::beDifferenceOf(), effectiveMatrix, eNorm, field, oofem::TimeStep::givePreviousStep(), oofem::FloatArray::giveSize(), oofem::TimeStep::giveTimeIncrement(), hasTangent, internalForces, oofem::EngngModel::InternalForcesExchangeTag, oofem::InternalRhs, keepTangent, lumped, oofem::NonLinearLhs, OOFEM_ERROR, solution, oofem::FloatArray::times(), and oofem::EngngModel::updateSharedDofManagers().

◆ updateDomainLinks()

void oofem::TransientTransportProblem::updateDomainLinks ( )
overridevirtual

Updates domain links after the domains of receiver have changed. Used mainly after restoring context - the domains may change and this service is then used to update domain variables in all components belonging to receiver like error estimators, solvers, etc, having domains as attributes.

Reimplemented from oofem::EngngModel.

Definition at line 524 of file transienttransportproblem.C.

References oofem::EngngModel::giveCurrentMetaStep(), oofem::EngngModel::giveDomain(), and giveNumericalMethod().

◆ updateInternalRHS()

void oofem::TransientTransportProblem::updateInternalRHS ( FloatArray & answer,
TimeStep * tStep,
Domain * d,
FloatArray * eNorm )
overridevirtual

Updates the solution (guess) according to the new values. Callback for nonlinear solvers (e.g. Newton-Raphson).

Parameters
solutionVectorNew solution.
tStepTime when component is updated.
dDomain.
eNormOptional per-element norm (for normalization).
Todo
Fix this, assembleVector shouldn't zero eNorm inside the functions. / Mikael

Reimplemented from oofem::EngngModel.

Definition at line 248 of file transienttransportproblem.C.

References oofem::EngngModel::assembleVector(), oofem::FloatArray::beDifferenceOf(), eNorm, field, oofem::TimeStep::givePreviousStep(), oofem::FloatArray::giveSize(), oofem::TimeStep::giveTimeIncrement(), oofem::EngngModel::InternalForcesExchangeTag, lumped, solution, oofem::FloatArray::times(), oofem::EngngModel::updateSharedDofManagers(), and oofem::FloatArray::zero().

Referenced by solveYourselfAt().

◆ updateMatrix()

void oofem::TransientTransportProblem::updateMatrix ( SparseMtrx & mat,
TimeStep * tStep,
Domain * d )
overridevirtual

Updates the solution (guess) according to the new values. Callback for nonlinear solvers (e.g. Newton-Raphson).

Note
For performance, the matrix should keep it's non-zero structure between calls, so the caller should make sure not to clear the matrix object before called.
Parameters
solutionVectorNew solution.
tStepTime when component is updated.
dDomain.

Reimplemented from oofem::EngngModel.

Definition at line 274 of file transienttransportproblem.C.

References alpha, oofem::assemble(), oofem::TimeStep::giveTimeIncrement(), hasTangent, keepTangent, lumped, and oofem::SparseMtrx::zero().

◆ updateSolution()

void oofem::TransientTransportProblem::updateSolution ( FloatArray & solutionVector,
TimeStep * tStep,
Domain * d )
overridevirtual

Updates the solution (guess) according to the new values. Callback for nonlinear solvers (e.g. Newton-Raphson), and are called before new internal forces are computed.

Parameters
solutionVectorNew solution.
tStepTime when component is updated.
dDomain.
Todo
NRSolver should report when the solution changes instead of doing it this way.
Todo
Need to reset the boundary conditions properly since some "update" is doing strange things such as applying the (wrong) boundary conditions. This call will be removed when that code can be removed.

Reimplemented from oofem::EngngModel.

Definition at line 237 of file transienttransportproblem.C.

References field.

◆ updateYourself()

void oofem::TransientTransportProblem::updateYourself ( TimeStep * tStep)
overridevirtual

Updates internal state after finishing time step. (for example total values may be updated according to previously solved increments). Then element values are also updated (together with related integration points and material statuses).

Reimplemented from oofem::EngngModel.

Definition at line 474 of file transienttransportproblem.C.

Member Data Documentation

◆ alpha

double oofem::TransientTransportProblem::alpha = 0.5
protected

◆ deltaT

double oofem::TransientTransportProblem::deltaT = 1.
protected

Definition at line 86 of file transienttransportproblem.h.

Referenced by giveDeltaT(), and initializeFrom().

◆ dtFunction

int oofem::TransientTransportProblem::dtFunction = 0
protected

Definition at line 82 of file transienttransportproblem.h.

Referenced by giveDeltaT(), and initializeFrom().

◆ effectiveMatrix

std :: unique_ptr< SparseMtrx > oofem::TransientTransportProblem::effectiveMatrix
protected

◆ eNorm

FloatArray oofem::TransientTransportProblem::eNorm
protected

◆ exportFields

IntArray oofem::TransientTransportProblem::exportFields
protected

Definition at line 90 of file transienttransportproblem.h.

Referenced by initializeFrom().

◆ field

std :: unique_ptr< DofDistributedPrimaryField > oofem::TransientTransportProblem::field
protected

◆ hasTangent

bool oofem::TransientTransportProblem::hasTangent = false
protected

Definition at line 87 of file transienttransportproblem.h.

Referenced by updateComponent(), and updateMatrix().

◆ initT

double oofem::TransientTransportProblem::initT = 0.
protected

Initial time from which the computation runs. Default is zero.

Definition at line 85 of file transienttransportproblem.h.

Referenced by giveDiscreteTime(), giveSolutionStepWhenIcApply(), and initializeFrom().

◆ internalForces

FloatArray oofem::TransientTransportProblem::internalForces
protected

Definition at line 75 of file transienttransportproblem.h.

Referenced by solveYourselfAt(), and updateComponent().

◆ keepTangent

bool oofem::TransientTransportProblem::keepTangent = false
protected

Definition at line 87 of file transienttransportproblem.h.

Referenced by initializeFrom(), updateComponent(), and updateMatrix().

◆ lumped

bool oofem::TransientTransportProblem::lumped = false
protected

◆ nMethod

std :: unique_ptr< SparseNonLinearSystemNM > oofem::TransientTransportProblem::nMethod
protected

Numerical method used to solve the problem.

Definition at line 79 of file transienttransportproblem.h.

Referenced by giveNumericalMethod(), and solveYourselfAt().

◆ prescribedTimes

FloatArray oofem::TransientTransportProblem::prescribedTimes
protected

Definition at line 83 of file transienttransportproblem.h.

Referenced by giveDeltaT(), giveDiscreteTime(), and initializeFrom().

◆ solution

FloatArray oofem::TransientTransportProblem::solution
protected

Definition at line 74 of file transienttransportproblem.h.

Referenced by solveYourselfAt(), updateComponent(), and updateInternalRHS().

◆ sparseMtrxType

SparseMtrxType oofem::TransientTransportProblem::sparseMtrxType = SMT_Skyline
protected

Definition at line 69 of file transienttransportproblem.h.

Referenced by initializeFrom(), and solveYourselfAt().


The documentation for this class was generated from the following files:

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011