Skip to main content

Identifies Crystal Plasticity (CP) parameters by inverse analysis based on CPFEM simulations performed using PRISMS-Plasticity

Project description

OptiPRISMS PyPI - Downloads PyPI GitHub

Perform inverse analysis to retrieve Crystal Plasticity parameters used for CPFEM simulation through the PRISMS-Plasticity software [1]. This inverse analysis is done using data from in situ tensile tests and Scanning Electron Microscopy Digital Image Correlation (SEM-DIC).

How it works

This program will optimize CP parameters in order to minimize a given cost function. At each step of the optimization process, it will:

  1. generate configuration files for PRISMS-Plasticity;
  2. run PRISMS-Plasticity from these files;
  3. read results and compare them against experimental data;
  4. return a cost function, evidencing how far the simulation is, compared to the experiment,
  5. remove simulation files.

In order to generate the PRISMS configuration files, this software will parse template files in order to retrieve which parameters it shall optimize.

Records for each optimization loop will be stored in a log file, so that the user can track the evolution of optimized parameters and cost functions. In addition, OptiPRISMS will use this file to avoid reruning preexisting simulations, so that the optimization can be stopped then resumed.

Full description of the algorithm is provided in [2].

Required materials

  • The mesh of the microstructure (in .msh format). One can use MTEX2Gmsh [3] to generate a conforming mesh directly from EBSD data.
  • PRISMS-Plasticity software.
  • Python 3.6 (or later) with the following modules: numpy, scipy, vtk, pandas and optimparallel (optional).
  • Experimental data, consisting in:
    • a macroscopic tensile curve (strain-stress values as a CSV file),
    • SEM-DIC displacement measurements, stored as individual CSV files named sequentially (eg. "DIC_1.csv", "DIC_2.csv" and so on).

Each of these files must have tabular data, ordered this way:

  1. x coordinates of DIC points where DIC measurements are performed,
  2. y coordinates of DIC points where DIC measurements are performed,
  3. x displacements,
  4. y displacements,
  5. correlation coefficients (optional, see Cost Function section)

Cite this project

If you use this project, please cite ref. [2]. You can use the following BibTeX entry:

