Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pymatlib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rahil Doshi
pymatlib
Commits
8aa69246
Commit
8aa69246
authored
2 months ago
by
Rahil Doshi
Browse files
Options
Downloads
Patches
Plain Diff
Update tests
parent
c6233b0f
No related branches found
No related tags found
No related merge requests found
Pipeline
#77224
passed
2 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/cpp/TestArrayContainer.py
+8
-2
8 additions, 2 deletions
tests/cpp/TestArrayContainer.py
tests/python/test_yaml_config.py
+2
-3
2 additions, 3 deletions
tests/python/test_yaml_config.py
with
10 additions
and
5 deletions
tests/cpp/TestArrayContainer.py
+
8
−
2
View file @
8aa69246
...
...
@@ -4,6 +4,7 @@ from importlib.resources import files
from
pystencilssfg
import
SourceFileGenerator
from
pymatlib.core.yaml_parser
import
create_alloy_from_yaml
from
pymatlib.core.codegen.interpolation_array_container
import
InterpolationArrayContainer
from
pymatlib.core.property_array_extractor
import
PropertyArrayExtractor
with
SourceFileGenerator
()
as
sfg
:
...
...
@@ -22,6 +23,11 @@ with SourceFileGenerator() as sfg:
sfg
.
generate
(
custom_container
)
yaml_path
=
files
(
'
pymatlib.data.alloys.SS304L
'
).
joinpath
(
'
SS304L.yaml
'
)
mat
=
create_alloy_from_yaml
(
yaml_path
,
u
.
center
())
arr_container
=
InterpolationArrayContainer
.
from_material
(
"
SS304L
"
,
mat
)
mat
,
temp_array
=
create_alloy_from_yaml
(
yaml_path
,
u
.
center
())
array_extractor
=
PropertyArrayExtractor
(
mat
,
temp_array
,
u
.
center
)
arr_container
=
InterpolationArrayContainer
(
"
SS304L
"
,
temp_array
,
array_extractor
.
energy_density_array
)
sfg
.
generate
(
arr_container
)
print
(
f
"
extractor.temperature_array:
{
array_extractor
.
temperature_array
}
"
)
# print(f"extractor.density_array: {array_extractor.density_array}")
print
(
f
"
extractor.specific_enthalpy_array:
{
array_extractor
.
specific_enthalpy_array
}
"
)
print
(
f
"
extractor.energy_density_array:
{
array_extractor
.
energy_density_array
}
"
)
This diff is collapsed.
Click to expand it.
tests/python/test_yaml_config.py
+
2
−
3
View file @
8aa69246
...
...
@@ -15,9 +15,9 @@ T = sp.Symbol('T')
# Get the path to the YAML file
current_file
=
Path
(
__file__
)
yaml_path
=
current_file
.
parent
.
parent
.
parent
/
"
src
"
/
"
pymatlib
"
/
"
data
"
/
"
alloys
"
/
"
SS304L
"
/
"
SS304L.yaml
"
# yaml_path = current_file.parent.parent.parent / "src" / "pymatlib" / "data" / "alloys" / "SS304L" / "SS304L_comprehensive.yaml"
# Create alloy from YAML
ss316l
=
create_alloy_from_yaml
(
yaml_path
,
T
)
ss316l
,
temp
=
create_alloy_from_yaml
(
yaml_path
,
T
)
#ss316l_1 = create_alloy_from_yaml("SS304L_1.yaml", T)
# Test various properties
...
...
@@ -48,4 +48,3 @@ print(f"Latent heat: {ss316l.latent_heat_of_fusion.evalf(T, test_temp)}")
# Test array generation for energy density
if
hasattr
(
ss316l
,
'
energy_density_array
'
):
print
(
f
"
\n
Energy Density Array Shape:
{
ss316l
.
energy_density_array
.
shape
}
"
)
print
(
f
"
Energy Density Temperature Array Shape:
{
ss316l
.
energy_density_temperature_array
.
shape
}
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment