Skip to content
Harshwardhan Praveen edited this page Jan 27, 2020 · 2 revisions

Introduction

The package developed here is a general-purpose tool for doing crack propagation which uses a mix of FNM (Floating Node Method) and Remeshing at its core. All the functionality and algorithms have been written and implemented in C++17 along with the linear algebra support from the package Eigen.

Setup for the code

At the time of writing, the version of Eigen used was 3.3.9 (which had the functionality for slicing). If v3.3.9 hasn't been released yet is recommended to download Eigen's dev branch from their GitLab repo (the Unstable source code in the link below or any other version of theirs which supports slicing.

http://eigen.tuxfamily.org/index.php?title=Main_Page

The folder's name should be changed to match following line in the file utilities.cpp

  #include<FOLDER-NAME/Eigen/Dense>

The FOLDER-NAME in the include statement should match the folder name for your Eigen download which should be added to the /usr/include/ which should finally be /usr/include/FOLDER-NAME in a linux system.

To compile your code one needs to have C++17. Please update your compiler accordingly. The code can be compiled with the -std=c++17 flag.

g++ -std=c++17 (input-file) -o (output-file)

Compilation

It has also been tested for O3 optimizer and for OpenMP functionality. So for a more optimized code one can compile it with

g++ -std=c++17 -fopenmp -O3 (input-file) -o (output-file)

The code can be executed as

OMP_NUM_THREADS=(number of threads) ./output-file 

where (number of threads) is the number of threads which you want to allocate for running the executable.

A Word of Caution

Note that while using operations like x = x(slice), it is possible to get errors because the () operator uses a reference to the variable and thus the above operation ends up reading and writing from the same variable causing errors.

Acknowledgements

Floating node method (FNM) is a method developed by Chen et al for modelling discontinuities in solids.

Reading csv files is taken from the following answer on Stackoverflow: https://stackoverflow.com/a/39146048

Reading from a configuration file taken from the folowing blogpost: https://www.walletfox.com/course/parseconfigfile.php

Clone this wiki locally