Refactoring

This commit is contained in:
iasonmanolas 2022-07-12 13:00:45 +03:00
parent e70b4e9863
commit adaf49627f
1 changed files with 3 additions and 3 deletions

View File

@ -65,16 +65,16 @@ struct ElementMaterial
: poissonsRatio(poissonsRatio), youngsModulus(youngsModulus)
{
assert(poissonsRatio <= 0.5 && poissonsRatio >= -1);
updateProperties();
updateShearModulus();
}
ElementMaterial() : poissonsRatio(0.3), youngsModulus(200 * 1e9) { updateProperties(); }
ElementMaterial() : poissonsRatio(0.3), youngsModulus(1e9) { updateShearModulus(); }
std::string toString() const
{
return std::string("Material:") + std::string("\nPoisson's ratio=")
+ std::to_string(poissonsRatio) + std::string("\nYoung's Modulus(GPa)=")
+ std::to_string(youngsModulus / 1e9);
}
void updateProperties() { G = youngsModulus / (2 * (1 + poissonsRatio)); }
void updateShearModulus() { G = youngsModulus / (2 * (1 + poissonsRatio)); }
};
#endif // BEAM_HPP