66 if ( result !=
IRRT_OK )
return result;
104 double solutionErr, incrementErr;
120 OOFEM_LOG_INFO(
"Assembling conductivity and capacity matrices\n");
160 OOFEM_LOG_INFO(
"Time Iter ResidNorm IncrNorm\n__________________________________________________________\n");
206 solutionVector->add(solutionVectorIncrement);
209 incrementErr = solutionVectorIncrement.
computeNorm();
212 TauStep.incrementStateCounter();
219 if ( nite >=
nsmax ) {
222 }
while ( ( fabs(solutionErr) >
rtol ) || ( fabs(incrementErr) >
rtol ) );
231 if ( mode == VM_Incremental ) {
233 }
else if ( mode == VM_TotalIntrinsic ) {
251 if ( ( t >= previousStep->
giveTargetTime() ) && ( t <= currentStep->giveTargetTime() ) ) {
255 double rt =
UnknownsField->giveUnknownValue(dof, VM_Total, previousStep);
257 if ( mode == VM_Velocity ) {
258 return ( rtdt - rt ) /
currentStep->giveTimeIncrement();
259 }
else if ( mode == VM_TotalIntrinsic ) {
261 return this->
alpha * rtdt + ( 1. - this->
alpha ) * rt;
262 }
else if ( mode == VM_Total ) {
263 return psi * rtdt + ( 1. - psi ) * rt;
264 }
else if ( mode == VM_Incremental ) {
268 return ( rtdt - rt );
302 for (
auto &
node : domain->giveDofManagers() ) {
304 double val = dof->giveUnknown(VM_Total, tStep);
329 if ( mode == VM_Total ) {
348 for (
Dof *dof: *inode ) {
349 int eqNum = dof->__giveEquationNumber();
351 if ( dof->hasBc(tStep) ) {
352 val = dof->giveBcValue(VM_Total, tStep);
355 val = vect->
at(eqNum);
359 dof->updateUnknownsDictionary(tStep, VM_Total, val);
369 for (
auto &dman : domain->giveDofManagers() ) {
375 for (
auto &elem : domain->giveElements() ) {
376 elem->updateInternalState(tStep);
399 for (
int i = 1; i <= nelem; i++ ) {
423 if ( ( t >= previousStep->
giveTargetTime() ) && ( t <= currentStep->giveTargetTime() ) ) {
444 for (
int j = 1; j <= size; j++ ) {
446 for (
int k = 1; k <= size; k++ ) {
447 s += charMtrxCap.
at(j, k);
448 charMtrxCap.
at(j, k) = 0.0;
451 charMtrxCap.
at(j, j) = s;
virtual bool isActivated(TimeStep *tStep)
The representation of EngngModel default unknown numbering.
void createPreviousSolutionInDofUnknownsDictionary(TimeStep *tStep)
std::unique_ptr< SparseLinearSystemNM > linSolver
std::unique_ptr< TimeStep > currentStep
Current time step.
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 int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
void setIntrinsicTime(double newt)
Sets only intrinsic time.
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
std::vector< std::unique_ptr< Domain > > domainList
List of problem domains.
#define _IFT_NLTransientTransportProblem_manrmsteps
std::unique_ptr< TimeStep > previousStep
Previous time step.
void assembleAlgorithmicPartOfRhs(FloatArray &rhs, const UnknownNumberingScheme &s, TimeStep *tStep)
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
virtual void copyUnknownsInDictionary(ValueModeType mode, TimeStep *fromTime, TimeStep *toTime)
Copy unknowns in DOF's from previous to current position.
std::unique_ptr< TimeStep > stepWhenIcApply
Solution step when IC (initial conditions) apply.
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
double giveTargetTime()
Returns target time.
virtual double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
void incrementStateCounter()
Updates solution state counter.
Callback class for assembling element external forces:
Abstract base class for all finite elements.
Base class for dof managers.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
virtual int __giveEquationNumber() const =0
Returns equation number of receiver, usually assigned by emodel.
int giveNumberOfElements() const
Returns number of elements in domain.
virtual void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep)
Computes characteristic matrix of receiver of requested type in given time step.
REGISTER_EngngModel(ProblemSequence)
Class implementing an array of integers.
virtual void applyIC(TimeStep *tStep)
This function is normally called at the first time to project initial conditions to previous (0^th) s...
Callback class for assembling CBS pressure matrices.
virtual void giveUnknowns(FloatArray &masterUnknowns, ValueModeType mode, TimeStep *tStep)
The key method of class Dof.
#define OOFEM_LOG_RELEVANT(...)
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
double giveTimeIncrement()
Returns solution step associated time increment.
bool isTheFirstStep()
Check if receiver is first step.
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.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
MetaStep * giveCurrentMetaStep()
Returns current meta step.
bool changingProblemSize
Determines if there are change in the problem size (no application/removal of Dirichlet boundary cond...
#define OOFEM_LOG_INFO(...)
int giveNumber()
Returns receiver's number.
std::unique_ptr< SparseMtrx > conductivityMatrix
virtual ~NLTransientTransportProblem()
Destructor.
Element * giveElement(int n)
Service for accessing particular domain fe element.
StateCounterType giveSolutionStateCounter()
Returns current solution state counter.
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
Implementation for assembling external forces vectors in standard monolithic FE-problems.
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...
This abstract class represent a general base element class for transport problems.
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
This class represents linear nonstationary transport problem.
virtual int giveUnknownDictHashIndx(ValueModeType mode, TimeStep *tStep)
This method is responsible for computing unique dictionary id (ie hash value) from given valueModeTyp...
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
int lumpedCapacityStab
If set then stabilization using lumped capacity will be used.
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
double at(int i, int j) const
Coefficient access function.
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
Callback class for assembling mid point effective tangents.
NLTransientTransportProblem(int i, EngngModel *_master)
Constructor.
std::unique_ptr< PrimaryField > UnknownsField
This field stores solution vector. For fixed size of problem, the PrimaryField is used...
SparseMtrxType sparseMtrxType
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
Implementation of matrix containing floating point numbers.
virtual void updateDofUnknownsDictionary(DofManager *dman, TimeStep *tStep)
Updates necessary values in Dofs unknown dictionaries.
IRResultType
Type defining the return values of InputRecord reading operations.
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.
int giveMetaStepNumber()
Returns receiver's meta step number.
double computeNorm() const
Computes the norm (or length) of the vector.
#define _IFT_NLTransientTransportProblem_nsmax
virtual int requiresUnknownsDictionaryUpdate()
Allows to change number of equations during solution.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
void zero()
Zeroes all coefficients of receiver.
void times(double s)
Multiplies receiver with scalar.
ClassFactory & classFactory
Element in active domain is only mirror of some remote element.
virtual TimeStep * givePreviousStep(bool force=false)
Returns previous time step.
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. ...
Abstract base class representing the "problem" under consideration.
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
bool isIcApply()
Check if receiver is solution step when initial conditions should apply.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual NumericalMethod * giveNumericalMethod(MetaStep *mStep)
Returns reference to receiver's numerical method.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
void negated()
Switches the sign of every coefficient of receiver.
virtual void updateInternalState(TimeStep *tStep)
Updates IP values on elements.
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
int giveNumberOfRows() const
Returns number of rows of receiver.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
virtual void updateInternalState(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
#define _IFT_NLTransientTransportProblem_rtol
Class representing solution step.
void add(const FloatArray &src)
Adds array src to receiver.
const char * __ValueModeTypeToString(ValueModeType _value)
virtual void applyIC(TimeStep *tStep)
This function is normally called at the first time to project initial conditions to previous (0^th) s...
void resize(int s)
Resizes receiver towards requested size.