49 #include "../../sm/EngineeringModels/diidynamic.h" 50 #include "../../sm/EngineeringModels/nlineardynamic.h" 99 emodel->initializeYourself(tStep);
102 if ( dynamicProblem ) {
106 if ( nonlinearDynamicProblem ) {
122 FloatArray currentInteractionParticlesVelocities;
123 FloatArray currentInteractionParticlesPressures;
124 FloatArray previousInteractionParticlesVelocities;
125 FloatArray previousInteractionParticlesPressures;
129 for (
int i = 1; i <= ndman; i++ ) {
130 if ( dynamic_cast< InteractionPFEMParticle * >( pfemDomain->
giveDofManager(i) ) ) {
141 double velocityDifference = 1.0;
142 double pressureDifference = 1.0;
146 previousInteractionParticlesPressures = currentInteractionParticlesPressures;
147 previousInteractionParticlesVelocities = currentInteractionParticlesVelocities;
150 emodel->solveYourselfAt(stepN);
158 currentInteractionParticlesVelocities.at(2 * ( i - 1 ) + 1) = velocities.
at(1);
159 currentInteractionParticlesVelocities.at(2 * ( i - 1 ) + 2) = velocities.
at(2);
162 pressureDifference = 0.0;
163 velocityDifference = 0.0;
164 for (
int i = 1; i <= currentInteractionParticlesPressures.
giveSize(); i++ ) {
165 pressureDifference += ( currentInteractionParticlesPressures.
at(i) - previousInteractionParticlesPressures.
at(i) ) * ( currentInteractionParticlesPressures.
at(i) - previousInteractionParticlesPressures.
at(i) );
166 velocityDifference += ( currentInteractionParticlesVelocities.at(2 * ( i - 1 ) + 1) - previousInteractionParticlesVelocities.
at(2 * ( i - 1 ) + 1) ) * ( currentInteractionParticlesVelocities.at(2 * ( i - 1 ) + 1) - previousInteractionParticlesVelocities.
at(2 * ( i - 1 ) + 1) );
167 velocityDifference += ( currentInteractionParticlesVelocities.at(2 * ( i - 1 ) + 2) - previousInteractionParticlesVelocities.
at(2 * ( i - 1 ) + 2) ) * ( currentInteractionParticlesVelocities.at(2 * ( i - 1 ) + 2) - previousInteractionParticlesVelocities.
at(2 * ( i - 1 ) + 2) );
169 pressureDifference = sqrt(pressureDifference);
170 velocityDifference = sqrt(velocityDifference);
173 pressureDifference /= previousInteractionParticlesPressures.
computeNorm();
174 velocityDifference /= previousInteractionParticlesVelocities.
computeNorm();
180 OOFEM_ERROR(
"Maximal fluid-structure interface iteration count exceded");
189 emodel->preInitializeNextStep();
195 FluidStructureProblem :: postInitializeCurrentStep()
197 for (
int i = 1; i <= nModels; i++ ) {
199 if ( dynamicProblem ) {
virtual ~FluidStructureProblem()
Destructor.
virtual EngngModel * giveSlaveProblem(int i)
Returns i-th slave problem.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
#define _IFT_FluidStructureProblem_maxiter
double & at(int i)
Coefficient access function.
#define _IFT_FluidStructureProblem_rtolp
This class represents PFEM method for solving incompressible Navier-Stokes equations.
This class implements nonlinear dynamic engineering problem.
double rtolv
Convergence tolerance.
int iterationNumber
Iteration counter.
double giveTargetTime()
Returns target time.
void incrementStateCounter()
Updates solution state counter.
REGISTER_EngngModel(ProblemSequence)
int & at(int i)
Coefficient access function.
#define OOFEM_LOG_RELEVANT(...)
double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
TimeDiscretizationType giveInitialTimeDiscretization()
bool isTheFirstStep()
Check if receiver is first step.
void giveCoupledVelocities(FloatArray &answer, TimeStep *stepN)
IntArray interactionParticles
#define _IFT_FluidStructureProblem_rtolv
int giveNumber()
Returns receiver's number.
int ndomains
Number of receiver domains.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
Implementation of general sequence (staggered) problem.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
FluidStructureProblem(int i, EngngModel *_master=NULL)
Constructor.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
virtual void preInitializeNextStep()
Does a pre-initialization of the next time step (implement if necessarry)
IRResultType
Type defining the return values of InputRecord reading operations.
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
double computeNorm() const
Computes the norm (or length) of the vector.
This class implements Direct Implicit Integration of Dynamic problem.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
This class represents a fluid particle attached to a node on the structural part of the interface...
TimeDiscretizationType giveInitialTimeDiscretization()
void setTimeDiscretization(TimeDiscretizationType td)
Sets time discretization.
int maxiter
Max number of iterations.
Abstract base class representing the "problem" under consideration.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void setRenumberFlag()
Sets the renumber flag to true.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
std::vector< std::unique_ptr< EngngModel > > emodelList
List of engineering models to solve sequentially.
Class representing solution step.
virtual void initializeYourself(TimeStep *tStep)
Provides the opportunity to initialize state variables stored in element integration points according...
void resize(int s)
Resizes receiver towards requested size.