Skip to main content

Compute Configurational Forces using a fast C-Extension

Project description

Readme

conforce

Documentation Status

ConForce is a Python package and Abaqus plug-in for the computation of configurational (material) forces. The computation is automatically generated and compiled from symbolic calculations into C code. A C binding allows access to the C functions from Python. This makes ConForce fast enough to compute an entire finite element model with several thousand elements within a few seconds.

ConForce features:

  • the computation of the following quantities for common 2D and 3D elements:
    • static configurational forces
    • static configurational stresses
    • first Piola-Kirchhoff stresses
    • deformation gradients
  • two formulations for the configurational stresses and forces:
    • motion based formulation (Eshebly's formulation)
    • displacement based formulation
  • material models:
    • non-linear elasticity in the large strain framework
    • small-strain plasticity
  • material orientations: The stresses and displacements are automatically rotated to the global coordinate system.

Supported Operating Systems:

  • Windows (64-bit)
  • CentOS (64-bit)
  • other Linux distributions might work

ConForce is available as:

  • Python 3 package
  • Abaqus plug-in

Python 3 Package

The Python package requires Python 3 and contains:

  • methods to compute configurational forces, stresses, ...
  • methods for the symbolic computation and code generation

Installation

PyPi

We recommend to install the latest stable version from PyPi.

pip install conforce

Remote Repository

The (unstable) development version of ConForce can be installed from our remote repository.

  1. Download and unzip the ConForce repository.

  2. Open a shell in the unzipped folder where the setup.py file is located.

  3. Install ConForce by typing the following commands into the shell

    pip install "."
    

    In order to run examples or build the documentation, additional packages are required. The following options are available.

    • Install requirements for the examples:
      pip install ".[examples]"
      
    • Install requirements to build the documentation
      pip install ".[doc]"
      
    • Install all requirements
      pip install ".[examples, doc]"
      
  4. To uninstall the package, type:

    pip uninstall conforce
    

If git is available, the package can be installed directly from the remote repository by

pip install "conforce[examples, doc] @ git+https://github.com/mrettl/conforce"

The extras examples and doc are optional.

Usage

Configurational forces are computed using the cf_c module. The energy density e, the undeformed positions X, the displacement U, and the symmetric Cauchy stress tensor S are passed to the compute_CF function along with the element type and the computation method.

from conforce import cf_c

cf_c.compute_CF(
    e_at_int_points=[[10.]],
    X_at_nodes=[[
        [0., 0.],
        [1., 0.],
        [1., 1.],
        [0., 1.],
    ]],
    U_at_nodes=[[
        [0.0, 0.0],
        [0.1, 0.0],
        [0.1, 0.0],
        [0.0, 0.0],
    ]],
    S_at_int_points=[[[
        [100., 0.0],
        [0.0, 0.0]
    ]]],
    element_type="CPE4R",
    method="dbf"
)

This yields the configurational forces at the element nodes for a single CPE4R element and the displacement based formulation ("dbf"):

array([[[ 0., -5.],
        [ 0., -5.],
        [ 0.,  5.],
        [-0.,  5.]]])

Abaqus plug-in

The Abaqus plug-in contains:

  • methods to compute configurational forces, stresses, ...
  • Abaqus specific code to read and write to *.odb files
  • a GUI for the Abaqus plug-in

Supported Abaqus versions:

  • >= Abaqus 2017

Installation

Open https://github.com/mrettl/conforce/releases and download the latest zip file called conforce_plugin_{version}.zip. The zip file has the following structure:

  • conforce_plugin_{version}.zip
    • conforce
      • conforce_abq_plugin.py
      • ...

There are several possibilities in which folder the plug-in files can be stored. Decide for one of the following valid plugin-folders:

  • plugin_central_dir: This folder is defined in the environment file abaqus_v6.env. For many installations this folder is located in C:\\SIMULIA\\CAE\\plugins\\{year}. Plug-ins stored in this folder are accessible for all users.
  • current_dir\abaqus_plugins: This is the folder in which Abaqus is started. Plug-ins are only accessible if Abaqus is stared again in the same folder.

Next, unzip the downloaded files and put them in the plugin-folder you selected: The folder tree should look like:

  • plugin-folder
    • conforce
      • conforce_abq_plugin.py
      • ...

Start Abaqus and navigate in the toolbar to Plug-ins -> Conf. Force. The GUI of the plug-in should open. If no toolbar entry called Conf. Force exists, check if the plug-in is stored in the right folder for the Abaqus version you are using.

Usage

Open an *.odb file in Abaqus. Navigate in the toolbar to Plug-ins -> Conf. Force. The plug-in gui opens:

plugin gui

Click Apply to compute the requested field outputs.

Report Bugs, Ask questions

Use the github issue tracker to report bugs and troubles or to ask questions. If you like our tool, please leave a star on our Github repository.

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

conforce-1.0.5.tar.gz (3.1 MB view details)

Uploaded Source

Built Distribution

conforce-1.0.5-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file conforce-1.0.5.tar.gz.

File metadata

  • Download URL: conforce-1.0.5.tar.gz
  • Upload date:
  • Size: 3.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for conforce-1.0.5.tar.gz
Algorithm Hash digest
SHA256 0f6511c010bfbf99acfd92c29d9c5aca36140121009ff6f60abebb23b5c27025
MD5 c0a9f753e6ef052d6bd4f7715699409f
BLAKE2b-256 feb1b979b5e05facc259ae579e0a730552f7e6976faaca04e7bb8f6d525d6281

See more details on using hashes here.

File details

Details for the file conforce-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: conforce-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for conforce-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0f69d2ff229f416532d8c75731ea2d4ef93fa9c821ad04c5120a6fb59c9d1ba4
MD5 0c229b346afe653ccbe547df78f7c3fc
BLAKE2b-256 bc15881b293cb49c4fd810c2f63049372fe42097febb8e1e80e172bcfbdbefb3

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