FrictionQPotSpringBlock v0.22.7
Loading...
Searching...
No Matches
FrictionQPotSpringBlock::detail::Laplace2d Class Reference

Short range interactions based on the Laplacian \( \Delta u_{i, j} \). More...

#include <FrictionQPotSpringBlock/detail.h>

Public Member Functions

 Laplace2d (double k, size_type rows, size_type cols)
 
template<class T >
void force (const T &u, T &f)
 Update forces based on current slips.
 

Protected Attributes

size_type m_rows
 Number of rows.
 
size_type m_cols
 Number of columns.
 
double m_k
 Stiffness of the interactions.
 

Detailed Description

Short range interactions based on the Laplacian \( \Delta u_{i, j} \).

Each particle has still one degree of freedom, but interacts with four neighbours in a '2d' grid. The particle numbering is assumed to be as follows:

 0  1  2  3  4
 5  6  7  8  9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24

whereby the interaction kernal is:

   +1
+1 -4 +1
   +1

such that \( f_{i,j} = k (u_{i - 1, j} + u_{i + 1, j} + u_{i, j - 1} + u_{i, j + 1} - 4 u_{i, j}) \).

Indices

From Python you can access the indices as follows:

 # array with 'spatial' organisation of the flat indices of particles
 organisation = np.arange(rows * cols).reshape(rows, cols)

 # flat particle indices of neighbours to all sides
 down = np.roll(organisation, -1, axis=0)
 up = np.roll(organisation, 1, axis=0)
 left = np.roll(organisation, 1, axis=1)
 right = np.roll(organisation, -1, axis=1)

Definition at line 524 of file detail.h.

Constructor & Destructor Documentation

◆ Laplace2d()

FrictionQPotSpringBlock::detail::Laplace2d::Laplace2d ( double k,
size_type rows,
size_type cols )
inline
Parameters
kStiffness of the interactions.
rowsNumber of rows.
colsNumber of columns.

Definition at line 538 of file detail.h.

Member Function Documentation

◆ force()

template<class T >
void FrictionQPotSpringBlock::detail::Laplace2d::force ( const T & u,
T & f )
inline

Update forces based on current slips.

Parameters
uSlip per particle.
fForce per particle (output).

Definition at line 546 of file detail.h.

Member Data Documentation

◆ m_cols

size_type FrictionQPotSpringBlock::detail::Laplace2d::m_cols
protected

Number of columns.

Definition at line 527 of file detail.h.

◆ m_k

double FrictionQPotSpringBlock::detail::Laplace2d::m_k
protected

Stiffness of the interactions.

Definition at line 528 of file detail.h.

◆ m_rows

size_type FrictionQPotSpringBlock::detail::Laplace2d::m_rows
protected

Number of rows.

Definition at line 526 of file detail.h.


The documentation for this class was generated from the following file: