jam4375 / plasmatic-cpp

Multiphysics Finite Element Simulation
GNU General Public License v2.0
0 stars 0 forks source link
finite-element-method mechanical multiphysics simulation thermal

plasmatic

Multiphysics finite element simulation code mostly written with C++ using PETSc and Eigen for linear algebra. Plasmatic is capable of thermal and mechanical simulation in 2D and 3D. It reads input mesh geometry in the Gmsh file format and outputs results in the VTK file format for visualization in ParaView.

Building

Use the following commands to build the code: (replace <NUM_CORES> with the number of CPU cores on your machine)

git clone git@github.com:jam4375/plasmatic-cpp.git
cd plasmatic-cpp
mkdir build
cd build
cmake ..
make -j <NUM_CORES>

Building & Viewing Documentation

make plasmatic_docs
open docs/index.html

Running Tests

cd <REPO_ROOT>/build
ctest -j <NUM_CORES>

Running a Mechanical Simulation

Run the following command to start a mechanical simulation. The output will be written to the file mechanical.vtk in the same directory and can be viewed with ParaView.

cd build/bin
./plasmatic -i mechanical.json

where mechanical.json contains input configuration similar to below:

{
  "command": "run_mechanical_sim",
  "mesh_filepath": "assets/ProblemTypes/mesh3d_quadratic.msh",
  "youngs_modulus": 69.0e9,
  "poisson_ratio": 0.32,
  "displacement_bcs": [{ "surface_name": "fixed", "value": [0.0, 0.0, 0.0] }],
  "traction_bcs": [{ "surface_name": "load", "value": [0.0, -100.0, 0.0] }],
  "output_file": "mechanical"
}