52 #ifdef __CEMHYD_MODULE 86 static_cast< TransportElement *
>( &el )->computeIntSourceLHSMatrix(answer, tStep);
127 if ( result !=
IRRT_OK )
return result;
178 if (mode == VM_TotalIntrinsic) mode = VM_Total;
191 if (mode == VM_TotalIntrinsic) {
210 if (
master && (!force)) {
268 double totalTime = this->
initT;
269 double intrinsicTime;
275 counter =
currentStep->giveSolutionStateCounter() + 1;
339 OOFEM_LOG_INFO(
"Assembling conductivity and capacity matrices\n");
390 for (
int i = 1; i <= neq; i++ ) {
416 #ifdef __CEMHYD_MODULE 418 for (
int i = 1; i <= domain->giveNumberOfElements(); ++i ) {
428 for (
int i = 1; i <= domain->giveNumberOfMaterialModels(); i++ ) {
448 double val = dof->giveUnknown(mode, fromTime);
449 dof->updateUnknownsDictionary(toTime, mode, val);
467 for (
auto &elem : domain->giveElements() ) {
468 elem->updateInternalState(tStep);
520 if ( !dynamic_cast< TransportElement * >( elem.get() ) ) {
521 OOFEM_WARNING(
"Element %d has no TransportElement base", elem->giveLabel());
542 if ( mode == VM_Total ) {
544 }
else if ( mode == VM_RhsTotal ) {
566 for (
int i = 1; i <= nelem; i++ ) {
605 solutionVector =
UnknownsField->giveSolutionVector(stepWhenIcApply);
606 solutionVector->
resize(neq);
607 solutionVector->
zero();
614 if ( !dof->isPrimaryDof() ) {
618 int jj = dof->__giveEquationNumber();
620 val = dof->giveUnknown(VM_Total, stepWhenIcApply);
621 solutionVector->
at(jj) = val;
624 dof->updateUnknownsDictionary(stepWhenIcApply, VM_Total, val);
637 #ifdef __CEMHYD_MODULE 661 #endif //__CEMHYD_MODULE 684 for (
int ielem = 1; ielem <= nelem; ielem++ ) {
706 #ifdef __CEMHYD_MODULE 709 NonStationaryTransportProblem :: averageOverElements(
TimeStep *tStep)
718 for (
GaussPoint *gp: *elem->giveDefaultIntegrationRulePtr() ) {
719 elem->
giveIPValue(vecTemperature, gp, IST_Temperature, tStep);
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
LinSystSolverType
The values of this type should be related not to specific solvers, but more to specific packages that...
virtual void assembleAlgorithmicPartOfRhs(FloatArray &rhs, const UnknownNumberingScheme &s, TimeStep *tStep)
The representation of EngngModel default unknown numbering.
std::unique_ptr< SparseLinearSystemNM > linSolver
virtual int checkConsistency()
Allows programmer to test some receiver's internal data, before computation begins.
std::unique_ptr< TimeStep > currentStep
Current time step.
FloatArray discreteTimes
Specified times where the problem is solved.
#define _IFT_NonStationaryTransportProblem_alpha
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.
Implementation for assembling internal forces vectors in standard monolithic, nonlinear FE-problems...
#define _IFT_NonStationaryTransportProblem_changingproblemsize
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
virtual void computeBCVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes the RHS contribution to balance equation(s) due to boundary conditions.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
This class represents stationary transport problem.
Abstract class representing field of primary variables (those, which are unknown and are typically as...
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
std::vector< std::unique_ptr< Domain > > domainList
List of problem domains.
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.
long StateCounterType
StateCounterType type used to indicate solution state.
virtual void copyUnknownsInDictionary(ValueModeType mode, TimeStep *fromTime, TimeStep *toTime)
Copy unknowns in DOF's from previous to current position.
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
This base class is an abstraction for numerical algorithm.
std::unique_ptr< TimeStep > stepWhenIcApply
Solution step when IC (initial conditions) apply.
virtual void computeInternalSourceRhsVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes the contribution to balance equation(s) due to internal sources.
virtual void matrixFromElement(FloatMatrix &mat, Element &element, TimeStep *tStep) const
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
double giveTargetTime()
Returns target time.
void incrementStateCounter()
Updates solution state counter.
Callback class for assembling element external forces:
Abstract base class for all finite elements.
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
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.
NonStationaryTransportProblem(int i, EngngModel *_master)
Constructor.
REGISTER_EngngModel(ProblemSequence)
Class implementing an array of integers.
#define _IFT_NonStationaryTransportProblem_deltat
LinSystSolverType solverType
virtual void giveUnknowns(FloatArray &masterUnknowns, ValueModeType mode, TimeStep *tStep)
The key method of class Dof.
double giveDiscreteTime(int n)
Returns time for time step number n (array discreteTimes must be specified)
#define _IFT_NonStationaryTransportProblem_deltatfunction
#define OOFEM_LOG_RELEVANT(...)
Function * giveDtFunction()
Returns time function for time step increment.
void computeVectorOfPrescribed(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of prescribed unknowns.
double giveTimeIncrement()
Returns solution step associated time increment.
bool isTheFirstStep()
Check if receiver is first step.
Class representing field of primary variables, which are typically allocated on nodes.
#define VERBOSE_PRINT0(str, number)
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.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given 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
Element * giveElement(int n)
Service for accessing particular domain fe element.
int dtFunction
Associated time function for time step increment.
StateCounterType giveSolutionStateCounter()
Returns current solution state counter.
virtual int giveUnknownDictHashIndx(ValueModeType mode, TimeStep *tStep)
This method is responsible for computing unique dictionary id (ie hash value) from given valueModeTyp...
std::vector< std::unique_ptr< Material > > & giveMaterials()
#define _IFT_NonStationaryTransportProblem_initt
Callback class for assembling specific types of matrices.
int ndomains
Number of receiver domains.
virtual void averageTemperature()
Perform averaging on a master CemhydMatStatus.
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...
void times(double f)
Multiplies receiver by factor f.
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...
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.
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
StateCounterType internalVarUpdateStamp
Contains last time stamp of internal variable update.
virtual ~NonStationaryTransportProblem()
Destructor.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
double deltaT
Length of time step.
EngngModel * master
Master e-model; if defined receiver is in maintained (slave) mode.
virtual int giveNumberOfFirstStep(bool force=false)
Returns number of first time step used by receiver.
FloatArray bcRhs
Right hand side vector from boundary conditions.
virtual void giveElementDofIDMask(IntArray &answer) const
Returns element dof mask for node.
int lumpedCapacityStab
If set then stabilization using lumped capacity will be used.
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
Callback class for assembling mid point effective tangents.
Function * giveFunction(int n)
Service for accessing particular domain load time function.
virtual double giveUnknownComponent(ValueModeType, TimeStep *, Domain *, Dof *)
Returns requested unknown.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
virtual void updateInternalState(TimeStep *tStep)
Updates IP values on elements.
std::unique_ptr< PrimaryField > UnknownsField
This field stores solution vector. For fixed size of problem, the PrimaryField is used...
SparseMtrxType sparseMtrxType
#define _IFT_NonStationaryTransportProblem_lumpedcapa
#define _IFT_NonStationaryTransportProblem_prescribedtimes
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
virtual int checkConsistency()
Allows programmer to test some receiver's internal data, before computation begins.
Implementation of matrix containing floating point numbers.
Abstract base class representing a function with vector input and output.
virtual void matrixFromElement(FloatMatrix &mat, Element &element, TimeStep *tStep) const
#define _IFT_EngngModel_lstype
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.
virtual int initMaterial(Element *element)
Optional function to call specific procedures when initializing a material.
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
virtual int requiresUnknownsDictionaryUpdate()
Allows to change number of equations during solution.
void add(const FloatMatrix &a)
Adds matrix to the receiver.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
void zero()
Zeroes all coefficients of receiver.
Abstract base class for all constitutive models for transport problems.
virtual void assembleDirichletBcRhsVector(FloatArray &answer, TimeStep *tStep, ValueModeType mode, const UnknownNumberingScheme &s, Domain *d)
Assembles part of RHS due to Dirichlet boundary conditions.
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.
Element in active domain is only mirror of some remote element.
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
virtual void storeWeightTemperatureProductVolume(Element *element, TimeStep *tStep)
Store temperatures multiplied with volume around GPs - need before temperature averaging.
std::vector< std::unique_ptr< Element > > & giveElements()
double giveDeltaT(int n)
Returns the time step length for given step number n, initial step is number 0.
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 void setDomain(Domain *d)
MidpointLhsAssembler(bool lumped, double alpha)
virtual void clearWeightTemperatureProductVolume(Element *element)
Clear temperatures multiplied with volume around GPs - need before temperature averaging.
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.
bool containsOnlyZeroes() const
Returns nonzero if all coefficients of the receiver are 0, else returns zero.
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.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
void negated()
Switches the sign of every coefficient of receiver.
virtual Material * giveMaterial()
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
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.
Class representing integration point in finite element program.
#define OOFEM_WARNING(...)
double initT
Initial time from which the computation runs. Default is zero.
Class representing solution step.
void add(const FloatArray &src)
Adds array src to receiver.
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
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.