Git Product home page Git Product logo

peridynamics.jl's Introduction

๐Ÿ‘‹ Hi, Iโ€™m Kai Partmann

๐ŸŽ“ Iโ€™m a mechanical engineer and PhD candidate working in the field of peridynamics, fracture mechanics and FEM

peridynamics.jl's People

Contributors

dependabot[bot] avatar kaipartmann avatar mdienst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

peridynamics.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Developer documentation

Add documentation for developers with instructions how to implement new material models and how to use the interfaces.

Private API

Add docstrings to all functions and specify if a function is not part of the public API.

HPC suitability

Current approach

The bottleneck of Peridynamics simulations lies in the computation of the force density b_int (see the compute_forcedensity! methods). In the serial case, this computation looks similar to the following code:

for (i,j) in bonds
    results = some_calculation()
    b_int[:,i] += results # contribution for point i
    b_int[:,j] -= results # contribution for point j
end

Since the computation writes into columns i and j of the b_int matrix, it cannot be easily parallelized. Therefore, the force density is extended by one dimension, and each thread operates on its own 2D matrix. Finally, all the results are summed up into the first column efficiently. Currently, this and other computations are implemented using Threads.@threads, where each thread operates on its own partition of the corresponding vector.

#--- main computation
@threads for tid in 1:nthreads()
    for bond_id in partitioned_bonds[tid] 
        i, j = bonds[bond_id]
        results = some_calculation()
	b_int[:,i,tid] += results # <-- tid = third dimension
	b_int[:,j,tid] -= results # <-- tid = third dimension
    end
end

#--- reduction into first tid
# single_tids::Vector{Tuple{Int,Int}} 
# --> vector containing tuples with (<point id>, <thread id>) 
#     for all points where the computations occur on only one thread (except 1)
@threads for (point_id, tid) in single_tids
    b_int[:,point_id,1] = b_int[:,point_id,tid]
end
# multi_tids::Vector{Tuple{Int,Vector{Int}}
# --> vector containing tuples with (<point id>, <vector of all thread id's except 1>)
#     for all points where the computations occur on multiple threads
@threads for (point_id, tids) in multi_tids
    for tid in tids
        b_int[:,point_id,1] += b_int[:,point_id,tid]
    end
end

#---
# usage of b_int[:,:,1] ...

Benchmark

However, the scaling for more than ten threads is not good, even with the improvements in the summation (see #9 (comment)).

nthreads btime [s] speedup
1 293.12 1
2 150.98 1.94
8 46.61 6.29
12 38.6 7.59
16 35.93 8.16
24 37.95 7.72
32 49.7 5.9

Roadmap

The main goal is to make the package suitable for larger HPC simulations. The significant RAM requirements for simulations with ContinuumBasedMaterial are also a limiting factor for the multithreading approach. Therefore, an effective solution could be using a distributed approach with MPI.jl in combination with Multithreading (similar to Trixi.jl). Alternatively, other options such as Dagger.jl look very promising.

Remove `:` in docstrings

Keywords in some docstrings are preceded by a colon, which needs to be corrected.

e.g.:

- `:horizon::Float64`: radius of point interactions
- `:rho::Float64`: density
- `:E::Float64`: Young's modulus
- `:nu::Float64`: Poisson's ratio
- `:Gc::Float64`: critical energy release rate
- `:epsilon_c::Float64`: critical strain

JuliaPDE?

Interested in getting this repo included? A PR or an issue would be welcome...

Delete old documentation

Delete all old sections and anything related to the old version of the package from the documentation.

Add custom `MaterialInterfaceError`

Provide a custom MaterialInterfaceError that has a clearer message than the currently used MethodError when someone forgot to correctly specify the interface for a new Material.

Regarding use of precracks in conctact analysis.

Hi !
I was using the peridynamics.jl package to model a contact simulation with the predefined crack in the target. But I am getting the following issue:
MethodError: no method matching PDContactAnalysis(; name::String, body_setup::Vector{BodySetup}, contact::Vector{Contact}, td::VelocityVerlet, es::ExportSettings, precracks::Peridynamics.PreCrack)

Closest candidates are:
PDContactAnalysis(; name, body_setup, contact, td, es) got unsupported keyword argument "precracks"
@ Peridynamics C:\Users\PC.julia\packages\Peridynamics\X60e3\src\contact.jl:71

Stacktrace:
[1] kwerr(kw::NamedTuple{(:name, :body_setup, :contact, :td, :es, :precracks), Tuple{String, Vector{BodySetup}, Vector{Contact}, VelocityVerlet, ExportSettings, Peridynamics.PreCrack}}, args::Type)
@ Base .\error.jl:165
[2] top-level scope
@ In[11]:1.
Can you please help me with it.

Thank you.

[ENHANCEMENT] Clarification on pre-cracked surfaces


name: ๐Ÿ’ก Enhancement Request
about: Request an enhancement or clarification on pre-cracked surfaces
title: '[ENHANCEMENT] Clarification on pre-cracked surfaces'


Requested Enhancement/Clarification:

  1. First, thank you, @kaipartmann, for putting together such a nice and well-written peridynamic implementation.
  2. I would like to better understand the pre-crack option per the example on tutorial_tension_precrack:
    I noticed that the pre-cracked area gets a damage value when initially placed. Say the damage variable equals 0.5 on the nodes at the edge and less towards the inner portion of the body. However, I believe the pre-cracked surfaces should be "undamaged" at the beginning of the simulation. The only difference with respect to the other neighbors is that these nodes on the crack surfaces have fewer neighbors compared to the bulk of the material. Is this how it is intended to be (as-is)?

Anything else:

tutorial_tension_precrack


Add tests for `MultiParamBodyChunk`s

Add tests for:

struct MultiParamBodyChunk{M<:AbstractMaterial,P<:AbstractPointParameters,
D<:AbstractSystem,
S<:AbstractStorage} <: AbstractBodyChunk{M}
mat::M
system::D
storage::S
param::Vector{P}
paramap::Vector{Int}
psets::Dict{Symbol,Vector{Int}}
sdbcs::Vector{SingleDimBC}
pdsdbcs::Vector{PosDepSingleDimBC}
ch::ChunkHandler
cells::Vector{MeshCell{VTKCellType, Tuple{Int64}}}
end

Create body directly with Abaqus mesh

The read_inp function of the submodule AbaqusMeshConverter does not return a PointCloud and is not exported, as in v0.2.
To use an Abaqus mesh for the simulations, one has to specifically load the submodule with

using Peridynamics.AbaqusMeshConverter

or has to use Peridynamics.read_inp. Therefore, the current workflow is similar to the following:

using Peridynamics
using Peridynamics.AbaqusMeshConverter

position, volume, point_sets = read_inp("path/to/abaqus_inp_file.inp")
body = Body(BBMaterial(), position, volume)

# for point sets, 1. either specify every set by hand:
point_set!(body, :some_set, point_sets["some_set"])
# ... all other sets

# or 2. use a for loop:
for (set_name, point_ids) in point_sets
    point_set!(body, Symbol(set_name), point_ids)
end

New method for Body:

It would be relatively easy to implement the code above into a new method for Body. Then the mentioned workflow would be much easier:

using Peridynamics

# the point sets are already included without specifying!
body = Body(BBMaterial(), "path/to/abaqus_inp_file.inp")

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.