Giter VIP home page Giter VIP logo

mfkiwl / peripydic Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lm2-poly/peripydic

1.0 1.0 0.0 11.34 MB

Peridynamics (PD) computations for state-based PD in 1D, 2D for elastic and viscoelastic materials. Also possible to import Digital Image Correlation results and compute PD forces for each pixel as a node.

Home Page: https://lm2-poly.github.io/PeriPyDIC/

License: GNU General Public License v3.0

Python 98.63% Shell 1.35% Batchfile 0.02%

peripydic's Introduction

Basic Usage

from peripydic import *

deck = PD_deck("./input_elas_1D.yaml")
problem = PD_problem(deck)

The problem

Consider a 1D bar. The length of the bar and the number of sections in which the bar will be divided (the Peridynamic (PD) nodes are at the edges of each section) are provided by the user.

A ramp loading is applied at the edges of the bar. The user provides the number of seconds after which the ramp reaches a maximal force value and remains there. Additional blocks are added at the edges of the block in order to apply the load. The number of blocks added at each edge of the bar is provided as the Horizon Factor. The user also provides the total duration of the simulation and the total number of time steps desired.

The problem is then solved using an initial guess vector and the Newton-Krylov algorithm provided in the scipy.optimize package.

Getting started

Dependencies

The following python packages are required:

  • numpy
  • pyyaml
  • scipy.optimize
  • sharedmem

The following tools are optional

  • doxygen
  • dot

Installation

virtualenv pddic
source pddic/binactivate
pip install -r requirements.txt
python setup.py install

Testing

cd tools
./run_tests_1D.sh 
./run_tests_2D.sh

Usage

python pd_dic.py -i input.yaml -t pd   

Where -i has to be the configuration in yaml format and -t is the type, which can be pd for peridynamic simulations and dic for processing results from digital image correlation.

Input description

Material

The material parameters are described here

Material:
    Type: Elastic
    E_Modulus: 4000.0

The available Type are until now Elastic and Viscoelastic.

Geometry

The discretization and the nodes are described with

Discretization:
    Dim: 1
    Final_Time: 2.0
    Time_Steps: 8
    Horizon_Factor_m_value: 1.0
    Influence_Function: 1.0
    Saftety_Factor: 1.001
    File:
        Name: geometry_dx0_50.csv
        Path: ./
        Type: mudic

where Dim is the dimension of the node cloud, Final_Time the end time of the simulation, Time_Steps the amount of time steps, Horizon_Factor_m_value the m value of the horizon, Influence_Function the factor to scale the influence of the force with respect to the distance of the horizon and Saftety_Factor influences the computation of the horizon, and Name the file providing the node information in the CSV format with spaces as delimiter. The path is the path to the file in the file system. The Type describes if the CSV file was exported by mudic or vic3d. An example for this file is provided here:

#id x y z volume
0 0.0 0.0 0.0 1.0
1 1.0 1.0 1.0 1.0

The shape for the load is given here

 Shape:
        Type: Ramp
        Values:
            - 1.5
            - 2.0
            - 2.0

where Type describes the shape and Values specify the geometry of the shape.

Boundary Conditions

Boundary conditions can be described with

Boundary:
    Condition:
        Type:
            - Force or Displacement
        Value:
            - Float
        Direction:
            - Int
        File:
            - file.csv

where the Type either can be Force or Displacement, Value describes the value in Newton or Millimeter whis is applied at the nodes described in File, and Direction describes the direction (X=1,Y=2,Z=3) where the condition is applied. The file has to be provided in the CSV format with spaces as delimiter with the id of the nodes where the condition should be applied. Here, is an example for a file.csv

#id
0
1

Output

For writing simulation attributes the Output tag can be used.

CSV

For writing the simulation attributes to the CSV format the tag CSV is used.

Output:
    CSV:
        Type:
            - Position
        File:
            - nodes_positions.csv

Where Type specifies the attribute and File the file name of the output file.

VTK

For writing the simulation attributes to the VTK unstructured grid format the tag VTK is used

VTK:
    Path: ./
    Type:
    - Displacement
    - Neighbors
    - Force
    - Conditions
    - Volume_Force
    - Strain
Slice: 1

Where Path is the path for the output, Type specify the simulation attributes, which are considered for the output, and Slice defines that every n-th time step is written.

Solver

Here, Max_Iteration, Tolerance of the solver can be specified. With Jacobian_Perturbation the perturbation for assembly the Jacobian matrix is defined.

Solver:
    Max_Iteration: 100
    Tolerance: 1.0e-6
    Jacobian_Perturbation: 1.0e-6

Parallel computing

For using multiple threads with multiprocessing specify the number of threads with Threads.

Parallel:
    Threads: 2

Examples

An example for an elastic material and an viscoelastic material is provided in the example folder

Publications

  • Delorme, R., Tabiai, I., Laberge Lebel, L., & Lévesque, M. (2017). Generalization of the ordinary state-based peridynamic model for isotropic linear viscoelasticity. Mechanics of Time-Dependent Materials., Mechanics of Time-Dependent Materials, 1-27, 10.1007/s11043-017-9342-3,
  • Rolland Delorme, Patrick Diehl, Ilyass Tabiai, Louis Laberge Lebel, and Martin Lévesque. Extracting constitutive mechanical parameters in linear elasticity using the virtual fields method within the ordinary state-based peridynamic framework. Journal of Peridynamics and Nonlocal Modeling, Jan 2020. Link, Preprint

License

The code is licensed under the GNU General Public License v3.0 developed by Patrick Diehl, Rolland Delorme and Ilyass Tabiai . Please cite our code with following DOI

Based on works at http://dx.doi.org/10.1016/S0022-5096(99)00029-0 and https://doi.org/10.1007/s11043-017-9342-3.

peripydic's People

Contributors

diehlpk avatar iltabiai avatar ilyasst avatar rollanddelorme avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.