@article{OptiPRISMS,
title = {Crystal Plasticity simulations of in situ tensile tests: A two-step inverse method for identification of CP parameters, and assessment of CPFEM capabilities},
journal = {International Journal of Plasticity},
pages = {103695},
year = {2023},
issn = {0749-6419},
doi = {https://doi.org/10.1016/j.ijplas.2023.103695},
url = {https://www.sciencedirect.com/science/article/pii/S074964192300181X},
author = {D. Depriester and J.P. Goulmy and L. Barrallier},
}

Installation

You can install the latest release of OptiPRISMS with pip:

pip install OptiPRISMS

Otherwise, you can install the development version from sources:

git clone https://github.com/DorianDepriester/OptiPRISMS.git
cd OptiPRISMS
pip install --editable .

Step-by-step method to run optimization

  1. Create template files. They consist in usual configuration files (see here for details), where every value you want to optimize is given a variable name. These names must be precessed by a dollar symbol ($, e.g. $a instead of a).
  2. Edit the configuration file to tune optimization-related parameters (see below for details or check out the example folder).
  3. With Python3, run the optimize function from OptiPRISMS module. E.g.:
from OptiPRISMS import optimize
res = optimize(config_file='myConfigFile.ini')
  1. Then, wait a couple of days (or weeks...).

In the meantime, you can track the progress of optimization by having a look on the log file.

Configuration file

This file describes locations of data and parameters for optimization. It divides in sections (some of them are mandatory, other are not). See full examples in example folder.

Mandatory sections

[Initial Guess]

Provide here starting values for the variables you want to optimize. The variables names must be consistent with these in templates for PRISMS parameter files (as detailed here).

[Bounds]

  • lower: list of lower bounds
  • upper: list of upper bounds

[PRISMS]

  • prm file: path to the main parameter file template
  • latent hardening ratio : path to latent hardening ratio template
  • path to prisms: path to PRISMS-Plasticity executable file. This entry is not required if Slurm is used (see [[Slurm]] section).

[Experimental Data]

  • DIC data: pattern describing the path to CSV files with DIC measurements (without step number nor extension). OptiPRISMS will automatically append the step number and the CSV extension to this pattern. For instance, if one wants to use files DIC_1.csv and DIC_2.csv, this parameter should be set to DIC_.
  • DIC time steps (optional): increment numbers corresponding to each step of DIC measurements. If not set, they will be inferred from option set Tabular Time Output Table in prm file.
  • tensile curve: path to strain-stress values of tensile curve
  • tensile direction (optional): Direction of measured stress and strain. It can be x or y. The default value is x.

[Cost Function]

  • weight on tensile curve: weight to apply to the tensile curve in the overall cost function
  • penalty: penalty value to raise if the simulation fails
  • weight by correlation coefficients: if enabled, the kinematic cost function will weight the displacement errors by the inverse of the correlation coefficients. The latter will be read from the 6th column of the DIC CSV files (as detailed in Required Materials section)

[Log File]

  • file path: path to log file

Optional sections

[Minimize]

Pass here any optional parameter(s) for the options argument of scipy.optimize.minimize. See the options for scipy.optimize.minimize with L-BFGS-B method for available arguments.

[Minimize parallel]

This section allows to use a parallel implementation of the L-BFGS-B minimizer [3], through the minimize_parallel function (from optimparallel module).

  • use parallel minimizer: whether to use minimize_parallel, instead of scipy.optimize.minimize (default is No)

In addition, any keyword argument normally passed to the parallel option of minimize_parallel can be defined in this section. See the related documentation for available options.

[Slurm]

  • use Slurm: whether to use the Slurm workload manager. Default is No.
  • batch file: path to batch file to use for submitting a job running PRISMS-Plasticity. The path to the prm file will be passed as the first argument of this script.

[Debug]

  • fake simulations: If Yes, each simulation is not computed. The related commands are printed instead. Default is No.
  • fake deletions: Turn off automatic removal of simulation results (step 5 in How it works section). Default is No.

References

[1] Yaghoobi et al., (2019). Prisms-plasticity: An open-source crystal plasticity finite element software. Computational Materials Science, 169:109078, https://doi.org/10.1016/j.commatsci.2019.109078

[2] Depriester et al., (2023). Crystal Plasticity Simulations of in Situ Tensile Tests: A Two-Step Inverse Method for Identification of CP Parameters, and Assessment of CPFEM Capabilities. International Journal of Plasticity, https://doi.org/10.1016/j.ijplas.2023.103695

[3] Depriester et al., (2020). MTEX2Gmsh: a tool for generating 2D meshes from EBSD data. Journal of Open Source Software, 5(52):2094, https://doi.org/10.21105/joss.02094

[4] Gerber, F. and Furrer, R. (2019). optimParallel: An R package providing a parallel version of the L-BFGS-B optimization method, The R Journal, 11(1):352–358, http://doi.org/10.32614/RJ-2019-030

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

OptiPRISMS-1.1.1.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

OptiPRISMS-1.1.1-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file OptiPRISMS-1.1.1.tar.gz.

File metadata

  • Download URL: OptiPRISMS-1.1.1.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for OptiPRISMS-1.1.1.tar.gz
Algorithm Hash digest
SHA256 f49cdaaef286789146cf2f07cec87ec58bd7de2db1f3ceddc3a9baf522235fc5
MD5 f8e9de7763d20ec05f194930ae1ba84e
BLAKE2b-256 a8fa2322fc0ccf54e840a8c4dfa5797771939348ca76c3e48bb4476424c357a2

See more details on using hashes here.

File details

Details for the file OptiPRISMS-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: OptiPRISMS-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.17

File hashes

Hashes for OptiPRISMS-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cbc40e7650bce6edd4444b8d2d73956cd2bb4b72a9b3bc2050ab9656b90745b6
MD5 e83c1bb4935dc548021da08b16a50ea5
BLAKE2b-256 f20d80fe1530670c6e389bfcf23148c7a815f6c0852b94c80e0f91b24e890ae2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page