Parser for material property files in INI format.
More...
#include <Materials.hpp>
Parser for material property files in INI format.
Definition at line 17 of file Materials.hpp.
◆ Phyth::Mechanics::Material::detail::MaterialINIParser::MaterialData
| struct Phyth::Mechanics::Material::detail::MaterialINIParser::MaterialData |
Material property data structure.
Contains the physical properties required to define an isotropic linear elastic material.
Definition at line 25 of file Materials.hpp.
| Class Members |
|
Scalar |
poisson_ratio |
Poisson's ratio nu (dimensionless) |
|
Quantity< Pascal > |
youngs_modulus |
Young's modulus E (Pa) |
◆ Parse()
| static std::unordered_map< std::string, MaterialData > Phyth::Mechanics::Material::detail::MaterialINIParser::Parse |
( |
const std::string & |
filename | ) |
|
|
inlinestatic |
Parse an INI file and extract material definitions.
- Parameters
-
| filename | Path to the INI file containing material definitions |
- Returns
- std::unordered_map<std::string, MaterialData> Map of material names to their properties
- Exceptions
-
| std::runtime_error | If the file cannot be opened |
| std::runtime_error | If a section header is malformed |
| std::runtime_error | If a numeric value cannot be parsed |
Definition at line 40 of file Materials.hpp.
◆ parseNumber()
| static double Phyth::Mechanics::Material::detail::MaterialINIParser::parseNumber |
( |
const std::string & |
str | ) |
|
|
inlinestaticprivate |
Parse a string as a double-precision floating point number.
- Parameters
-
| str | String containing a numeric value |
- Returns
- double Parsed numeric value
- Exceptions
-
| std::runtime_error | If the string cannot be parsed as a number |
- Note
- Supports scientific notation (e.g., "2.1e-3")
Definition at line 125 of file Materials.hpp.
◆ trim()
| static void Phyth::Mechanics::Material::detail::MaterialINIParser::trim |
( |
std::string & |
str | ) |
|
|
inlinestaticprivate |
Remove leading and trailing whitespace characters.
- Parameters
-
| str | String to trim (modified in-place) |
- Note
- Trims spaces, tabs, carriage returns, and newlines
Definition at line 105 of file Materials.hpp.
The documentation for this class was generated from the following file: