Feel++ 0.111.0-preview.14
Finite Element Embedded Library in C++
Feel::Newmark< SpaceType > Class Template Reference

Newmark discretization. More...

+ Inheritance diagram for Feel::Newmark< SpaceType >:
+ Collaboration diagram for Feel::Newmark< SpaceType >:

Public Types

typedef space_type::element_ptrtype element_ptrtype
 
typedef space_type::element_type element_type
 
typedef std::shared_ptr< newmark_type > newmark_ptrtype
 
typedef Newmark< SpaceType > newmark_type
 
typedef node< value_type >::type node_type
 
typedef space_type::return_type return_type
 
typedef std::shared_ptr< space_type > space_ptrtype
 
typedef SpaceType space_type
 
typedef super::time_iterator time_iterator
 
typedef element_ptrtype unknown_type
 
typedef element_type::value_type value_type
 
- Public Types inherited from Feel::TSBase
typedef std::vector< double >::const_iterator time_const_iterator
 
typedef std::vector< double >::iterator time_iterator
 
typedef std::vector< double > time_values_map_type
 

Public Member Functions

double beta () const
 
element_type & currentAcceleration ()
 
element_type const & currentAcceleration () const
 
element_ptrtype & currentAccelerationPtr ()
 
element_ptrtype const & currentAccelerationPtr () const
 
element_type & currentVelocity ()
 
element_type const & currentVelocity () const
 
element_ptrtype & currentVelocityPtr ()
 
element_ptrtype const & currentVelocityPtr () const
 
double gamma () const
 Coefficients \( \gamma \) and \( \beta \) of the time newmark discretization.
 
void initialize (element_type const &u0)
 Initialize all the entries of the unknown vector to be derived with the vector u0 (duplicated)
 
void loadCurrent ()
 
 Newmark (Newmark const &b)
 copy operator
 
FEELPP_DEPRECATED Newmark (po::variables_map const &vm, space_ptrtype const &space, std::string const &name, std::string const &prefix="")
 Constructor. More...
 
 Newmark (space_ptrtype const &space, std::string const &name)
 Constructor. More...
 
 Newmark (space_ptrtype const &space, std::string const &name, std::string const &prefix="")
 
double next () const override
 
template<typename container_type >
double next (typename space_type::template Element< value_type, container_type > const &u_curr, bool updateVelAcc=true)
 shift previousstored solutions with respect to the new one u_curr if updateVelAcc is true then the velocity and acceleration are updated too
 
element_type const & polyDeriv () const
 Returns the right hand side \( \bar{p} \) of the time derivative formula.
 
double polyDerivCoefficient () const
 
element_type const & polyFirstDeriv () const
 
double polyFirstDerivCoefficient () const
 
element_type const & polySecondDeriv () const
 
double polySecondDerivCoefficient () const
 
element_type const & previousAcceleration (int k=0) const
 
element_type const & previousUnknown (int k=0) const
 Return the last unknown.
 
element_type const & previousVelocity (int k=0) const
 
double restart ()
 restart the newmark scheme
 
void setBeta (double beta)
 
void setGamma (double gamma)
 
template<typename container_type >
void shiftRight (typename space_type::template Element< value_type, container_type > const &u_curr)
 Update the vectors of the previous time steps by shifting on the right the old values. More...
 
double start ()
 start the newmark scheme
 
double start (element_type const &u0)
 
template<typename container_type >
void updateFromDisp (typename space_type::template Element< value_type, container_type > const &u_curr, int previousTimeStep=0)
 from the displacement u_curr update the velocity and acceleration
 
- Public Member Functions inherited from Feel::TSBase
bool doRestartAtLastSave () const
 return value of do restart at last save
 
std::string fileFormat () const
 return file format saved and loaded : binary or hdf5
 
bool isFinished () const
 return true if Bdf is finished, false otherwise
 
bool isRestart () const
 return the value of the bool restart
 
bool isReverse () const
 return the reverse time loop state.
 
bool isReverseLoad () const
 return the reverse time loop state.
 
bool isRunning () const
 
bool isSteady () const
 
bool isStopped () const
 
int iteration () const
 return the current iteration
 
const int iterationNumber () const
 return the number of iteration
 
virtual double next () const
 advance in time More...
 
int nRestart () const
 return the number of restarts
 
TSBase & operator= (TSBase const &b)
 
fs::path path ()
 return the relative path where the bdf data is stored
 
std::string const & prefix () const
 
virtual void print () const
 
virtual std::map< int, double > priorTimes () const
 
bool rankProcInNameOfFiles () const
 
double realTimePerIteration () const
 return the real time in seconds spent in the iteration
 
void reloadMetaData ()
 reload metadata to get all time step already done
 
double restart ()
 restart the bdf
 
fs::path restartPath ()
 
int restartStepBeforeLastSave () const
 return the step index before the last used to restart
 
int saveFreq () const
 
bool saveInFile () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 save/load Bdf metadata
 
void setfileFormat (std::string s)
 
void setPathSave (std::string s)
 
void setRankProcInNameOfFiles (bool b)
 
void setRestart (bool doRestart)
 
void setRestartAtLastSave (bool b)
 
void setRestartPath (std::string const &s)
 
void setReverse (bool reverse=false)
 Reverse time (iteration always start at 0!)
 
