NetDEM v1.0
Loading...
Searching...
No Matches
peridigm_settings.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "utils_math.hpp"
4#include <cmath>
5#include <fstream>
6#include <sstream>
7#include <string>
8
9namespace netdem {
10
19public:
23 std::string result_dir{"tmp/out/peridigm/"};
24
28 std::string peridigm_exe{"Peridigm"};
29
37 double horizon_factor{3.01};
38
43
48
52 double timestep{1.0e-6};
53
58 double timestep_factor{0.95};
59
63 double mech_time{0.0};
64
73
82
87
98 void WriteInputFile(std::ostream &os) {
99 // solver settings
100 os << " Solver: " << std::endl;
101 os << " Verbose: false" << std::endl;
102 os << " Initial Time: 0.0" << std::endl;
103 os << " Final Time: " + IO::ToString(mech_time) << std::endl;
104 os << " Verlet: " << std::endl;
105 if (!use_auto_timestep) {
106 os << " Fixed dt: " + IO::ToString(timestep) << std::endl;
107 } else {
108 os << " Safety Factor: " + IO::ToString(timestep_factor)
109 << std::endl;
110 }
111 os << std::endl;
112
113 // compute settings, for fraguting the stored strain energy in the particle
114 os << " Compute Class Parameters: " << std::endl;
115 os << " Grain Stored Elastic Energy: " << std::endl;
116 os << " Compute Class: \"Block_Data\"" << std::endl;
117 os << " Calculation Type: \"Sum\"" << std::endl;
118 os << " Block: \"block_1\"" << std::endl;
119 os << " Variable: \"Stored_Elastic_Energy\"" << std::endl;
120 os << " Output Label: \"Grain_Stored_Elastic_Energy\"" << std::endl;
121 os << std::endl;
122
123 // output settings
124 os << " Output Data: " << std::endl;
125 os << " Output File Type: \"ExodusII\"" << std::endl;
126 os << " Output Format: \"BINARY\"" << std::endl;
127 os << " Output Filename: \"output\"" << std::endl;
128 os << " Output Frequency: " + IO::ToString(output_freqency)
129 << std::endl;
130 os << " Parallel Write: true" << std::endl;
131 os << " Output Variables: " << std::endl;
132 os << " Displacement: true" << std::endl;
133 os << " Velocity: true" << std::endl;
134 os << " Element_Id: true" << std::endl;
135 os << " Dilatation: true" << std::endl;
136 os << " Weighted_Volume: true" << std::endl;
137 os << " Volume: true" << std::endl;
138 os << " Damage: true" << std::endl;
139 os << " Radius: true" << std::endl;
140 os << " Horizon: true" << std::endl;
141 os << " Contact_Force: true" << std::endl;
142 os << " Number_Of_Neighbors: true" << std::endl;
143 os << " Neighborhood_Volume: true" << std::endl;
144 os << " Force: true" << std::endl;
145 os << " Force_Density: true" << std::endl;
146 os << " Stored_Elastic_Energy: true" << std::endl;
147 os << " Grain_Stored_Elastic_Energy: true" << std::endl;
148 os << " Kinetic_Energy: true" << std::endl;
149 os << std::endl;
150 }
151};
152
153} // namespace netdem
static std::string ToString(int value)
Definition utils_io.cpp:27
A class representing the settings used in a peridynamic simulation.
Definition peridigm_settings.hpp:18
double constrain_radius_factor
The constrain radius factor used for point contact.
Definition peridigm_settings.hpp:81
bool omit_bonds_between_blocks
Whether or not bonds between blocks should be omitted.
Definition peridigm_settings.hpp:42
std::string result_dir
The directory where the simulation results should be written.
Definition peridigm_settings.hpp:23
void WriteInputFile(std::ostream &os)
Writes the simulation settings to a file stream in Peridigm-compatible format.
Definition peridigm_settings.hpp:98
bool use_auto_timestep
Whether or not to use an automatically computed timestep.
Definition peridigm_settings.hpp:47
double timestep
The fixed timestep to use if use_auto_timestep is false.
Definition peridigm_settings.hpp:52
double timestep_factor
The safety factor used to compute the timestep if use_auto_timestep is true.
Definition peridigm_settings.hpp:58
double mech_time
The mechanical time of the simulation.
Definition peridigm_settings.hpp:63
double loading_radius_factor
The loading radius factor used for point contact.
Definition peridigm_settings.hpp:72
int output_freqency
The frequency at which output should be written to file.
Definition peridigm_settings.hpp:86
std::string peridigm_exe
The name of the executable used for running the Peridigm code.
Definition peridigm_settings.hpp:28
double horizon_factor
The factor by which the horizon should be computed based on the node size.
Definition peridigm_settings.hpp:37
Definition bond_entry.hpp:7