NetDEM v1.0
Loading...
Searching...
No Matches
peridigm_material.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "utils_io.hpp"
4#include <cmath>
5
6namespace netdem {
7
17public:
24 enum Type { Elastic };
25
30
34 double density = 2650.0;
35
39 double youngs_modulus = 70.0e9;
40
44 double poissons_ratio = 0.15;
45
57 void WriteInputFile(std::ostream &os, int material_id) {
58 os << " My Material " + std::to_string(material_id + 1) + ": "
59 << std::endl;
60 switch (type) {
61 case Type::Elastic:
62 os << " Material Model : \"Elastic\"" << std::endl;
63 os << " Density: " + IO::ToString(density) << std::endl;
64 os << " Young's Modulus: " + IO::ToString(youngs_modulus)
65 << std::endl;
66 os << " Poisson's Ratio: " + IO::ToString(poissons_ratio)
67 << std::endl;
68 break;
69
70 default:
72 "in PeriDigmMaterial::WriteToFile, material type not defined");
73 break;
74 }
75 }
76};
77
78} // namespace netdem
static void PrintError(std::string const &info)
Definition utils_io.cpp:18
static std::string ToString(int value)
Definition utils_io.cpp:27
A class representing the material properties used in a peridynamic simulation.
Definition peridigm_material.hpp:16
Type type
The type of material model used.
Definition peridigm_material.hpp:29
double poissons_ratio
The Poisson's ratio of the material.
Definition peridigm_material.hpp:44
double youngs_modulus
The Young's modulus of the material.
Definition peridigm_material.hpp:39
void WriteInputFile(std::ostream &os, int material_id)
Writes the material parameters to a file stream in Peridigm-compatible format.
Definition peridigm_material.hpp:57
double density
The density of the material.
Definition peridigm_material.hpp:34
Type
An enum representing the type of material model used.
Definition peridigm_material.hpp:24
@ Elastic
Definition peridigm_material.hpp:24
Definition bond_entry.hpp:7