void setReverseLoad (bool reverseLoad=false)
 Load saved unknown beginning from last iteration. In bdf, solutions are saved from Ti (iter 0) ->Tf (iter N) in hdf5 files indexed by the iteration. If we reverse bdf, it runs from Tf (iter 0) -> Ti (iter N). To read hdf5 solution from files, we have to load the file N at Ti. Therefore reversing iteration index to load the correct file. Note: it is not required if the solution has to be saved.
 
void setSaveFreq (int v)
 
void setSaveInFile (bool b)
 
void setSteady (bool steady=true)
 
void setTimeFinal (double T)
 
void setTimeInitial (double ti)
 
void setTimeStep (double dt)
 
virtual void shiftRight ()
 
double start ()
 start the bdf
 
TSState state () const
 return the state of the BDF
 
TSStragegy strategy () const
 
double time () const
 return the current time
 
double timeFinal () const
 return the final time
 
double timeInitial () const
 return the initial time
 
double timeStep () const
 return the final step
 
time_values_map_type timeValues () const
 return vector of time
 
 TSBase (std::string name, std::string const &prefix, WorldComm const &worldComm, po::variables_map const &vm, double ti, double tf, double dt, bool steady, bool reverse, bool restart, std::string const &restart_path, bool restart_at_last_save, bool save, int freq, bool rank_proc_in_files_name, std::string const &format)
 
 TSBase (std::string name, std::string const &prefix, WorldComm const &worldComm, po::variables_map const &vm=Environment::vm())
 
 TSBase (std::string name, WorldComm const &worldComm)
 
 TSBase (TSBase const &b)
 
virtual void update ()
 
WorldComm const & worldComm () const
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Member Functions inherited from Feel::TSBase
void init ()
 
- Protected Attributes inherited from Feel::TSBase
bool M_displayStats
 indicates if display stat is enabled
 
double M_dt
 timestep
 
std::string M_fileFormat
 file format saved and loaded : binary or hdf5
 
int M_iteration
 iteration
 
int M_n_restart
 restart
 
std::string M_name
 name of the file holding the bdf data
 
fs::path M_path_save
 path to the directory to store the functions
 
std::string M_prefix
 
bool M_rankProcInNameOfFiles
 put the rank of the processor in generated files
 
double M_real_time_per_iteration
 real time spent per iteration (in seconds)
 
bool M_restart
 do a restart
 
bool M_restartAtLastSave
 do restart with ti the last save
 
fs::path M_restartPath
 restart path
 
int M_restartStepBeforeLastSave
 do restart with the ieme step before the last save
 
bool M_reverse
 is reversed
 
bool M_reverseLoad
 is file load from reverse
 
int M_saveFreq
 frequence of save solutions
 
bool M_saveInFile
 Save solutions in file after each step.
 
TSState M_state
 state of the time stepping algorithm
 
bool M_steady
 is steady
 
double M_Tf
 final time
 
double M_Ti
 initial time to start
 
double M_time
 time
 
time_values_map_type M_time_values_map
 vector that holds the time order at each bdf step More...
 
Feel::Timer M_timer
 timer for real time per iteration
 
WorldComm M_worldComm
 mpi communicator tool
 

Detailed Description

template<typename SpaceType>
class Feel::Newmark< SpaceType >

Newmark discretization.

A differential equation of the form

\( M \ddot{\boldsymbol{\eta}}^{n+1} = A \boldsymbol{\eta}^{n+1} + f \)

is discretized in time as

\begin{eqnarray} \ddot{\boldsymbol{\eta}}^{n+1} &=& \frac{1}{\beta \Delta t^2} \left( \boldsymbol{\eta}^{n+1}-\boldsymbol{\eta}^{n} \right) - \frac{1}{\beta \Delta t} \dot{\boldsymbol{\eta}}^{n} - \left( \frac{1}{2 \beta} -1 \right) \ddot{\boldsymbol{\eta}}^{n} \\ \dot{\boldsymbol{\eta}}^{n+1} &=& \frac{\gamma}{\beta \Delta t} \left( \boldsymbol{\eta}^{n+1}-\boldsymbol{\eta}^{n} \right) - \left( \frac{\gamma}{\beta} -1 \right) \dot{\boldsymbol{\eta}}^{n} - \Delta t \left( \frac{\gamma}{2\beta}-1 \right) \ddot{\boldsymbol{\eta}}^{n} \end{eqnarray}

Constructor & Destructor Documentation

◆ Newmark() [1/2]

template<typename SpaceType >
FEELPP_DEPRECATED Feel::Newmark< SpaceType >::Newmark ( po::variables_map const &  vm,
space_ptrtype const &  space,
std::string const &  name,
std::string const &  prefix = "" 
)

Constructor.

Parameters
vmoption storage
spaceapproximation space
namename of the newmark ts
prefixprefix of the newmark ts

◆ Newmark() [2/2]

template<typename SpaceType >
Feel::Newmark< SpaceType >::Newmark ( space_ptrtype const &  space,
std::string const &  name 
)

Constructor.

Parameters
spaceapproximation space
namename of the newmark ts

Member Function Documentation

◆ next()

template<typename SpaceType >
double Feel::Newmark< SpaceType >::next
overridevirtual

Reimplemented from Feel::TSBase.

◆ shiftRight()

template<typename SpaceType >
template<typename container_type >
void Feel::Newmark< SpaceType >::shiftRight ( typename space_type::template Element< value_type, container_type > const &  u_curr)

Update the vectors of the previous time steps by shifting on the right the old values.

Parameters
u_currcurrent (new) value of the state vector