Continuum Membrane 719025a62b1e384a6ff80e2f2a223ef4012153dc
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
DynamicModel Class Reference

#include <Dynamics.hpp>

Inheritance diagram for DynamicModel:
Model

Public Member Functions

 DynamicModel (DynamicMesh &mesh_, Record &record_)
 Constructs a new Model object.
 
void next_step ()
 This code iterates over all vertices in a mesh and displaces them randomly based on a force term and a random term. The displacement is added to the original vertex position.
 
- Public Member Functions inherited from Model
 Model (Mesh &mesh_, Record &record_)
 Constructs a new Model object.
 
bool should_continue_optimization ()
 Determines whether the optimization algorithm should continue running.
 
void determine_trial_step_size ()
 This code determines the step size used in an optimization algorithm. The step size is used to calculate how far to move in each iteration of the optimization algorithm to minimize an energy function.
 
std::string to_string_current_step ()
 Returns a string representation of the current step's iteration number, trial step size, and optimal step size. The function concatenates the values of model.iteration, model.oa.trialStepSize, and model.stepSize to the following format: "step: , trial StepSize = , StepSize = ".
 
void update_ncg_direction ()
 Updates the direction for nonlinear conjugate gradient (NCG) optimization.
 
void reset_ncg_direction ()
 Reset the direction for nonlinear conjugate gradient (NCG) optimization.
 
double linear_search_for_stepsize_to_minimize_energy ()
 Performs a linear search to find the optimal step size that minimizes energy using either nonlinear conjugate gradient method or simple line search.
 
bool simulated_annealing_next_step (bool forceAttempt=false)
 Use a Metropolis thermal trial move to sample beyond local gradient descent.
 
void enforce_boundary_conditions_after_coordinate_update ()
 Synchronize boundary/ghost coordinates after direct coordinate updates.
 
void update_vertex_using_NCG ()
 Update vertex coordinates using a non-linear conjugate gradient method.
 

Public Attributes

DynamicMeshmesh
 
double randScaleConst
 
double forceScaleConst
 
unsigned int randomSeed
 
std::mt19937 gen
 
std::normal_distribution normal_dist
 
- Public Attributes inherited from Model
Meshmesh
 
Recordrecord
 
int iteration
 
double stepSize
 
OptimizationAlgorithm oa
 
std::vector< ForcencgDirection0
 vector to store the initial direction for nonlinear conjugate gradient optimization
 
bool isHeating = true
 
int currentCoolingStep = 0
 
int coolingStep = 35
 
int currentHeatingStep = 0
 
int heatingStep = 15
 
double highTemperature = 0.0
 
std::mt19937 thermalRng
 Reproducible random generator for thermal fluctuation trial moves.
 
int thermalFluctuationAttemptCount = 0
 Number of attempted thermal trial moves.
 
std::vector< ThermalFluctuationRecordthermalFluctuationRecords
 Diagnostics for thermal trial moves.
 

Constructor & Destructor Documentation

◆ DynamicModel()

DynamicModel::DynamicModel ( DynamicMesh mesh_,
Record record_ 
)

Constructs a new Model object.

Parameters
mesh_The mesh object to be encapsulated.
record_The record object to be encapsulated.

Member Function Documentation

◆ next_step()

void DynamicModel::next_step ( )

This code iterates over all vertices in a mesh and displaces them randomly based on a force term and a random term. The displacement is added to the original vertex position.

The boundary conditions are checked for each vertex before displacement, and if the vertex is a ghost or boundary, and not part of a periodic boundary condition, then the displacement is set to 0.

The displacement amount, along with the vertex index, whether it is a boundary or ghost vertex, and the dimension being displaced (x, y, z) is printed to the console using std::cout.

Member Data Documentation

◆ forceScaleConst

double DynamicModel::forceScaleConst

◆ gen

std::mt19937 DynamicModel::gen

◆ mesh

DynamicMesh& DynamicModel::mesh

Hides Model::mesh; The mesh object.

◆ normal_dist

std::normal_distribution DynamicModel::normal_dist

◆ randomSeed

unsigned int DynamicModel::randomSeed

◆ randScaleConst

double DynamicModel::randScaleConst

The documentation for this class was generated from the following file: