CG
Version 25
|
#include <DeformingBodyMotion.h>
Public Types | |
enum | DeformingBodyType { elasticFilament, elasticBody, userDefinedDeformingBody, unknownBody } |
enum | InitialStateOptionEnum { initialPosition, initialVelocity, initialAcceleration } |
Public Member Functions | |
DeformingBodyMotion (Parameters ¶ms, int numberOfTimeLevels=3, GenericGraphicsInterface *pGIDebug00=NULL, int debug00=0) | |
Constructor: Set up grids, but do not initialize the mapping in the composite grid. And don't instantiate the `physics object' yet. | |
~DeformingBodyMotion () | |
int | correct (real t1, real t2, GridFunction &cgf1, GridFunction &cgf2) |
Corrector step for deforming grids. | |
int | defineBody (int numberOfFaces, IntegerArray &boundaryFaces) |
Define the deforming body in terms of faces on grids. | |
int | getAccelerationBC (const real time0, const int grid, const Index &I1, const Index &I2, const Index &I3, realSerialArray &bcAcceleration) |
Return the grid acceleration on boundary points. | |
int | getAccelerationOrderOfAccuracy () const |
return the order of accuracy used to compute the acceleration. | |
int | getInitialState (InitialStateOptionEnum stateOption, const real time, const int grid, const Index &I1, const Index &I2, const Index &I3, realSerialArray &state) |
return the initial state (e.g. position, velocity, acceleration) | |
int | getNumberOfGrids () |
: return the number of grids that form the deforming body | |
int | getVelocity (const real time0, const int grid, CompositeGrid &cg, realArray &gridVelocity) |
Return the grid velocity. | |
int | getVelocityBC (const real time0, const int grid, const Index &I1, const Index &I2, const Index &I3, realSerialArray &bcVelocity) |
Return the grid velocity at specified points. | |
int | getVelocityOrderOfAccuracy () const |
return the order of accuracy used to compute the velocity. | |
int | initialize (CompositeGrid &cg, real t=0.) |
int | initializeGrid (CompositeGrid &cg, real t=0.) |
This initialization routine will adjust the initial CompositeGrid so that it can be deformed. This usually means that we change the Mapping for the grid that deforms. | |
int | initializePast (real time00, real dt00, CompositeGrid &cg) |
Initialize past history of the grid so that the grid velocity can be computed at t=0. | |
int | integrate (real t1, real t2, real t3, GridFunction &cgf1, GridFunction &cgf2, GridFunction &cgf3, realCompositeGridFunction &stress) |
void | printFilamentHyperbolicDimensions (CompositeGrid &cg00, int gridToMove00) |
int | regenerateComponentGrids (const real newT, CompositeGrid &cg) |
: regenerate all the component grids associated with this deforming body. | |
void | registerDeformingComponentGrid (const int grid, CompositeGrid &cg) |
int | setAccelerationOrderOfAccuracy (int order) |
set the order of accuracy used to compute the acceleration. | |
int | setVelocityOrderOfAccuracy (int order) |
set the order of accuracy used to compute the velocity. | |
int | setType (const DeformingBodyType bodyType) |
: Set the deforming body type. One of elasticFilament or userDefinedDeformingBody. | |
int | update (CompositeGrid &cg, GenericGraphicsInterface &gi) |
int | update (GenericGraphicsInterface &gi) |
int | userDefinedDeformingSurface (real t1, real t2, real t3, GridFunction &cgf1, GridFunction &cgf2, GridFunction &cgf3, int option) |
This function can be used by users to define the motion of a deforming surface which is defined by a set of data points. | |
Protected Member Functions | |
int | advanceElasticShell (real t1, real t2, real t3, GridFunction &cgf1, GridFunction &cgf2, GridFunction &cgf3, realCompositeGridFunction &stress, int option) |
Advance the elastic shell in time. | |
int | getFace (int grid) const |
Return the face number that corresponds to a given grid. This is a protected routine. | |
int | getPastLevelGrid (const int level, const int grid, CompositeGrid &cg, realArray &gridVelocity) |
void | simpleGetVelocity (const real vTime, const int grid00, CompositeGrid &cg, realArray &gridVelocity) |
Protected Attributes | |
ElasticFilament * | pElasticFilament |
DeformingGrid * | pDeformingGrid |
int | debug |
GenericGraphicsInterface * | pGIDebug |
MappingInformation * | pMapInfoDebug |
Parameters & | parameters |
DataBase | deformingBodyDataBase |
DeformingBodyMotion::DeformingBodyMotion | ( | Parameters & | params, |
int | numberOfTimeLevels = 3 , |
||
GenericGraphicsInterface * | pGIDebug00 = NULL , |
||
int | debug00 = 0 |
||
) |
Constructor: Set up grids, but do not initialize the mapping in the composite grid. And don't instantiate the `physics object' yet.
params | (input) : the DomainSolver Parameters object. |
References GridEvolution::debug, debug, deformingBodyDataBase, elasticFilament, pDeformingGrid, pElasticFilament, pGIDebug, pMapInfoDebug, and printF().
DeformingBodyMotion::~DeformingBodyMotion | ( | ) |
References deformingBodyDataBase, i, pDeformingGrid, pElasticFilament, and pMapInfoDebug.
|
protected |
Advance the elastic shell in time.
option | : option=0 : predictor-step, option=1 corrector step. |
References assert(), GridFunction::cg, cg, Parameters::dbase, GridFunction::dbase, debug, deformingBodyDataBase, dir, FOR_3D, i1, i2, i3, m, parameters, pc, printF(), GridFunction::u, uc, userDefinedDeformingBody, v, vc, wc, x, x2, and x3.
Referenced by integrate().
int DeformingBodyMotion::correct | ( | real | t1, |
real | t2, | ||
GridFunction & | cgf1, | ||
GridFunction & | cgf2 | ||
) |
Corrector step for deforming grids.
This function is called at the corrector step to update the moving grids. the acceleration on the boundary ).
t1,cgf1 | (input) : solution at the old time |
t2,cgf2 | (input) : solution at the new time (these are valid values) |
References debug, deformingBodyDataBase, elasticFilament, printF(), and userDefinedDeformingBody.
Referenced by MovingGrids::correctGrids().
int DeformingBodyMotion::defineBody | ( | int | numberOfFaces_, |
IntegerArray & | boundaryFaces_ | ||
) |
Define the deforming body in terms of faces on grids.
numberOfFaces | (input) : |
boundaryFaces | (input) : boundaryFaces(0:2,f) = (side,axis,grid) for face f |
References deformingBodyDataBase, elasticFilament, printF(), and userDefinedDeformingBody.
Referenced by MovingGrids::update().
int DeformingBodyMotion::getAccelerationBC | ( | const real | time0, |
const int | grid, | ||
const Index & | I1, | ||
const Index & | I2, | ||
const Index & | I3, | ||
realSerialArray & | bcAcceleration | ||
) |
Return the grid acceleration on boundary points.
References assert(), debug, deformingBodyDataBase, elasticFilament, ElasticFilament::getAccelerationBC(), getFace(), getInitialState(), initialAcceleration, pElasticFilament, printF(), and userDefinedDeformingBody.
Referenced by MovingGrids::getBoundaryAcceleration(), and MovingGrids::gridAccelerationBC().
int DeformingBodyMotion::getAccelerationOrderOfAccuracy | ( | ) | const |
return the order of accuracy used to compute the acceleration.
References deformingBodyDataBase.
|
protected |
Return the face number that corresponds to a given grid. This is a protected routine.
References deformingBodyDataBase, f, and grid.
Referenced by getAccelerationBC(), getVelocity(), and getVelocityBC().
int DeformingBodyMotion::getInitialState | ( | InitialStateOptionEnum | stateOption, |
const real | time, | ||
const int | grid, | ||
const Index & | I1, | ||
const Index & | I2, | ||
const Index & | I3, | ||
realSerialArray & | state | ||
) |
return the initial state (e.g. position, velocity, acceleration)
return the initial state of the deforming grid.
References a0, axis, Parameters::dbase, debug, deformingBodyDataBase, elasticFilament, initialAcceleration, initialVelocity, OV_ABORT(), parameters, printF(), and userDefinedDeformingBody.
Referenced by getAccelerationBC(), getVelocity(), and getVelocityBC().
int DeformingBodyMotion::getNumberOfGrids | ( | ) |
: return the number of grids that form the deforming body
References deformingBodyDataBase.
Referenced by MovingGrids::getBoundaryAcceleration(), MovingGrids::getGridVelocity(), and MovingGrids::gridAccelerationBC().
|
protected |
int DeformingBodyMotion::getVelocity | ( | const real | time0, |
const int | grid, | ||
CompositeGrid & | cg, | ||
realArray & | gridVelocity | ||
) |
Return the grid velocity.
This routine uses the GridEvolution class to compute the grid velocity. The GridEvolution class keeps a sequence of past grids and computes the time derivative of the grid motion using these grids.
References assert(), axis, debug, deformingBodyDataBase, dimension, display(), elasticFilament, getFace(), getIndex(), getInitialState(), DeformingGrid::getVelocity(), I1, I2, I3, initialVelocity, J1, J2, J3, OV_ABORT(), pDeformingGrid, printF(), and userDefinedDeformingBody.
Referenced by MovingGrids::getGridVelocity().
int DeformingBodyMotion::getVelocityBC | ( | const real | time0, |
const int | grid, | ||
const Index & | I1, | ||
const Index & | I2, | ||
const Index & | I3, | ||
realSerialArray & | bcVelocity | ||
) |
Return the grid velocity at specified points.
References assert(), debug, deformingBodyDataBase, elasticFilament, getFace(), getInitialState(), ElasticFilament::getVelocityBC(), initialVelocity, pElasticFilament, printF(), and userDefinedDeformingBody.
Referenced by MovingGrids::getGridVelocity().
int DeformingBodyMotion::getVelocityOrderOfAccuracy | ( | ) | const |
return the order of accuracy used to compute the velocity.
References deformingBodyDataBase.
int DeformingBodyMotion::initialize | ( | CompositeGrid & | cg, |
real | t = 0. |
||
) |
References all, assert(), debug, deformingBodyDataBase, dx, elasticFilament, i, I1, i2, I2, ElasticFilament::initializeFromFilamentMapping(), initializeGrid(), isRectangular, pDeformingGrid, pElasticFilament, pGIDebug, printF(), printFilamentHyperbolicDimensions(), r, rad, theta, userDefinedDeformingBody, x2, and xab.
Referenced by MovingGrids::update().
int DeformingBodyMotion::initializeGrid | ( | CompositeGrid & | cg, |
real | t = 0. |
||
) |
This initialization routine will adjust the initial CompositeGrid so that it can be deformed. This usually means that we change the Mapping for the grid that deforms.
cg | (input) : CompositeGrid to use (input) : time |
References assert(), debug, deformingBodyDataBase, init, printF(), and userDefinedDeformingBody.
Referenced by initialize().
int DeformingBodyMotion::initializePast | ( | real | time00, |
real | dt00, | ||
CompositeGrid & | cg | ||
) |
Initialize past history of the grid so that the grid velocity can be computed at t=0.
.. CALLED in the beginning of a computation to initialize the mapping history list with reasonable values so the grid velocity gets computed OK from the very first tstep
.. This will have to change once the surface gets it's own physics .. –> use x_t, x_tt at t=0 to find boundary curve at t= -dt, t=-2*dt
References assert(), ElasticFilament::copyBodyFittedMapping(), DeformingGrid::createMappingName(), debug, deformingBodyDataBase, elasticFilament, ElasticFilament::evaluateSurfaceAtTime(), DeformingGrid::getNewMapping(), grid, pDeformingGrid, pElasticFilament, pMapInfoDebug, printF(), ElasticFilament::referenceMap(), userDefinedDeformingBody, and x.
Referenced by MovingGrids::update().
int DeformingBodyMotion::integrate | ( | real | t1, |
real | t2, | ||
real | t3, | ||
GridFunction & | cgf1, | ||
GridFunction & | cgf2, | ||
GridFunction & | cgf3, | ||
realCompositeGridFunction & | stress | ||
) |
NOTES: The routine MovingGrids::movingGrids first calls DeformingBodyMotion::integrate to move the deforming body and then calls DeformingBodyMotion::regenerateComponentGrids to actually move the grid.
References advanceElasticShell(), assert(), GridFunction::cg, cg, Parameters::dbase, debug, deformingBodyDataBase, display(), elasticFilament, FOR_3D, Parameters::getBoundaryData(), i1, I1, i2, I2, i3, ElasticFilament::integrate(), m, parameters, pElasticFilament, printF(), GridFunction::u, u, u0, uc, userDefinedDeformingBody, userDefinedDeformingSurface(), vc, wc, x, x2, y, and z.
Referenced by MovingGrids::moveDeformingBodies().
void DeformingBodyMotion::printFilamentHyperbolicDimensions | ( | CompositeGrid & | cg00, |
int | gridToMove00 | ||
) |
References assert(), debug, deformingBodyDataBase, elasticFilament, and pMapInfoDebug.
Referenced by initialize().
int DeformingBodyMotion::regenerateComponentGrids | ( | const real | newT, |
CompositeGrid & | cg | ||
) |
: regenerate all the component grids associated with this deforming body.
The routine MovingGrids::movingGrids first calls DeformingBodyMotion::integrate to move the deforming body and then calls DeformingBodyMotion::regenerateComponentGrids to actually generate the grid.
References a, a0, assert(), b0, c, ElasticFilament::copyBodyFittedMapping(), DeformingGrid::createMappingName(), debug, deformingBodyDataBase, display(), elasticFilament, ElasticFilament::evaluateSurfaceAtTime(), DeformingGrid::getNewMapping(), i, i1, I1, i2, I2, i3, init, ns, omega, pDeformingGrid, pElasticFilament, pMapInfoDebug, printF(), r, rad, ElasticFilament::referenceMap(), s, theta, userDefinedDeformingBody, x, x2, y, and z.
Referenced by MovingGrids::moveGrids().
void DeformingBodyMotion::registerDeformingComponentGrid | ( | const int | grid, |
CompositeGrid & | cg | ||
) |
int DeformingBodyMotion::setAccelerationOrderOfAccuracy | ( | int | order | ) |
set the order of accuracy used to compute the acceleration.
order | (input) : a positive integer |
References deformingBodyDataBase.
int DeformingBodyMotion::setType | ( | const DeformingBodyType | bodyType | ) |
: Set the deforming body type. One of elasticFilament or userDefinedDeformingBody.
References deformingBodyDataBase.
int DeformingBodyMotion::setVelocityOrderOfAccuracy | ( | int | order | ) |
set the order of accuracy used to compute the velocity.
order | (input) : a positive integer |
References deformingBodyDataBase.
|
protected |
int DeformingBodyMotion::update | ( | CompositeGrid & | cg, |
GenericGraphicsInterface & | gi | ||
) |
References a0, assert(), debug, deformingBodyDataBase, elasticFilament, order, printF(), and userDefinedDeformingBody.
Referenced by DomainSolver::getMovingGridOption(), and MovingGrids::update().
int DeformingBodyMotion::update | ( | GenericGraphicsInterface & | gi | ) |
int DeformingBodyMotion::userDefinedDeformingSurface | ( | real | t1, |
real | t2, | ||
real | t3, | ||
GridFunction & | cgf1, | ||
GridFunction & | cgf2, | ||
GridFunction & | cgf3, | ||
int | option | ||
) |
This function can be used by users to define the motion of a deforming surface which is defined by a set of data points.
This function can be filled in to define the motion of a deforming surface which is defined by a set of data points. In general this function will be called by a predictor-corrector time stepping scheme. The parameter "option" indicates whether the function is being called by the predictor or corrector.
This function is intended to be changed by a user to define a new deforming body motion. The default implementation simply advects the interface with the current fluid velocity.
, cgf1, t2, cgf2, t3,cgf3 : Advance the solution from (t1,cgf1) to (t2,cgf2) using the solution at (t2,cgf2)
option | : option=0 : predictor-step, option=1 corrector step. The shape of the interface should always be advanced during the predictor step. The corrector step can be used to make small corrections to the shape that was computed from predictor step. This is sometimes needed to make the time-stepping stable. |
References assert(), GridFunction::cg, cg, Parameters::dbase, debug, deformingBodyDataBase, FOR_3D, i1, i2, i3, parameters, printF(), GridFunction::u, u, u0, uc, vc, wc, x, y, and z.
Referenced by integrate().
|
protected |
Referenced by advanceElasticShell(), correct(), DeformingBodyMotion(), getAccelerationBC(), getInitialState(), getPastLevelGrid(), getVelocity(), getVelocityBC(), initialize(), initializeGrid(), initializePast(), integrate(), printFilamentHyperbolicDimensions(), regenerateComponentGrids(), update(), and userDefinedDeformingSurface().
|
mutableprotected |
Referenced by advanceElasticShell(), correct(), defineBody(), DeformingBodyMotion(), getAccelerationBC(), getAccelerationOrderOfAccuracy(), getFace(), getInitialState(), getNumberOfGrids(), getPastLevelGrid(), getVelocity(), getVelocityBC(), getVelocityOrderOfAccuracy(), initialize(), initializeGrid(), initializePast(), integrate(), printFilamentHyperbolicDimensions(), regenerateComponentGrids(), setAccelerationOrderOfAccuracy(), setType(), setVelocityOrderOfAccuracy(), simpleGetVelocity(), update(), userDefinedDeformingSurface(), and ~DeformingBodyMotion().
|
protected |
Referenced by advanceElasticShell(), getInitialState(), integrate(), and userDefinedDeformingSurface().
|
protected |
|
protected |
|
protected |
Referenced by DeformingBodyMotion(), and initialize().
|
protected |