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
3dcaa20d
Commit
3dcaa20d
authored
2 months ago
by
Rahil Doshi
Browse files
Options
Downloads
Patches
Plain Diff
Update HeatEquationKernelWithMaterial app
parent
8aa69246
No related branches found
No related tags found
No related merge requests found
Pipeline
#77225
passed
2 months ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/CodegenHeatEquationWithMaterial.cpp
+8
-1
8 additions, 1 deletion
apps/CodegenHeatEquationWithMaterial.cpp
apps/HeatEquationKernelWithMaterial.py
+7
-5
7 additions, 5 deletions
apps/HeatEquationKernelWithMaterial.py
with
15 additions
and
6 deletions
apps/CodegenHeatEquationWithMaterial.cpp
+
8
−
1
View file @
3dcaa20d
...
@@ -164,4 +164,11 @@ int main(int argc, char** argv)
...
@@ -164,4 +164,11 @@ int main(int argc, char** argv)
}
}
}
}
int
main
(
int
argc
,
char
**
argv
)
{
walberla
::
main
(
argc
,
argv
);
}
int
main
(
int
argc
,
char
**
argv
)
{
walberla
::
main
(
argc
,
argv
);
constexpr
double
E
=
8.32237831007E+09
;
constexpr
SS304L
alloy
;
const
double
result
=
alloy
.
interpolate
(
E
);
std
::
cout
<<
result
<<
std
::
endl
;
}
This diff is collapsed.
Click to expand it.
apps/HeatEquationKernelWithMaterial.py
+
7
−
5
View file @
3dcaa20d
...
@@ -7,10 +7,11 @@ from importlib.resources import files
...
@@ -7,10 +7,11 @@ from importlib.resources import files
# sys.path.append(walberla_dir)
# sys.path.append(walberla_dir)
from
pystencilssfg
import
SourceFileGenerator
from
pystencilssfg
import
SourceFileGenerator
from
sfg_walberla
import
Sweep
from
sfg_walberla
import
Sweep
from
pymatlib.data.alloys.SS304L
import
SS304L
#
from pymatlib.data.alloys.SS304L import SS304L
from
pymatlib.core.yaml_parser
import
create_alloy_from_yaml
from
pymatlib.core.yaml_parser
import
create_alloy_from_yaml
from
pymatlib.core.assignment_converter
import
assignment_converter
from
pymatlib.core.assignment_converter
import
assignment_converter
from
pymatlib.core.codegen.interpolation_array_container
import
InterpolationArrayContainer
from
pymatlib.core.codegen.interpolation_array_container
import
InterpolationArrayContainer
from
pymatlib.core.property_array_extractor
import
PropertyArrayExtractor
with
SourceFileGenerator
()
as
sfg
:
with
SourceFileGenerator
()
as
sfg
:
data_type
=
"
float64
"
# if ctx.double_accuracy else "float32"
data_type
=
"
float64
"
# if ctx.double_accuracy else "float32"
...
@@ -35,12 +36,13 @@ with SourceFileGenerator() as sfg:
...
@@ -35,12 +36,13 @@ with SourceFileGenerator() as sfg:
from
importlib.resources
import
files
from
importlib.resources
import
files
# Access the YAML file as a package resource
# Access the YAML file as a package resource
yaml_path
=
files
(
'
pymatlib.data.alloys.SS304L
'
).
joinpath
(
'
SS304L.yaml
'
)
yaml_path
=
files
(
'
pymatlib.data.alloys.SS304L
'
).
joinpath
(
'
SS304L.yaml
'
)
mat
=
create_alloy_from_yaml
(
yaml_path
,
u
.
center
())
# Create alloy and get temperature array
mat
,
temperature_array
=
create_alloy_from_yaml
(
yaml_path
,
u
.
center
())
# yaml_path_1 = files('pymatlib.data.alloys.SS304L').joinpath('SS304L_1.yaml')
# yaml_path_1 = files('pymatlib.data.alloys.SS304L').joinpath('SS304L_1.yaml')
# mat1 = create_alloy_from_yaml(yaml_path_1, u.center())
# mat1 = create_alloy_from_yaml(yaml_path_1, u.center())
# Create property extractor with the alloy and temperature array
#
arr
_container = DoubleLookupArrayContainer("SS304L",
mat
.
temperature_array,
mat.
ener
gy_density_array
)
arr
ay_extractor
=
PropertyArrayExtractor
(
mat
,
temperature_array
,
u
.
c
en
t
er
)
arr_container
=
InterpolationArrayContainer
.
from_material
(
"
SS304L
"
,
mat
)
arr_container
=
InterpolationArrayContainer
(
"
SS304L
"
,
temperature_array
,
array_extractor
.
energy_density_array
)
sfg
.
generate
(
arr_container
)
sfg
.
generate
(
arr_container
)
# arr_container = InterpolationArrayContainer.from_material("SS304L_1", mat1)
# arr_container = InterpolationArrayContainer.from_material("SS304L_1", mat1)
# sfg.generate(arr_container)
# sfg.generate(arr_container)
...
...
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