kaipartmann / Peridynamics.jl

A Julia package for parallel peridynamics simulations
https://kaipartmann.github.io/Peridynamics.jl/
MIT License
32 stars 7 forks source link

Create body directly with Abaqus mesh #65

Closed kaipartmann closed 1 day ago

kaipartmann commented 2 months ago

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")
kaipartmann commented 2 months ago

One thing that has to be considered is the conversion from the strings to symbols. With a field like "Point position top" with whitespace would result in the necessity for the user to specify Symbol("Point position top") when referencing the set. Therefore, maybe a conversion to :Point_positition_top could be a possible addition.