Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
94b2bc3
implement basic classes
rmanno91 May 28, 2025
9349ad2
fixes
rmanno91 May 29, 2025
ab1c46e
add tests
rmanno91 May 29, 2025
91433b6
add tests
rmanno91 May 29, 2025
a1141a5
remove trial
rmanno91 May 29, 2025
f14a7c2
add interpolation options
rmanno91 May 29, 2025
6e0eca2
add pydantic
rmanno91 May 29, 2025
aa20311
remove leftover
rmanno91 May 29, 2025
a1de0e4
fixes
rmanno91 May 29, 2025
ea4f6b8
Merge branch 'main' into rmanno/start_implementation_variable_material
rmanno91 May 29, 2025
e5e674a
poetry lock
rmanno91 May 29, 2025
14cd314
trial implementation
rmanno91 Jun 4, 2025
41a79e0
trial
rmanno91 Jun 5, 2025
696b2a3
fixes
rmanno91 Jun 5, 2025
5c58e31
add
rmanno91 Jun 6, 2025
5ce5358
trial
rmanno91 Jun 12, 2025
b02c030
fix
rmanno91 Jun 12, 2025
72a461a
fixes
rmanno91 Jun 12, 2025
b551e6f
add mat models and tests for reading
rmanno91 Jun 13, 2025
b3fb5c8
add remaining models
rmanno91 Jun 16, 2025
5b9f976
add more models
rmanno91 Jun 17, 2025
b6246cf
rem color
rmanno91 Jun 17, 2025
2c8602c
fix
rmanno91 Jun 17, 2025
b89691b
add tsai-wu test
rmanno91 Jun 17, 2025
6b9f825
remove matml from examples
rmanno91 Jun 17, 2025
6feb6ad
fix tests after color implementation
rmanno91 Jun 17, 2025
76cbce5
add specific heat tests
rmanno91 Jun 17, 2025
3e780ba
implement speed of sound tests
rmanno91 Jun 17, 2025
118d1ee
implement larc tests
rmanno91 Jun 17, 2025
602007a
add viscosity tests
rmanno91 Jun 17, 2025
f1ec706
fix test write density
rmanno91 Jun 17, 2025
df416f2
add tests write elasticity
rmanno91 Jun 17, 2025
8bf7c6a
add ply type read and fabric fiber angle
rmanno91 Jun 17, 2025
47dec78
remove template
rmanno91 Jun 17, 2025
9e60823
add test hill and hardening
rmanno91 Jun 17, 2025
71d3ab6
fix
rmanno91 Jun 17, 2025
1fc084f
fix puck read tests
rmanno91 Jun 18, 2025
e287dc3
fix usermat tests
rmanno91 Jun 18, 2025
3a82871
add tests isotropic hardening
rmanno91 Jun 18, 2025
87b1a0b
add test write larc
rmanno91 Jun 18, 2025
90e1241
stress limits tests
rmanno91 Jun 18, 2025
871aa43
add write specific heat tests
rmanno91 Jun 18, 2025
3c395e5
add write speed of sound
rmanno91 Jun 18, 2025
17e60eb
add tests
rmanno91 Jun 18, 2025
2f93c91
add test writing viscosity
rmanno91 Jun 18, 2025
ccfc45b
usermat write
rmanno91 Jun 18, 2025
cb30be4
add validator pre
rmanno91 Jun 18, 2025
7dcf5d2
general fixes
rmanno91 Jun 19, 2025
5f50a21
fixes
rmanno91 Jun 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions examples/data/material_isotropic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<EngineeringData version="20.2.0.189" versiondate="4/20/2020 2:38:00 PM">
<Notes>
</Notes>
<Materials>
<MatML_Doc>
<Material>
<BulkDetails>
<Name>Isotropic Test Material</Name>
<PropertyData property="pr0">
<Data format="string">-</Data>
<ParameterValue parameter="pa0" format="float">
<Data>182</Data>
<Qualifier name="Variable Type">Dependent</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa1" format="float">
<Data>229</Data>
<Qualifier name="Variable Type">Dependent</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa2" format="float">
<Data>228</Data>
<Qualifier name="Variable Type">Dependent</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa3" format="string">
<Data>Appearance</Data>
</ParameterValue>
</PropertyData>
<PropertyData property="pr1">
<Data format="string">-</Data>
<Qualifier name="Behavior">Isotropic</Qualifier>
<Qualifier name="Derive from">Young's Modulus and Poisson's Ratio</Qualifier>
<Qualifier name="Field Variable Compatible">Temperature</Qualifier>
<ParameterValue parameter="pa5" format="string">
<Data>Interpolation Options</Data>
<Qualifier name="AlgorithmType">Linear Multivariate</Qualifier>
<Qualifier name="Normalized">True</Qualifier>
<Qualifier name="Cached">True</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa4" format="float">
<Data>1000000</Data>
<Qualifier name="Variable Type">Dependent</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa5" format="float">
<Data>0.3</Data>
<Qualifier name="Variable Type">Dependent</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa6" format="float">
<Data>833333.333333333</Data>
<Qualifier name="Variable Type">Dependent</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa7" format="float">
<Data>384615.384615385</Data>
<Qualifier name="Variable Type">Dependent</Qualifier>
</ParameterValue>
<ParameterValue parameter="pa8" format="float">
<Data>7.88860905221012e-31</Data>
<Qualifier name="Variable Type">Independent</Qualifier>
<Qualifier name="Field Variable">Temperature</Qualifier>
<Qualifier name="Default Data">22</Qualifier>
<Qualifier name="Upper Limit">1.18329135783152E-30</Qualifier>
<Qualifier name="Lower Limit">3.94430452610506E-31</Qualifier>
<Qualifier name="Field Units">C</Qualifier>
</ParameterValue>
</PropertyData>
</BulkDetails>
</Material>
<Metadata>
<ParameterDetails id="pa0">
<Name>Red</Name>
<Unitless />
</ParameterDetails>
<ParameterDetails id="pa1">
<Name>Green</Name>
<Unitless />
</ParameterDetails>
<ParameterDetails id="pa2">
<Name>Blue</Name>
<Unitless />
</ParameterDetails>
<ParameterDetails id="pa3">
<Name>Material Property</Name>
<Unitless />
</ParameterDetails>
<ParameterDetails id="pa4">
<Name>Young's Modulus</Name>
<Units name="Stress">
<Unit>
<Name>Pa</Name>
</Unit>
</Units>
</ParameterDetails>
<ParameterDetails id="pa5">
<Name>Poisson's Ratio</Name>
<Unitless />
</ParameterDetails>
<ParameterDetails id="pa6">
<Name>Bulk Modulus</Name>
<Units name="Stress">
<Unit>
<Name>Pa</Name>
</Unit>
</Units>
</ParameterDetails>
<ParameterDetails id="pa7">
<Name>Shear Modulus</Name>
<Units name="Stress">
<Unit>
<Name>Pa</Name>
</Unit>
</Units>
</ParameterDetails>
<ParameterDetails id="pa8">
<Name>Temperature</Name>
<Units name="Temperature">
<Unit>
<Name>C</Name>
</Unit>
</Units>
</ParameterDetails>
<PropertyDetails id="pr0">
<Unitless />
<Name>Color</Name>
</PropertyDetails>
<PropertyDetails id="pr1">
<Unitless />
<Name>Elasticity</Name>
</PropertyDetails>
</Metadata>
</MatML_Doc>
</Materials>
<ANSYSWBTransferData>
<Materials>
<Material>
<Name>Isotropic Test Material</Name>
<DataTransferID></DataTransferID>
</Material>
</Materials>
</ANSYSWBTransferData>
</EngineeringData>
36 changes: 36 additions & 0 deletions examples/trial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from pathlib import Path

from ansys.materials.manager._models.material import Material
from ansys.materials.manager.util.matml.matml_from_material import MatmlWriter
from ansys.materials.manager.util.matml.matml_parser import MatmlReader
from ansys.materials.manager.util.matml.matml_to_material import convert_matml_materials


def _add_library(materials_database: dict[str, Material], material_dic: dict[str, Material]):
for material in material_dic.values():
if material.name in materials_database:
raise Exception(
(
f"The materials were not added to the library as {material.name}",
"is already present.",
)
)
materials_database |= material_dic
return materials_database


material_database = {}
parsed_data = MatmlReader.parse_from_file(
str(Path.cwd() / "examples" / "data" / "MatML_unittest_density.xml")
)
materials = convert_matml_materials(
{k: v["material"] for k, v in parsed_data.items()},
{k: v["transfer_id"] for k, v in parsed_data.items()},
0,
)
material_dic = {material.name: material for material in materials}
material_database = _add_library(material_database, material_dic)
print(material_database)
export_data = Path.cwd() / "test_export.xml"
writer = MatmlWriter(material_database.values())
writer.export(str(export_data), indent=True)
Loading