62 static_cast< CBSElement &
>( element ).computeNumberOfNodalPrescribedTractionPressureContributions(vec, tStep);
68 static_cast< CBSElement &
>( element ).computeConvectionTermsI(vec, tStep);
69 static_cast< CBSElement &
>( element ).computeDiffusionTermsI(vec_p, tStep);
75 static_cast< CBSElement &
>( element ).computePrescribedTermsI(vec, tStep);
81 static_cast< CBSElement &
>( element ).computePrescribedTractionPressure(vec, tStep);
87 static_cast< CBSElement &
>( element ).computeDensityRhsVelocityTerms(vec, tStep);
88 static_cast< CBSElement &
>( element ).computeDensityRhsPressureTerms(vec_p, tStep);
94 static_cast< CBSElement &
>( element ).computeCorrectionRhs(vec, tStep);
100 static_cast< CBSElement &
>( element ).computePressureLhs(answer, tStep);
111 PressureField ( this, 1, FT_Pressure, 1 ),
112 VelocityField ( this, 1, FT_Velocity, 1 ),
113 vnum ( false ), vnumPrescribed ( true ), pnum ( false ), pnumPrescribed ( true )
231 OOFEM_ERROR(
"prescribed traction pressure requested for dof with no BC");
241 if (
master && (!force)) {
267 dt =
min( dt, static_cast< CBSElement & >( *elem ).computeCriticalTimeStep(
previousStep.get()) );
307 lhs->buildInternalStructure(
this, 1,
pnum);
319 mss->buildInternalStructure(
this, 1,
vnum);
360 this->
applyIC(stepWhenIcApply);
370 velocityVector->
resize(momneq);
371 pressureVector->
resize(presneq);
385 for (
int i = 1; i <= momneq; i++ ) {
396 for (
int i = 1; i <= presneq_prescribed; i++ ) {
401 * velocityVector = * prevVelocityVector;
412 pressureVector->
add(* prevPressureVector);
425 velocityVector->
add(* prevVelocityVector);
427 for (
int i = 1; i <= momneq; i++ ) {
472 for (
auto &dman : domain->giveDofManagers() ) {
477 for (
auto &elem : domain->giveElements() ) {
478 elem->updateInternalState(tStep);
543 if ( !dynamic_cast< CBSElement * >( elem.get() ) ) {
544 OOFEM_WARNING(
"Element %d has no CBS base", elem->giveLabel());
554 for (
auto &bc: domain->
giveBcs() ) {
567 for (
auto &ic : domain->
giveIcs() ) {
569 ic->scale(VM_Total, 1. /
uscale);
597 if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
599 }
else if ( type == P_f ) {
621 velocityVector->
resize(mbneq);
622 velocityVector->
zero();
626 pressureVector->
resize(pdneq);
627 pressureVector->
zero();
633 if ( !iDof->isPrimaryDof() ) {
637 int jj = iDof->__giveEquationNumber();
640 if ( ( type == V_u ) || ( type == V_v ) || ( type == V_w ) ) {
641 velocityVector->
at(jj) = iDof->giveUnknown(VM_Total, stepWhenIcApply);
643 pressureVector->
at(jj) = iDof->giveUnknown(VM_Total, stepWhenIcApply);
661 if ( (
id == V_u ) || (
id == V_v ) || (
id == V_w ) ) {
663 }
else if (
id == P_f ) {
676 if ( (
id == V_u ) || (
id == V_v ) || (
id == V_w ) ) {
678 }
else if (
id == P_f ) {
727 domCount += domain->giveOutputManager()->testTimeStepOutput(tStep);
730 if ( domCount == 0 ) {
735 for (
auto &domain: this->domainList ) {
736 fprintf(file,
"\nOutput for domain %3d\n", domain->giveNumber() );
737 domain->giveOutputManager()->doDofManOutput(file, tStep);
738 domain->giveOutputManager()->doElementOutput(file, tStep);
EngngModelTimer timer
E-model timer.
virtual FloatArray * giveSolutionVector(TimeStep *tStep)
LinSystSolverType
The values of this type should be related not to specific solvers, but more to specific packages that...
FloatArray prescribedTractionPressure
#define _IFT_CBS_scaleflag
virtual int giveNumberOfDomainEquations(int, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
std::unique_ptr< TimeStep > currentStep
Current time step.
VelocityEquationNumbering vnum
virtual void advanceSolution(TimeStep *tStep)
Brings up a new solution vector for given time step.
virtual int giveNewPrescribedEquationNumber(int domain, DofIDItem)
Increases number of prescribed equations of receiver's domain and returns newly created equation numb...
Implementation for assembling external forces vectors in standard monolithic FE-problems.
Abstract class representing subset of DOFs (identified by DofId mask) of primary field.
void applyIC(TimeStep *tStep)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
std::unique_ptr< MaterialInterface > materialInterface
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
Implementation for assembling external forces vectors in standard monolithic FE-problems.
virtual void printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *tStep)
DOF printing routine.
VelocityEquationNumbering vnumPrescribed
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
contextIOResultType storeYourself(DataStream &stream) const
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.
int max(int i, int j)
Returns bigger value form two given decimals.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
virtual int requiresUnknownsDictionaryUpdate()
Indicates if EngngModel requires Dofs dictionaries to be updated.
PrimaryField VelocityField
Velocity field.
VarScaleType
Type determining the scale corresponding to particular variable.
Base class for fluid problems.
This base class is an abstraction for numerical algorithm.
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.
PressureEquationNumbering pnumPrescribed
double dscale
Density scale.
void incrementStateCounter()
Updates solution state counter.
Abstract base class for all finite elements.
virtual int checkConsistency()
Allows programmer to test some receiver's internal data, before computation begins.
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
Implementation for assembling the consistent mass matrix.
virtual int __giveEquationNumber() const =0
Returns equation number of receiver, usually assigned by emodel.
virtual int giveNewEquationNumber(int domain, DofIDItem)
Increases number of equations of receiver's domain and returns newly created equation number...
double Re
Reynolds number.
FieldManager * giveFieldManager()
REGISTER_EngngModel(ProblemSequence)
Class implementing an array of integers.
virtual int __givePrescribedEquationNumber()=0
Returns prescribed equation number of receiver.
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
std::unique_ptr< SparseMtrx > lhs
double uscale
Velocity scale.
double giveTimeIncrement()
Returns solution step associated time increment.
bool isTheFirstStep()
Check if receiver is first step.
Implementation for assembling external forces vectors in standard monolithic FE-problems.
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 deltaAuxVelocity
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores receiver state to output stream.
virtual double giveVariableScale(VarScaleType varId)
Returns the scale factor for given variable type.
#define OOFEM_LOG_INFO(...)
virtual double giveUnknownComponent(ValueModeType type, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
FloatArray nodalPrescribedTractionPressureConnectivity
#define _IFT_EngngModel_smtype
double deltaT
Time step and its minimal value.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the receiver state previously written in stream.
EngngModelContext * giveContext()
Context requesting service.
int ndomains
Number of receiver domains.
DofIDItem
Type representing particular dof type.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
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...
CBS(int i, EngngModel *_master=NULL)
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
contextIOResultType restoreYourself(DataStream &stream)
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...
int askNewEquationNumber()
std::vector< std::unique_ptr< InitialCondition > > & giveIcs()
EngngModel * master
Master e-model; if defined receiver is in maintained (slave) mode.
virtual int forceEquationNumbering()
Forces equation renumbering on all domains associated to engng model.
virtual void locationFromElement(IntArray &loc, Element &element, const UnknownNumberingScheme &s, IntArray *dofIds=nullptr) const
std::unique_ptr< SparseMtrx > mss
Sparse consistent mass.
TimeStep * givePreviousStep()
Returns pointer to previous solution step.
int askNewEquationNumber()
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
double giveTractionPressure(Dof *dof)
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
Abstract base class representing Lagrangian-Eulerian (moving) material interfaces.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
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.
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
Callback class for assembling CBS pressure matrices.
#define _IFT_CBS_mindeltat
virtual int checkConsistency()
Allows programmer to test some receiver's internal data, before computation begins.
PressureEquationNumbering pnum
void updateInternalState(TimeStep *tStep)
Updates nodal values (calls also this->updateDofUnknownsDictionary for updating dofs unknowns diction...
Implementation of matrix containing floating point numbers.
virtual NumericalMethod * giveNumericalMethod(MetaStep *mStep)
Returns reference to receiver's numerical method.
#define _IFT_EngngModel_lstype
IRResultType
Type defining the return values of InputRecord reading operations.
virtual void updateInternalState(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
virtual int giveRequiredNumberOfDomainEquation() const
Returns required number of domain equation.
std::unique_ptr< SparseLinearSystemNM > nMethod
Numerical method used to solve the problem.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
double lscale
Length scale.
Implementation for assembling lumped mass matrix (diagonal components) in vector form.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
virtual void updateDofUnknownsDictionary(DofManager *, TimeStep *)
Updates necessary values in Dofs unknown dictionaries.
double theta1
Integration constants.
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
LinSystSolverType solverType
void zero()
Zeroes all coefficients of receiver.
Class implementing single timer, providing wall clock and user time capabilities. ...
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to output domain stream, for given time step.
This abstract class represent a general base element class for fluid dynamic problems solved using CB...
void times(double s)
Multiplies receiver with scalar.
Implementation for assembling external forces vectors in standard monolithic FE-problems.
ClassFactory & classFactory
Implementation for assembling external forces vectors in standard monolithic FE-problems.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
virtual TimeStep * giveSolutionStepWhenIcApply(bool force=false)
Returns the solution step when Initial Conditions (IC) apply.
int min(int i, int j)
Returns smaller value from two given decimals.
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 void setDomain(Domain *d)
virtual void vectorFromElement(FloatArray &vec, Element &element, TimeStep *tStep, ValueModeType mode) const
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
FloatArray mm
Lumped mass matrix.
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.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
double getUtime()
Returns total user time elapsed in seconds.
#define OOFEM_WARNING(...)
int consistentMassFlag
Consistent mass flag.
PrimaryField PressureField
Pressure field.
Class representing solution step.
virtual double giveUnknownValue(Dof *dof, ValueModeType mode, TimeStep *tStep)
void add(const FloatArray &src)
Adds array src to 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 double giveReynoldsNumber()
virtual void matrixFromElement(FloatMatrix &mat, Element &element, TimeStep *tStep) const
void resize(int s)
Resizes receiver towards requested size.
int equationNumberingCompleted
Equation numbering completed flag.
SparseMtrxType sparseMtrxType