Particle managers

Particle managers are responsible for the connectivity between particles and shape functions. They track the particles and shape functions and update the connectivity between them.

Compared to the MPM, several subtle differences exist between the particle managers: - Each particle vertice may be reside in multiple shape functions, whereas a material point vertex can be in only one cell. - For nodally integrated ((semi-)Lagrangian) shape functions, no inactive cells exist, whereas for the material point method, inactive cells exist.

class edelweissmeshfree.particlemanagers.base.baseparticlemanager.BaseParticleManager[source]

The BaseParticleManager class is an abstract base class for all particle managers. If you want to implement a new particle manager, you have to inherit from this class.

Methods

signalizeKernelFunctionUpdate()

For semi-Lagrangian methods, the kernel function locations may change.

updateConnectivity()

Update the connectivity between observed shape functions and particles.

abstractmethod signalizeKernelFunctionUpdate()[source]

For semi-Lagrangian methods, the kernel function locations may change. This method is to signalize such a to the material point manager, so that it can account for the changed supports.

Return type:

None

abstractmethod updateConnectivity()[source]

Update the connectivity between observed shape functions and particles. Returns the truth value of a change during the last connectivity update.

Returns:

The truth value of change.

Return type:

bool

KDBinOrganizedParticleManager class

class edelweissmeshfree.particlemanagers.kdbinorganizedparticlemanager.KDBinOrganizedParticleManager(particleKernelDomain, dimension, journal, bondParticlesToKernelFunctions=False, randomlyShiftPartliceShapeFunctions=False)[source]

Methods

signalizeKernelFunctionUpdate()

For semi-Lagrangian methods, the kernel function locations may change.

updateConnectivity()

Update the connectivity between observed shape functions and particles.

getCoveredDomain

visualize

Parameters:
  • particleKernelDomain (ParticleKernelDomain)

  • dimension (int)

  • journal (Journal)

  • bondParticlesToKernelFunctions (bool)

  • randomlyShiftPartliceShapeFunctions (bool | float)

signalizeKernelFunctionUpdate()[source]

For semi-Lagrangian methods, the kernel function locations may change. This method is to signalize such a to the material point manager, so that it can account for the changed supports.

Return type:

None

updateConnectivity()[source]

Update the connectivity between observed shape functions and particles. Returns the truth value of a change during the last connectivity update.

Returns:

The truth value of change.

Return type:

bool

class edelweissmeshfree.particlemanagers.kdbinorganizedparticlemanager._FastKDBinOrganizer(kernelFunctions, dimension)[source]

Optimized Bin Organizer using pure NumPy vectorization and integer indexing.

Methods

getCandidateIndices

Parameters:
  • kernelFunctions (List[Any])

  • dimension (int)

Legacy implementation

class edelweissmeshfree.particlemanagers.oldkdbinorganizedparticlemanager.KDBinOrganizedParticleManager(particleKernelDomain, dimension, journal, bondParticlesToKernelFunctions=False, randomlyShiftPartliceShapeFunctions=False)[source]

A k-dimensional bin organized manager for particles and meshfree shape functions for locating points in supports.

Parameters:
  • meshfreeKernelFunctions – The list of shape functions.

  • particles – The list of particles.

  • dimension (int) – The dimension of the problem.

  • journal (Journal) – The journal for logging messages.

  • bondParticlesToKernelFunctions (bool) – Whether to bond the particles to the kernel functions (one particle per kernel function). If True, the kernel functions are moved to the particle center coordinates at each update.

  • randomlyShiftPartliceShapeFunctions (bool | float) – Whether to randomly shift the shape functions a bit to avoid alignment artifacts. If a float value is given, this value is used as the maximum shift factor in each direction, which is scaled with the approximate particle size: randdisp = (np.random.rand(self._dimension) - 0.5) * np.sqrt(particle.getVolumeUndeformed()) * randomlyShiftPartliceShapeFunctions * particleSize

  • particleKernelDomain (ParticleKernelDomain)

Methods

signalizeKernelFunctionUpdate()

For semi-Lagrangian methods, the kernel function locations may change.

updateConnectivity()

Update the connectivity between observed shape functions and particles.

visualize()

For 2D only: Visualize the number of kernel functions in the bins.

getCoveredDomain

signalizeKernelFunctionUpdate()[source]

For semi-Lagrangian methods, the kernel function locations may change. This method is to signalize such a to the material point manager, so that it can account for the changed supports.

updateConnectivity()[source]

Update the connectivity between observed shape functions and particles. Returns the truth value of a change during the last connectivity update.

Returns:

The truth value of change.

Return type:

bool

visualize()[source]

For 2D only: Visualize the number of kernel functions in the bins.

class edelweissmeshfree.particlemanagers.oldkdbinorganizedparticlemanager._KDBinOrganizer(kernelFunctions, dimension, randomlyShiftPartliceShapeFunctions=False)[source]

A class to manage the kernel functions in cartesian bins in multiple dimension for fast access.

We store the bounding box of each kerne lfunction (support) in the respective (partially-)covereing bins. This way, we can quickly find for given coordinates (of particles) the shape function candidates of which the support might cover the coordinates.

Parameters:
  • kernelFunctions – The list of shape functions.

  • dimension – The dimension of the problem.

  • randomlyShiftPartliceShapeFunctions (bool | float)

Methods

getKernelFunctionCandidates(coordinate)

Get the shape function candidates for a given coordinate.

_getBinIndices(coordinate)[source]

Get the cartesian bin indices for a given coordinate.

Parameters:

coordinate (ndarray) – The coordinate for which the indices should be computed.

Returns:

The list of indices.

Return type:

list

getKernelFunctionCandidates(coordinate)[source]

Get the shape function candidates for a given coordinate.

Candidates are shape functions that might cover the given coordinate. It is guaranteed that all candidates are returned, but not that all returned shape functions might cover the coordinate, since this is only a fast pre-selection based on the bounding box of the shape functions.

Parameters:

coordinate (ndarray) – The coordinate for which the shape function candidates should be determined.

Returns:

The list of shape function candidates.

Return type:

list