Skip to content

Commit

Permalink
documentation in state branch
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricix committed Sep 23, 2024
1 parent 22461dc commit ddd61a4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
4 changes: 4 additions & 0 deletions inc/MPM.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ class MPM {
///
void end();

/// \brief Load model state
///
void loadState();

/// \brief Save model state
///
void saveState();
private:

Expand Down
9 changes: 8 additions & 1 deletion inc/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,22 @@ namespace ModelSetup {
/// \return True if is Linux system
bool getLinuxSystem();

/// \brief Return true is load state is activated
/// \return True is load state is activated
bool getLoadState();

/// \brief Set load state activated
/// \param[in] load_state_activated Flag to load an state
void setLoadState(bool st);

/// \brief Return true is save state is activated
/// \return True is save state is activated
bool getSaveState();

/// \brief Set save state activated
/// \param[in] save_state_activated Flag to save an state
void setSaveState(bool st);


/// \brief Return the number of nodes that a particle contributes
/// \return The number of nodes that a particle contributes
unsigned getContributionNodesNum();
Expand Down
6 changes: 6 additions & 0 deletions inc/States.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@

namespace States {

/// \brief Save the particles stress into a json file
/// \param[in] filename File name
/// \param[in] particles List containing pointers to particles
void saveParticleStress(const std::string& filename, const std::vector<Particle*>& particles);

/// \brief Load the particles stress from a json file
/// \param[in] filename File name
/// \param[in] particles List containing pointers to particles
void loadParticleStress(const std::string& filename, std::vector<Particle*>& particles);
}

Expand Down
15 changes: 8 additions & 7 deletions src/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace ModelSetup {
// contact
bool contactActive=false; //!< is contact active

// state
// states
bool loadState = false; //!< if state need to be loaded
bool saveState = false; //!< if state need to be salved

Expand Down Expand Up @@ -53,15 +53,15 @@ namespace ModelSetup {
// time
double dt=0.0; //!< time step
double time=0.0; //!< simulation time
double dt_critical_multiplier=0.25; //!< dafault critical time step fraction
double dt_critical_multiplier = 0.25; //!< dafault critical time step fraction

// initial time simulation
std::chrono::system_clock::time_point initialSimulationTime;

// default damping
DampingType damping=DampingType::UNDAMPED; //!< damping type

// default lodal damping value
// default local damping value
double localDamping=0.0; //!< local damping value

// input file
Expand All @@ -77,9 +77,9 @@ namespace ModelSetup {
/// Function members
///

// states
bool getLoadState() { return loadState; }
void setLoadState(bool st) { loadState = st; }

bool getSaveState() { return saveState; }
void setSaveState(bool st) { saveState = st; }

Expand All @@ -92,8 +92,7 @@ namespace ModelSetup {

// results
unsigned getResultNum() { return resultNumber; }
void
setResultNum(unsigned d) { resultNumber=d; }
void setResultNum(unsigned d) { resultNumber=d; }
unsigned getResultSteps() { return static_cast<unsigned int>(floor(time/dt)/resultNumber); }

// time step
Expand Down Expand Up @@ -125,6 +124,7 @@ namespace ModelSetup {
bool getTwoPhaseActive() { return twoPhaseCalculationActive; }
void setTwoPhaseActive(bool d) { twoPhaseCalculationActive=d; }

// simulation time
void setInitialSimulationTime(std::chrono::system_clock::time_point initialTime) { ModelSetup::initialSimulationTime = initialTime; }
std::chrono::system_clock::time_point getInitialSimulationTime() { return ModelSetup::initialSimulationTime; }

Expand Down Expand Up @@ -153,7 +153,8 @@ namespace ModelSetup {
// interpolation functions
ModelSetup::InterpolationFunctionType getInterpolationFunction() { return interpolationType; }
void setInterpolationFunction(ModelSetup::InterpolationFunctionType d) { interpolationType=d; }


// openMP threads
void setNumThreads(unsigned nThreads){

#ifdef _OPENMP
Expand Down

0 comments on commit ddd61a4

Please sign in to comment.