Giter VIP home page Giter VIP logo

pyiron_continuum's Introduction

pyiron_continuum

License Coverage Status

Anaconda Last Updated Platform Downloads

pyiron_continuum's People

Contributors

ahmed-aslam avatar dependabot-preview[bot] avatar dependabot[bot] avatar github-actions[bot] avatar jan-janssen avatar liamhuber avatar max-hassani avatar mbruns91 avatar niklassiemer avatar pyiron-runner avatar raynol-dsouza avatar samwaseda avatar srmnitc avatar tara-lakshmipathy avatar tushar-jogi avatar yangbai90 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyiron_continuum's Issues

Requiring notebooks tests and env fulfillment

@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.

  1. Are you ok with this rule? It's a matter of a couple clicks to turn it off, so I turned it on unilaterally
  2. @samwaseda and I already missed one env location... can someone double check we didn't make further mistakes in the dependency handling in #317?

Using input datacontainer for the refactored attributes in damask job

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(...)

There should not be a mixture of property setters and functions in damask

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.

`DataContainer` in damask jobs

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.

Coverage too low

Currently the coverage stands somewhere around 50 - 60%. I guess there are the following reasons:

  • There are too few packages in environment.yml -> many of the functionalities cannot be tested
  • Some classes are simply not well covered. From what I can see the main suspects are:
  • Many functionalities are repeated in the job classes and in project.py as well as toolkit.py
    • Automatic population of 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!!

damask unittest

Some unittest should be added for the new damask job. I just wanted to document this here.

[Enhancement] Support more continuum-scale codes

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

  • kanapy, synthetic microstructures from statistics on experimental data
  • openphase (academic) phase-field code. can be used for grain front tracking, phase transformations and alike. There should already be some work on this. What is the state here?

After running damask job, the working directory changes

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?

Implement proper restart in damask

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.

Add visualisation

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:

  • plotly (example in the next comment)
  • PyVista (already part of dependencies)
  • paraview

Creator, Setter etc. on Project and Job

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:

  • it makes no sense to overcrowd pr.create with items which anyway can be used only for small number of jobs
  • I find it counterintuitive that a property in my job should come from pr

But I would be also interested to know your opinions about it.

Migration of fenics to pyiron_continuum

======================================================================
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'

pyvista visualization

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.

[Decision] New FEM code(s) to integrate

replace 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

Add binder button for PRs

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).

mpi4py trouble after updating dependencies

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.

[Enhancement] Grid import/export method

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/...)

Dependabot?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.