Skip to main content

Computational Adjoint-Based Shape Optimization and Optimal Control Software

Project description

https://raw.githubusercontent.com/sblauth/cashocs/master/logo.png https://img.shields.io/pypi/v/cashocs https://img.shields.io/conda/vn/conda-forge/cashocs https://img.shields.io/pypi/pyversions/cashocs https://img.shields.io/badge/DOI-10.5281%2Fzenodo.4035939-blue https://img.shields.io/pypi/l/cashocs?color=informational https://img.shields.io/pypi/dm/cashocs?color=informational

https://img.shields.io/github/workflow/status/sblauth/cashocs/ci?label=tests https://img.shields.io/codecov/c/gh/sblauth/cashocs?color=brightgreen https://img.shields.io/lgtm/grade/python/github/sblauth/cashocs https://readthedocs.org/projects/cashocs/badge/?version=latest https://img.shields.io/badge/code%20style-black-000000.svg

CASHOCS is a computational adjoint-based shape optimization and optimal control software for python.

CASHOCS is based on the finite element package FEniCS and uses its high-level unified form language UFL to treat general PDE constrained optimization problems, in particular, shape optimization and optimal control problems.

Note, that we assume that you are (at least somewhat) familiar with PDE constrained optimization and FEniCS. For a introduction to these topics, we can recommend the textbooks

However, the CASHOCS tutorial also gives many references either to the underlying theory of PDE constrained optimization or to relevant demos and documentation of FEniCS.

An overview over CASHOCS and its capabilities can be found in Blauth, cashocs: A Computational, Adjoint-Based Shape Optimization and Optimal Control Software. Moreover, note that the full CASHOCS documentation is available at https://cashocs.readthedocs.io/en/latest/index.html.

Installation

Via conda-forge

CASHOCS is available via the anaconda package manager, and you can install it with

conda install -c conda-forge cashocs

Alternatively, you might want to create a new, clean conda environment with the command

conda create -n <ENV_NAME> -c conda-forge cashocs

where <ENV_NAME> is the desired name of the new environment.

Manual Installation

  • First, install FEniCS, version 2019.1. Note, that FEniCS should be compiled with PETSc and petsc4py.

  • Then, install meshio, with a h5py version that matches the HDF5 version used in FEniCS, and matplotlib. The version of meshio should be at least 4, but for compatibility it is recommended to use meshio 4.4.

  • You might also want to install Gmsh, version 4.8. CASHOCS does not necessarily need this to work properly, but it is required for the remeshing functionality.

  • You can install CASHOCS via the PYPI:

    pip3 install cashocs

    You can install the newest (development) version of CASHOCS with:

    pip3 install git+https://github.com/sblauth/cashocs.git
  • To get the latest (development) version of CASHOCS, clone this repository with git and install it with pip

    git clone https://github.com/sblauth/cashocs.git
    cd cashocs
    pip3 install .

Usage

The complete CASHOCS documentation is available here https://cashocs.readthedocs.io/en/latest/index.html. For a detailed introduction, see the CASHOCS tutorial. The python source code for the demo programs is located inside the “demos” folder.

Citing

If you use cashocs for your research, I would be grateful if you would cite the following paper

cashocs: A Computational, Adjoint-Based Shape Optimization and Optimal Control Software
Sebastian Blauth
SoftwareX, Volume 13, 2021
https://doi.org/10.1016/j.softx.2020.100646

Additionally, if you are using the nonlinear conjugate gradient methods for shape optimization implemented in cashocs, please cite the following paper

Nonlinear Conjugate Gradient Methods for PDE Constrained Shape Optimization Based on Steklov--Poincaré-Type Metrics
Sebastian Blauth
SIAM Journal on Optimization, Volume 31, Issue 3, 2021
https://doi.org/10.1137/20M1367738

If you are using BibTeX, you can use the following entries:

@Article{Blauth2021cashocs,
  author   = {Sebastian Blauth},
  journal  = {SoftwareX},
  title    = {{cashocs: A Computational, Adjoint-Based Shape Optimization and Optimal Control Software}},
  year     = {2021},
  issn     = {2352-7110},
  pages    = {100646},
  volume   = {13},
  doi      = {https://doi.org/10.1016/j.softx.2020.100646},
  keywords = {PDE constrained optimization, Adjoint approach, Shape optimization, Optimal control},
}

as well as

@Article{Blauth2021Nonlinear,
        author   = {Sebastian Blauth},
        journal  = {SIAM J. Optim.},
        title    = {{N}onlinear {C}onjugate {G}radient {M}ethods for {PDE} {C}onstrained {S}hape {O}ptimization {B}ased on {S}teklov-{P}oincaré-{T}ype {M}etrics},
        year     = {2021},
        number   = {3},
        pages    = {1658--1689},
        volume   = {31},
        doi      = {10.1137/20M1367738},
        fjournal = {SIAM Journal on Optimization},
}

License

CASHOCS is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CASHOCS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CASHOCS. If not, see https://www.gnu.org/licenses/.

Contact / About

I’m Sebastian Blauth, a scientific employee at Fraunhofer ITWM. I have developed this project as part of my PhD thesis. If you have any questions / suggestions / feedback, etc., you can contact me via sebastian.blauth@itwm.fraunhofer.de or sebastianblauth@web.de.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

cashocs-1.5.0.tar.gz (123.2 kB view details)

Uploaded Source

Built Distribution

cashocs-1.5.0-py3-none-any.whl (175.3 kB view details)

Uploaded Python 3

File details

Details for the file cashocs-1.5.0.tar.gz.

File metadata

  • Download URL: cashocs-1.5.0.tar.gz
  • Upload date:
  • Size: 123.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for cashocs-1.5.0.tar.gz
Algorithm Hash digest
SHA256 475d4e6ec63b2e278a6a0a2e85e0e1e369f3796525a5981c347b6a3de626a27f
MD5 30649d651fbf25408a8915052ef645d9
BLAKE2b-256 826d3a3c612dd8a3b1cbdd0af244f721d7cf426b66f86dbdc5e30f69045b01a6

See more details on using hashes here.

File details

Details for the file cashocs-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: cashocs-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 175.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for cashocs-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 221136eb04b725b81981f005849a1d12b5af3acacda2057288dda73dab0bf5c8
MD5 06025cac5dc84e3c9244f6cfd3bf06eb
BLAKE2b-256 9817b7b3a3e1ceb5eeb2b00d5f9d8dd5be9581811ba83c7116601f1b3e459bfe

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