129 double val1 =
field->giveUnknownValue(dof, VM_Total, tStep);
131 if ( mode == VM_Total ) {
134 }
else if ( mode == VM_TotalIntrinsic) {
135 return this->
alpha * val1 + (1.-this->
alpha) * val0;
137 }
else if ( mode == VM_Velocity ) {
139 }
else if ( mode == VM_Incremental ) {
165 }
else if ( iStep == 0 ) {
191 if (
master && (!force)) {
217 field->advanceSolution(tStep);
223 for (
auto &dman : d->giveDofManagers() ) {
227 for (
auto &elem : d->giveElements() ) {
228 int ndman = elem->giveNumberOfInternalDofManagers();
229 for (
int i = 1; i <= ndman; i++ ) {
234 for (
auto &bc : d->giveBcs() ) {
235 int ndman = bc->giveNumberOfInternalDofManagers();
236 for (
int i = 1; i <= ndman; i++ ) {
242 field->applyBoundaryCondition(tStep);
254 externalForces.
zero();
266 int currentIterations;
298 this->
field->applyBoundaryCondition(tStep);
314 for (
int i = 0; i < vel.
giveSize(); ++i ) {
344 this->
field->applyDefaultInitialCondition();
366 for (
auto &gbc : d->
giveBcs() ) {
402 if ( ( iores =
field->saveContext(stream, mode) ) !=
CIO_OK ) {
419 if ( ( iores =
field->restoreContext(stream, mode) ) !=
CIO_OK ) {
444 for (
auto &elem : this->
giveDomain(1)->giveElements() ) {
445 if ( !dynamic_cast< TransportElement * >( elem.get() ) ) {
446 OOFEM_WARNING(
"Element %d has no TransportElement base", elem->giveLabel());
469 OOFEM_ERROR(
"Unable to return field representation for non-current time step");
471 if ( key == FT_Temperature ) {
474 }
else if ( key == FT_HumidityConcentration ) {
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
The representation of EngngModel default unknown numbering.
#define _IFT_TransientTransportProblem_dtFunction
Function that determines size of time step.
std::unique_ptr< TimeStep > currentStep
Current time step.
virtual double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
std::shared_ptr< Field > FieldPtr
Implementation for assembling internal forces vectors in standard monolithic, nonlinear FE-problems...
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
Abstract class representing subset of DOFs (identified by DofId mask) of primary field.
virtual bool requiresActiveDofs()
Checks to see if active boundary condition requires special DOFs.
FloatArray prescribedTimes
FieldType
Physical type of field.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
This class implements Newton-Raphson Method, derived from abstract NumericalMethod class for solving ...
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
#define _IFT_TransientTransportProblem_deltaT
Fixed timestep.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
std::unique_ptr< TimeStep > previousStep
Previous time step.
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
void clear()
Clears receiver (zero size).
This base class is an abstraction for numerical algorithm.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
virtual NumericalMethod * giveNumericalMethod(MetaStep *mStep)
Returns reference to receiver's numerical method.
std::unique_ptr< TimeStep > stepWhenIcApply
Solution step when IC (initial conditions) apply.
virtual void updateComponent(TimeStep *tStep, NumericalCmpn cmpn, Domain *d)
Updates components mapped to numerical method if necessary during solution process.
std::unique_ptr< PrimaryField > field
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
double giveTargetTime()
Returns target time.
virtual int checkConsistency()
Allows programmer to test some receiver's internal data, before computation begins.
FieldManager * giveFieldManager()
REGISTER_EngngModel(ProblemSequence)
virtual bool requiresEquationRenumbering(TimeStep *tStep)
Returns true if equation renumbering is required for given solution step.
virtual ~TransientTransportProblem()
Destructor.
int & at(int i)
Coefficient access function.
TransientTransportProblem(int i, EngngModel *_master)
Constructor.
virtual int giveNumberOfInternalDofManagers()
Gives the number of internal dof managers.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
double giveTimeIncrement()
Returns solution step associated time increment.
bool isTheFirstStep()
Check if receiver is first step.
#define _IFT_TransientTransportProblem_alpha
Defines the time discretization of the value: .
Class representing field of primary variables, which are typically allocated on nodes.
double giveDiscreteTime(int iStep)
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.
MetaStep * giveCurrentMetaStep()
Returns current meta step.
std::vector< std::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
FloatArray internalForces
Class implementing Dirichlet boundary condition on DOF (primary boundary condition).
int giveNumber()
Returns receiver's number.
#define OOFEM_LOG_INFO(...)
NumericalCmpn
Type representing numerical component.
#define _IFT_EngngModel_smtype
EngngModelContext * giveContext()
Context requesting service.
void clear()
Clears the array (zero size).
int ndomains
Number of receiver domains.
int updateSharedDofManagers(FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
Exchanges necessary remote DofManagers data.
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
The reference incremental load vector is defined as totalLoadVector assembled at given time...
Implementation for assembling external forces vectors in standard monolithic FE-problems.
virtual int giveUnknownDictHashIndx(ValueModeType mode, TimeStep *tStep)
This method is responsible for computing unique dictionary id (ie hash value) from given valueModeTyp...
This abstract class represent a general base element class for transport problems.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
virtual FieldPtr giveField(FieldType key, TimeStep *)
Returns the smart pointer to requested field, Null otherwise.
EngngModel * master
Master e-model; if defined receiver is in maintained (slave) mode.
std::unique_ptr< SparseMtrx > effectiveMatrix
Abstract base class for all active boundary conditions.
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
#define _IFT_TransientTransportProblem_exportFields
Fields to export for staggered problems.
Function * giveFunction(int n)
Service for accessing particular domain load time function.
SparseMtrxType sparseMtrxType
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
virtual int forceEquationNumbering()
Forces equation renumbering on all domains associated to engng model.
void registerField(FieldPtr eField, FieldType key)
Registers the given field (the receiver is not assumed to own given field).
Class representing vector of real numbers.
virtual int forceEquationNumbering()
Forces equation renumbering on all domains associated to engng model.
virtual int checkConsistency()
Allows programmer to test some receiver's internal data, before computation begins.
IRResultType
Type defining the return values of InputRecord reading operations.
Implementation for assembling lumped mass matrix (diagonal components) in vector form.
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
void zero()
Zeroes all coefficients of receiver.
Implementation for assembling the intertia forces vector (i.e.
void times(double s)
Multiplies receiver with scalar.
ClassFactory & classFactory
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
std::vector< std::unique_ptr< Element > > & giveElements()
Abstract base class representing the "problem" under consideration.
virtual void setDomain(Domain *d)
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
std::unique_ptr< SparseNonLinearSystemNM > nMethod
Numerical method used to solve the problem.
int giveSize() const
Returns the size of receiver.
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.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual int requiresUnknownsDictionaryUpdate()
Indicates if EngngModel requires Dofs dictionaries to be updated.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
#define _IFT_TransientTransportProblem_prescribedTimes
Discrete times for each time step.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
Callback class for assembling effective tangents composed of stiffness and mass matrix.
virtual void updateInternalState(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual double evaluateAtTime(double t)
Returns the value of the function at given time.
#define OOFEM_WARNING(...)
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...
Class representing solution step.
#define _IFT_TransientTransportProblem_lumped
Use of lumped "mass" matrix.
void add(const FloatArray &src)
Adds array src to receiver.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
#define _IFT_TransientTransportProblem_keepTangent
Fixes the tangent to be reused on each step.
void resize(int s)
Resizes receiver towards requested size.