pyiron / pyiron_continuum Goto Github PK
View Code? Open in Web Editor NEWpyiron_continuum - additional modules for the pyiron IDE supporting continuum scale simulations and workflows
License: BSD 3-Clause "New" or "Revised" License
pyiron_continuum - additional modules for the pyiron IDE supporting continuum scale simulations and workflows
License: BSD 3-Clause "New" or "Revised" License
@samwaseda and @mbruns91, after approval I merged #317, which had all tests passing. Unfortunately, both Sam and I failed to remember to run the notebook tests, and these failed when they ran on merge.
Since these tests are quite expensive, I understand the rationale for having them only run when the label is applied -- one doesn't necessarily want to burn compute running them on every commit. However, since it's far to easy to forget them, I've now added the a requirement the the main
protection rules that this test be passing before merging is allowed.
I've got a patching PR here that adds the dependency to the other env file, and it looks like it's blocking things correctly as the test is running and the merge button is deactivated for me citing the rule.
Currently we use
pr.continuum.damask.Homogenization(...)
# or
pr.continuum.damask.Elasticity(...)
#or
pr.continuum.damask.Plasticity(...)
it would be better to change it to:
job.input.elasticity(...)
job.input.plasticity(...)
job.input.homogenization(...)
I can assume that to_hdf(), and from_hdf() might be an issue in the above case, if it is the case, we can use:
job.elasticity(...)
job.plasticity(...)
job.homogenization(...)
Currently, some input parameters in damask are passed via property setters, such as job.grid
, job.material
etc. and others are passed via functions, such as job.rolling_parameters()
. I understand that the distinction is done between functionalities implemented in damask and the ones created in pyiron, but this distinction is probably not conceptually clear to the user, so as long as there's no straightforwardly comprehensible of way of distinguishing them, they should be unified.
I guess I need to add it and then still push more commits??
Repo needs a workflow that triggers on labeled and actions to do on it, e.g. like the centralized guy
The damask job and the relevant factory.py
lack proper docstring. It is needed to be added.
I could not import these classes from the conda version of Damask
Currently pyiron does not store the damask input in the HDF5 file, but everything is contained in files. Instead of writing out files directly from functions, we should store the data in something like DataContainer
, and then write the files based on the contents of DataContainer
.
Currently the coverage stands somewhere around 50 - 60%. I guess there are the following reasons:
environment.yml
-> many of the functionalities cannot be tested
project.py
as well as toolkit.py
Creator
? Maybe @liamhuber ?pr.create.damask
and pr.continuum.damask
etc. must be unified.I personally would love to aim at something like 80%. Let's give it a try!!
Some unittest should be added for the new damask job. I just wanted to document this here.
In our latest infrastruture meeting, we had a broad discussion on this module. Among many other things, we also discussed the integration of more codes, mainly resulting from requirements coming from MatWerk's IUC07.
This includes on one side a FEM code. This is an issue on its own and is discussed in #268 . On the other side, this also includes a integration of tools for microstructure generation and spatio-temporal description. Therefor, we plan to integrate
In the method via_voronoi_tessellation, grid_dim
should be changed to spatial_discretization
After running DAMASK job and plotting the stress-strain curve, the current working directory changes to the one from the job. I have not checked at which steps this happens, but I believe we should fix this. @Ahmed-Aslam, can you please take a look where the working directory changes?
Currently, damask job itself writes an executable for restart, but the executable should be the one that's stored in the resources folder. Since the only one difference between a normal run and restart is a single argument in the command line and an extra file, we should modify the current executable to make it be able to accept an extra command line and for the extra file, we should use the restart file list in the job.
It looks to me that currently a lot of bumps are failing because there’s inconsistency with dependencies, which I think are caused by the fact that there are yml
files and setup.py
which contain packages independently. I looked into the setup.py
in pyiron_atomistics
, which does not contain anything. Shouldn’t it be like this here as well? @jan-janssen @mbruns91
I see that pyiron_continuum
depends on pyiron
and not pyiron_base
. Shouldn’t it be like pyiron_atomistics
?
Currently there's only 2D projections in pyiron, while most of the calculations are for 3D. @jan-janssen and I talked about the following possibilities:
This line raises an error, apparently because increments[-1]
returns an integer and [10::]
doesn't make much sense. It seems to work without [10::]
, but I'm not sure if that's the right way. Can you check it? @yangbai90
I was reviving an old PR that @srmnitc had opened, and I noticed he made a nice change from pr.create
to job.create
. In general, I think:
Good:
job.my_property = job.create.my_category.my_property(**kwargs)
# or
job.set_my_property(**kwargs)
Bad:
job.my_property = pr.create.some_category.some_property(**kwargs)
because:
pr.create
with items which anyway can be used only for small number of jobsjob
should come from pr
But I would be also interested to know your opinions about it.
The damask job object does not contain any useful docstring and validate_ready_to_run
is not defined.
cf. title
As part of the Simulation Workflows in Materials Modelling (SWiMM 2021) Workshop precice is presented as a tool to couple fenics and openfoam so that might be an interesting extension for pyiron as well. The precice tutorials takes place next week Wednesday March 24th to 26th 2021 - three sessions with 45 minutes each. The workshop registration is still open in case that is interesting for you @muh-hassani , @Ahmed-Aslam and @liamhuber .
======================================================================
9
ERROR: test_page_5 (fenics.test_tutorials.TestFenicsTutorials)
10
----------------------------------------------------------------------
11
Traceback (most recent call last):
12
File "/home/runner/work/pyiron_continuum/pyiron_continuum/tests_integration/fenics/test_tutorials.py", line 35, in test_page_5
13
job = self.pr.create.job.Fenics('poisson', delete_existing_job=True)
14
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 152, in wrapper
15
return job.create(job_name=job_name, delete_existing_job=delete_existing_job)
16
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 178, in create
17
return JobType(
18
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 56, in __new__
19
job_class = cls.convert_str_to_class(
20
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 104, in convert_str_to_class
21
job_module = importlib.import_module(job_class_dict[job_class_name])
22
File "/usr/share/miniconda/envs/test/lib/python3.8/importlib/__init__.py", line 127, in import_module
23
return _bootstrap._gcd_import(name[level:], package, level)
24
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
25
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
26
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
27
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
28
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
29
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
30
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/job/generic.py", line 17, in <module>
31
from pyiron_continuum.fenics.factory import DomainFactory, BoundaryConditionFactory
32
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 64, in <module>
33
class UnitMeshFactory(PyironFactory):
34
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 67, in UnitMeshFactory
35
square.__doc__ = FEN.UnitSquareMesh.__doc__
36
AttributeError: module 'fenics' has no attribute 'UnitSquareMesh'
37
38
======================================================================
39
ERROR: test_page_6 (fenics.test_tutorials.TestFenicsTutorials)
40
----------------------------------------------------------------------
41
Traceback (most recent call last):
42
File "/home/runner/work/pyiron_continuum/pyiron_continuum/tests_integration/fenics/test_tutorials.py", line 49, in test_page_6
43
job = self.pr.create.job.Fenics('membrane', delete_existing_job=True)
44
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 152, in wrapper
45
return job.create(job_name=job_name, delete_existing_job=delete_existing_job)
46
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 178, in create
47
return JobType(
48
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 56, in __new__
49
job_class = cls.convert_str_to_class(
50
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 104, in convert_str_to_class
51
job_module = importlib.import_module(job_class_dict[job_class_name])
52
File "/usr/share/miniconda/envs/test/lib/python3.8/importlib/__init__.py", line 127, in import_module
53
return _bootstrap._gcd_import(name[level:], package, level)
54
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
55
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
56
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
57
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
58
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
59
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
60
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/job/generic.py", line 17, in <module>
61
from pyiron_continuum.fenics.factory import DomainFactory, BoundaryConditionFactory
62
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 64, in <module>
63
class UnitMeshFactory(PyironFactory):
64
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 67, in UnitMeshFactory
65
square.__doc__ = FEN.UnitSquareMesh.__doc__
66
AttributeError: module 'fenics' has no attribute 'UnitSquareMesh'
67
68
======================================================================
69
ERROR: test_page_7_gaussian (fenics.test_tutorials.TestFenicsTutorials)
70
----------------------------------------------------------------------
71
Traceback (most recent call last):
72
File "/home/runner/work/pyiron_continuum/pyiron_continuum/tests_integration/fenics/test_tutorials.py", line 89, in test_page_7_gaussian
73
job = self.pr.create.job.Fenics('gauss', delete_existing_job=True)
74
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 152, in wrapper
75
return job.create(job_name=job_name, delete_existing_job=delete_existing_job)
76
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 178, in create
77
return JobType(
78
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 56, in __new__
79
job_class = cls.convert_str_to_class(
80
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 104, in convert_str_to_class
81
job_module = importlib.import_module(job_class_dict[job_class_name])
82
File "/usr/share/miniconda/envs/test/lib/python3.8/importlib/__init__.py", line 127, in import_module
83
return _bootstrap._gcd_import(name[level:], package, level)
84
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
85
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
86
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
87
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
88
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
89
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
90
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/job/generic.py", line 17, in <module>
91
from pyiron_continuum.fenics.factory import DomainFactory, BoundaryConditionFactory
92
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 64, in <module>
93
class UnitMeshFactory(PyironFactory):
94
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 67, in UnitMeshFactory
95
square.__doc__ = FEN.UnitSquareMesh.__doc__
96
AttributeError: module 'fenics' has no attribute 'UnitSquareMesh'
97
98
======================================================================
99
ERROR: test_page_7_heat (fenics.test_tutorials.TestFenicsTutorials)
100
----------------------------------------------------------------------
101
Traceback (most recent call last):
102
File "/home/runner/work/pyiron_continuum/pyiron_continuum/tests_integration/fenics/test_tutorials.py", line 65, in test_page_7_heat
103
job = self.pr.create.job.Fenics('heat', delete_existing_job=True)
104
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 152, in wrapper
105
return job.create(job_name=job_name, delete_existing_job=delete_existing_job)
106
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 178, in create
107
return JobType(
108
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 56, in __new__
109
job_class = cls.convert_str_to_class(
110
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 104, in convert_str_to_class
111
job_module = importlib.import_module(job_class_dict[job_class_name])
112
File "/usr/share/miniconda/envs/test/lib/python3.8/importlib/__init__.py", line 127, in import_module
113
return _bootstrap._gcd_import(name[level:], package, level)
114
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
115
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
116
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
117
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
118
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
119
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
120
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/job/generic.py", line 17, in <module>
121
from pyiron_continuum.fenics.factory import DomainFactory, BoundaryConditionFactory
122
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 64, in <module>
123
class UnitMeshFactory(PyironFactory):
124
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 67, in UnitMeshFactory
125
square.__doc__ = FEN.UnitSquareMesh.__doc__
126
AttributeError: module 'fenics' has no attribute 'UnitSquareMesh'
127
128
======================================================================
129
ERROR: test_page_8 (fenics.test_tutorials.TestFenicsTutorials)
130
----------------------------------------------------------------------
131
Traceback (most recent call last):
132
File "/home/runner/work/pyiron_continuum/pyiron_continuum/tests_integration/fenics/test_tutorials.py", line 110, in test_page_8
133
job = self.pr.create.job.Fenics('poisson_nonlinear', delete_existing_job=True)
134
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 152, in wrapper
135
return job.create(job_name=job_name, delete_existing_job=delete_existing_job)
136
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 178, in create
137
return JobType(
138
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 56, in __new__
139
job_class = cls.convert_str_to_class(
140
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 104, in convert_str_to_class
141
job_module = importlib.import_module(job_class_dict[job_class_name])
142
File "/usr/share/miniconda/envs/test/lib/python3.8/importlib/__init__.py", line 127, in import_module
143
return _bootstrap._gcd_import(name[level:], package, level)
144
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
145
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
146
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
147
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
148
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
149
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
150
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/job/generic.py", line 17, in <module>
151
from pyiron_continuum.fenics.factory import DomainFactory, BoundaryConditionFactory
152
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 64, in <module>
153
class UnitMeshFactory(PyironFactory):
154
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 67, in UnitMeshFactory
155
square.__doc__ = FEN.UnitSquareMesh.__doc__
156
AttributeError: module 'fenics' has no attribute 'UnitSquareMesh'
157
158
======================================================================
159
ERROR: test_page_9 (fenics.test_tutorials.TestFenicsTutorials)
160
----------------------------------------------------------------------
161
Traceback (most recent call last):
162
File "/home/runner/work/pyiron_continuum/pyiron_continuum/tests_integration/fenics/test_tutorials.py", line 146, in test_page_9
163
job = self.pr.create.job.FenicsLinearElastic('linear_elasticity', delete_existing_job=True)
164
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 152, in wrapper
165
return job.create(job_name=job_name, delete_existing_job=delete_existing_job)
166
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 178, in create
167
return JobType(
168
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 56, in __new__
169
job_class = cls.convert_str_to_class(
170
File "/usr/share/miniconda/envs/test/lib/python3.8/site-packages/pyiron_base/job/jobtype.py", line 104, in convert_str_to_class
171
job_module = importlib.import_module(job_class_dict[job_class_name])
172
File "/usr/share/miniconda/envs/test/lib/python3.8/importlib/__init__.py", line 127, in import_module
173
return _bootstrap._gcd_import(name[level:], package, level)
174
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
175
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
176
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
177
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
178
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
179
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
180
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/job/elastic.py", line 9, in <module>
181
from pyiron_continuum.fenics.job.generic import Fenics
182
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/job/generic.py", line 17, in <module>
183
from pyiron_continuum.fenics.factory import DomainFactory, BoundaryConditionFactory
184
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 64, in <module>
185
class UnitMeshFactory(PyironFactory):
186
File "/home/runner/work/pyiron_continuum/pyiron_continuum/pyiron_continuum/fenics/factory.py", line 67, in UnitMeshFactory
187
square.__doc__ = FEN.UnitSquareMesh.__doc__
188
AttributeError: module 'fenics' has no attribute 'UnitSquareMesh'
This is to not forget some comments made by @liamhuber in #262 .
In general, we should try to migrate the CI to make as much use of our centralized actions as possible.
Both fenics and damask can export their output to vtk files. We can use pyvista in pyiron_continuum to have interactive visualizations based on the data (stress, strain, temperature, etc) or timesteps. Such visaulization can be found in here, at the end of the notebook.
fenics
Our current support for fenics
is relying on a fairly outdated package. Moreover the fenics
code itself is not actively maintained anymore, so we have to decide on a new FEM "engine". Candidates identified in our last infrastruture meeting
dolfinx
: framework for fenicsx
(fenics
successor) -> @Tara-Lakshmipathy already works on the integration. Also, have a look at the tutorialelmerFEM
, e.g. used here.I just ran this notebook and realized that the zz-component of the stress apparently goes beyond the yield stress. Is that what is supposed to happen?
In the meeting this morning we discussed having a binder button available on each individual PR, but I couldn't remember how I had configured it.
Turns out it's all configured in pyiron/actions, so you can leverage it by just adding a call to the reusable workflow in .github/workflows
in this repo, just like in the module template (also the same in pyiron_workflow, etc).
I recently updated my local pyiron development env, and suddenly had trouble importing pyiron_continuum
. In particular, the dolfin
import "from dolfin.fem.form import Form
" gave an error "ValueError: mpi4py.MPI.Datatype size changed, may indicate binary incompatibility. Expected 32 from C header, got 24 from PyObject
".
I guess I had previously run into trouble with mpi4py
, because I had my version pinned at the out-of-date 3.0.3, exactly as suggested here on the fenics
boards.
I still have basically no understanding of the underlying cause of this -- maybe some interaction with an h5py update? But simply updating mpi4py
to 3.1.3 resolved the issue for me.
I just wanted to quickly make a note of this here so it's searchable in case anyone else runs into it.
I get a ModuleNotFoundError
for import fenics as FEN
when I try to import pyiron_continuum
In our latest infrastruture meeting, we had a broad discussion on this module. Among many other things, we also had the idea of introducing a grid concept, allowing to import and export grids/meshes from supported codes and facilitate better interoperibility of the codes.
(This issue is mainly opened to keep this information/idea stored somewhere. Feel free to move/rephrase/discuss/...)
Atomistics and experimental both have dependabot PRs updating base from 0.3.2 to 0.3.4 but I don't see that here -- is dependabot missing for continuum or just slow? If missing is someone willing to set it up?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.