1 Introduction

The nonlocal theory of elasticity [1,2,3,4,5] primarily considers distant action forces between objects. Different from the concept of local theory, an object can interact without physical interaction with a different object. The theory is of great significance to solve many physical problems, such as the law of universal gravitation. Some notable nonlocal numerical methods were proposed according to nonlocal interaction in nonlocal continuum field theories.

Peridynamics (PD) [6,7,8] is a formulation of continuum mechanics on the basis of the concept of nonlocal integration, PD avoids the singularity of the traditional local differential equations when solving discontinuous problems. One key application of PD is fracture. It shares the same advantages as the Cracking Particles Method (CPM) presented in [9,10,11]. In contrast to many other discrete crack approaches as presented in [12,13,14,15,16,17,18,19,20], PD does not require the representation of the discrete crack surface and associated crack tracking algorithms. PD also has been successfully applied to rock fracture and soil damage analysis, such as impact fracture [21, 22], composite material separation [23, 24]and beam and plate structures [25]. However, to eliminate erroneous wave reflection and ghost force among particles, all traditional PD formulas must use the same horizon size. In many applications, to enhance calculating performance, its necessary to use different horizon sizes for the calculation of particles with non-uniform spatial distribution, such as adaptive encryption, multi-scale simulation, and multi-body analysis. In other words, in order to balance the calculation efficiency and calculation accuracy, we hope that PD can be based on the distribution characteristics of the particles, but if the size of the near field is used, it will result in the generation of false stress waves and the problem cannot be solved correctly. To address the aforementioned issue, dual-horizon PD [26, 27] was developed to improve computing efficiency and to allow for varying horizon sizes. The dual-horizon is the dual term of the horizon when variable horizons are used in the inhomogeneous discretization. It separates the horizon that exerts forces and counter forces between the particles, thereby solving the problem of false stress caused by the horizons. In addition, other nonlocal models mainly include nonlocal linear elasticity [28,29,30], dynamics of nonlocal fluid [31, 32], electromagnetic nonlocal theory [33, 34], nonlocal damage model [35,36,37] and nonlocal calculus [38,39,40,41].

In most of the current nonlocal numerical methods, the governing equation is generally solved by the explicit time integration method [25, 42]. The explicit algorithm [43,44,45,46,47] is based on dynamic equations, without iteration and has good stability. However, the mass matrix is required to be a diagonal matrix in the explicit solution and the speed advantage can be exerted only when the unit-level calculation is as small as possible. Therefore, the reduced integration method is often used, which is easy to excite the hourglass mode and affect the stress and strain calculation accuracy. To ensure its conditional convergence, the integration step must be less than the minimum value of the free vibration period of all elements. The integration time step is generally 1/1000 to 1/100 of the implicit step, which is suitable for solving instant or short-time loading problems. For the quasi-static (quasi-static) problem, when the total load is fixed, the calculation takes a long time, which seriously affects the calculation efficiency. Compared with the explicit method, implicit method [48,49,50] has advantages for fast convergence and lower computational cost.

In recent years, several numerical approaches based on peridynamics operators have been proposed, see e.g. the contributions in [51,52,53]. A new computational method based on nonlocal operators is the NOM first proposed in [54] for electromagnetic problems. The approach has been later on extended to mechanical problems in [55, 56]. The NOM can be considered as a generalization of non-ordinary state-based PD. It has been applied to numerous challenging problems in solid mechanics and can be a viable alternative to FEM or meshless methods. In order to acquire the differential operators, FEM and meshless methods are required to establish the shape functions as well as compute their derivatives, however, NOM can acquire the differential operators easily without the use of shape functions. The tangent stiffness is obtained naturally by simply defining an energy function thus drastically simplifying its implementation. In combination with the weighted residual method and variational principle, the residual and the tangent stiffness matrix can be established by NOM with ease. NOM is enhanced here also with operator energy functional to achieve the linear consistency of the field and avoid instabilities. Although the theoretical framework of the NOM has been proposed, other benefits of this numerical method have not been thoroughly discussed. Furthermore, the details of the derivation of the first-order and higher-order nonlocal differential operators, construction of the first-order and higher-order operator energy functional, the derivation of the residual and tangent stiffness matrix of operate energy functional and the detailed implementation procedure of first-order and higher-order NOM has not been shown before. The purpose of this paper is to describe in detail the method of implicitly implementing for first-order and higher-order NOM, which mainly including the derivation of the first-order and higher-order nonlocal differential operates, the detailed form of first-order and higher-order tangent stiffness matrix for operate energy functional and elastic material constitutions in different conditions. The Mathematica code of first-order and higher-order NOM is presented and explained in detail, and it will be an effective tool for studying complicated physical problems.

The remainder of the paper is outlined as follows: In Section 2, we briefly reviewed the NOM and elaborated on the fundamental concept of support and dual-support. In Section 3, we derived the first and higher-order implicit nonlocal differential operators based on the Taylor series expansion. Then the elastic material constitutions are also derived. Hereafter, to remove the zero-energy mode, the first and higher-order operator energy functional by the nonlocal operator is constructed, combined with the method of weighed residuals and variational principles, residual and tangent stiffness matrix of operate energy functional are established. Finally, we present the detailed steps of the first-order and higher-order NOM implementation process. To demonstrate the capabilities of NOM, four numerical examples are presented in section 4. Finally, we conclude in section 5.

2 Nonlocal operator method (NOM)

Fig. 1
figure 1

a The deformed body configuration. b Support and dual-support schematic diagram, \({\mathcal {S}}_{{\mathbf {x}}}=\{{\mathbf {x}}_2,{\mathbf {x}}_3,{\mathbf {x}}_5,{\mathbf {x}}_6,{\mathbf {x}}_7\}\), \({\mathcal {S}}_{{\mathbf {x}}}'=\{{\mathbf {x}}_3,{\mathbf {x}}_6,{\mathbf {x}}_7\}\)

Consider the initial and present configurations of a solid, as depicted in Fig. 1a, let \({\mathbf {x}}_i\) be spatial coordinates in the domain \(\varvec{\Omega }\); \(\varvec{\xi }_{ij}:={\mathbf {x}}_j-{\mathbf {x}}_i\) is a spatial vector starts from \({\mathbf {x}}_i\) to \({\mathbf {x}}_j\); \({\mathbf {u}}_i:={\mathbf {u}}({\mathbf {x}}_i,t)\) and \({\mathbf {u}}_j:={\mathbf {u}}({\mathbf {x}}_j,t)\) are the field value for \({\mathbf {x}}_i\) and \({\mathbf {x}}_j\), respectively; \({\mathbf {u}}_{ij}:={\mathbf {u}}_j-{\mathbf {u}}_i\) is the relative field vector for spatial vector \(\varvec{\xi }_{ij}\).

Support \({\mathcal {S}}_{i}\) of point \({\mathbf {x}}_i\) is the domain where any spatial point \({\mathbf {x}}_j\) forms spatial vector \(\varvec{\xi }_{ij}(={\mathbf {x}}_j-{\mathbf {x}}_i)\) from \({\mathbf {x}}_i\) to \({\mathbf {x}}_j\). The support serves as the basis for the nonlocal operators. It should be noted there is no restriction on the support shapes(such as spherical, cube and so on). Dual-support is defined as a union of the points whose supports include \({\mathbf {x}}\), indicated by

$$\begin{aligned} {\mathcal {S}}_{i}'=\{{\mathbf {x}}_j|{\mathbf {x}}_i \in {\mathcal {S}}_{j}\} . \end{aligned}$$
(1)

Point \({\mathbf {x}}_j\) forms dual-vector \(\varvec{\xi }_{ij}'(={\mathbf {x}}_i-{\mathbf {x}}_j=-\varvec{\xi }_{ij})\) in \({\mathcal {S}}_{i}'\). In addition, \(\varvec{\xi }_{ij}'\) is the spatial vector established in \({\mathcal {S}}_{j}\). Figure 1b illustrates the concept of support and dual-support.

In calculus calculations, the NOM replaces the local operator with the fundamental nonlocal operators. By substituting the local differential operator with the corresponding nonlocal operator, the functional defined by the local differential operator can be utilized to establish the residual or tangent stiffness matrix.

The nonlocal gradient operator for a vector field \({\mathbf {u}}\) and scalar field u at point \({\mathbf {x}}_i\) in support \({\mathcal {S}}_{i}\) are defined as [55]

$$\begin{aligned} \tilde{\nabla }{\mathbf {u}}_{i} (\text {or} \tilde{\nabla }\otimes {\mathbf {u}}_{i}) :=\int _{{\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) {\mathbf {u}}_{ij} \otimes \varvec{\xi }_{ij} \text {d}V_{j} \cdot \Big (\int _{{\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{\xi }_{ij} \otimes \varvec{\xi }_{ij} \text {d}V_{j}\Big )^{-1}, \end{aligned}$$
(2)
$$\begin{aligned} \tilde{\nabla }u_{i}:=\int _{{\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) u_{ij} \varvec{\xi }_{ij} \text {d}V_{j} \cdot \Big (\int _{{\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{\xi }_{ij} \otimes \varvec{\xi }_{ij} \text {d}V_{j}\Big )^{-1}, \end{aligned}$$
(3)

where \({ \mathbbm {w}}(\varvec{\xi }_{ij})\) is the weight function for vector \(\varvec{\xi }_{ij}\) in support \({{\mathcal {S}}_{i}}\).

By nodal integration, the nonlocal gradient operator and its variation for a vector field \({\mathbf {u}}\) in discrete form can be written as

$$\begin{aligned} \tilde{\nabla }{\mathbf {u}}_{i}&=\sum _{j\in {\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) {\mathbf {u}}_{ij} \otimes \varvec{\xi }_{ij} \Delta V_{j} \cdot \Big (\sum _{j \in {\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{\xi }_{ij} \otimes \varvec{\xi }_{ij} \Delta V_{j}\Big )^{-1}, \end{aligned}$$
(4)
$$\begin{aligned} \tilde{\nabla }\delta {\mathbf {u}}_{i}&=\sum _{j\in {\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \delta {\mathbf {u}}_{ij} \otimes \varvec{\xi }_{ij} \Delta V_{j} \cdot \Big (\sum _{j\in {\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{\xi }_{ij} \otimes \varvec{\xi }_{ij} \Delta V_{j}\Big )^{-1}. \end{aligned}$$
(5)

The operator energy functional for vector field at a point \({\mathbf {x}}_i\) is defined as

$$\begin{aligned} {\mathcal {F}}_i^{hg}&=\frac{p^{hg}}{2m_{{\mathbf {K}}_i}} \int _{{\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij}) (\tilde{\nabla }{\mathbf {u}}_i\cdot \varvec{\xi }_{ij}-{\mathbf {u}}_{ij})\cdot (\tilde{\nabla }{\mathbf {u}}_i\cdot \varvec{\xi }_{ij}-{\mathbf {u}}_{ij}) \text {d}V_j, \end{aligned}$$
(6)

where \(\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\) is a coefficient for the operator energy functional, \(p^{hg}\) is the penalty coefficient, \({m_{{\mathbf {K}}_i}}(=\text {tr}{[{\mathbf {K}}_i]}\)) is the normalization coefficient, \({\mathbf {K}}_i\) is a shape tensor and it can be defined as

$$\begin{aligned} {\mathbf {K}}_i= \int _{{\mathcal {S}}_i}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{\xi }_{ij} \otimes \varvec{\xi }_{ij} \text {d}V_{j} \end{aligned}$$
(7)

3 Implementation

3.1 Derivation of the first-order implicit nonlocal differential operators

The displacement field at any point in the elastic body can be represented by three displacement components uvw along the rectangular coordinate axis, and it’s three dimension vector form is

$$\begin{aligned} {\mathbf {u}}= ( u,v,w )^T. \end{aligned}$$
(8)

The first-order Taylor series expansion at point (0,0) for a displacement field \({\mathbf {u}}\) is given as

$$\begin{aligned} {\mathbf {u}}'={\mathbf {u}}+\nabla {\mathbf {u}}\cdot {\varvec{\xi }}+O(\varvec{\xi }^2), \end{aligned}$$
(9)

where \(\nabla :=(\frac{\partial }{\partial x},\frac{\partial }{\partial y},\frac{\partial }{\partial z})\); \(\varvec{\xi }:=\) \((x, y,z)^T\) denotes the initial bond vector, \(O(\varvec{\xi }^2)\) represents higher-order terms, and for linear field \(O(\varvec{\xi }^2)=0\).

\(\left( {\mathbf {u}}'-{\mathbf {u}}\right) \otimes \varvec{\xi }\) can be obtained from Eq. 9 and can be shown as

$$\begin{aligned} \left( {\mathbf {u}}'-{\mathbf {u}}\right) \otimes \varvec{\xi }&=\nabla {\mathbf {u}}\cdot {\varvec{\xi }}\otimes \varvec{\xi }. \end{aligned}$$

Integrate \(\left( {\mathbf {u}}'-{\mathbf {u}}\right) \otimes \varvec{\xi }\) in the domain \({\mathcal {S}}_i\), one will obtain

$$\begin{aligned} \int _{{\mathcal {S}}_i}{\mathbbm {w}} \left( \varvec{\xi }\right) \left( {\mathbf {u}}'-{\mathbf {u}}\right) \otimes \varvec{\xi }\text {d}V= \nabla {\mathbf {u}}\int _{{\mathcal {S}}_i}{ \mathbbm {w}} \left( \varvec{\xi }\right) {\varvec{\xi }}\otimes \varvec{\xi }\text {d}V. \end{aligned}$$
(10)

The gradient operate \(\nabla {{\mathbf {u}}}\) can be expressed as

$$\begin{aligned} \nabla {{\mathbf {u}}}=\int _{{\mathcal {S}}_i}{ \mathbbm {w}}\left( \varvec{\xi }\right) \left( {\mathbf {u}}'-{\mathbf {u}}\right) \otimes \varvec{\xi }\text {d}V\cdot {\left[ \int _{{\mathcal {S}}_i}{ \mathbbm {w}} \left( \varvec{\xi }\right) {\varvec{\xi }}\otimes \varvec{\xi }\text {d}V\right] ^{-1}}. \end{aligned}$$
(11)

The discrete form of Eq. 11 at point \({\mathbf {x}}_i\) can be shown as

$$\begin{aligned} \nabla {{\mathbf {u}}_{i}}=\sum _{j\in {\mathcal {S}}_{i}}{ \mathbbm {w}}\left( \varvec{\xi }_{ij}\right) \left( {\mathbf {u}}_j-{\mathbf {u}}_i\right) \otimes \varvec{\xi }_{ij} \Delta V_j\cdot {\left[ \sum \nolimits _{j}{ \mathbbm {w}}\left( \varvec{\xi }_{ij}\right) {\varvec{\xi }_{ij}}\otimes \varvec{\xi }_{ij} \Delta V_j\right] ^{-1}}. \end{aligned}$$
(12)

To simplify the equation more conveniently, letting \({\mathcal {S}}_{i}=\begin{bmatrix}i,j_1,j_2,j_3,\cdots ,j_n\end{bmatrix}\), \({\mathbf {R}}_{j}={ \mathbbm {w}}\left( \varvec{\xi }_{ij}\right) \varvec{\xi }_{ij} ^T V_j\cdot {\left[ \sum _{j\in {\mathcal {S}}_{i}}{ \mathbbm {w}}\left( \varvec{\xi }_{ij}\right) {\varvec{\xi }_{ij}}\otimes \varvec{\xi }_{ij} \Delta V_j\right] ^{-1}}=(\xi _{x_j},\xi _{y_j},\xi _{z_j})\). The nonlocal gradient operator \(\tilde{\nabla }{{\mathbf {u}}}\) at point \({\mathbf {x}}_i\) can be rewritten as

$$\begin{aligned} \tilde{\nabla }{{\mathbf {u}}_i}=\sum _{j\in {\mathcal {S}}_{i}} \left( {\mathbf {u}}_j-{\mathbf {u}}_i\right) \begin{bmatrix}\xi _{x_j},\xi _{y_j},\xi _{z_j }\end{bmatrix}. \end{aligned}$$
(13)

According to Eq. 13, the matrix form of nonlocal gradient operator \(\tilde{\nabla }{{\mathbf {u}}}\) at point \({\mathbf {x}}_i\) for vector field can be expressed as

$$\begin{aligned} \tilde{\nabla }{{\mathbf {u}}_i}=\begin{bmatrix}\frac{{\partial u_i}}{ \partial x} &{}\frac{{\partial u_i}}{ \partial y} &{} \frac{{\partial u_i}}{ \partial z}\\ \frac{\partial v_i}{ \partial x} &{}\frac{\partial v_i}{ \partial y}&{}\frac{\partial v_i}{ \partial z} \\ \frac{\partial w_i}{ \partial x} &{}\frac{\partial w_i}{ \partial y}&{}\frac{\partial w_i}{ \partial z}\\ \end{bmatrix}=\begin{bmatrix}-\sum _{j\in {\mathcal {S}}_{i}} \xi _{x_j} &{} \xi _{x_{j1}} &{} \cdots &{}\xi _{x_{jn}} \\ -\sum _{j\in {\mathcal {S}}_{i}} \xi _{y_j} &{} \xi _{y_{j1}} &{} \cdots &{}\xi _{y_{jn}} \\ -\sum _{j\in {\mathcal {S}}_{i}} \xi _{z_j} &{} \xi _{z_{j1}} &{} \cdots &{}\xi _{z_{jn}} \\ \end{bmatrix}\begin{bmatrix}u_{i} &{} v_{i}&{} w_{i}\\ u_{j1} &{} v_{j1}&{} w_{j1}\\ \cdots &{} \cdots &{} \cdots \\ u_{jn}&{}v_{jn}&{}w_{jn}\\ \end{bmatrix}. \end{aligned}$$
(14)

For the convenience of calculations, we transform the matrix form of nonlocal gradient operator \(\tilde{\nabla }{{\mathbf {u}}_i}\) for vector field into vector form and it can be rewritten as

$$\begin{aligned} \tilde{\nabla }{{\mathbf {u}}_i}=&\begin{bmatrix}\frac{{\partial u_i}}{ \partial x}, \frac{{\partial u_i}}{ \partial y}, \frac{{\partial u_i}}{ \partial z}, \frac{\partial v_i}{ \partial x}, \frac{\partial v_i}{ \partial y}, \frac{\partial v_i}{ \partial z}, \frac{\partial w_i}{ \partial x} , \frac{\partial w_i}{ \partial y}, \frac{\partial w_i}{ \partial z} \end{bmatrix}^T \nonumber \\ =&\begin{bmatrix} -\sum _{j\in {\mathcal {S}}_{i}} \xi _{x_j} &{}0&{}0&{} \xi _{x_{j1}}&{} 0 &{}0&{} \cdots &{}\xi _{x_{jn}}&{} 0&{} 0 \\ 0 &{}-\sum _{j\in {\mathcal {S}}_{i}} \xi _{y_j}&{}0&{} 0&{}\xi _{y_{j1}} &{}0&{} \cdots &{}0&{}\xi _{y_{jn}}&{}0 \\ 0&{} 0&{}-\sum _{j\in {\mathcal {S}}_{i}} \xi _{z_j} &{} 0 &{} 0&{}\xi _{z_{j1}}&{}\cdots &{} 0&{} 0&{}\xi _{z_{jn}}\\ -\sum _{j\in {\mathcal {S}}_{i}} \xi _{x_j}&{}0 &{} 0 &{}\xi _{x_{j1}} &{}0&{} 0 &{}\cdots &{}\xi _{x_{jn}} &{} 0&{} 0\\ 0 &{}-\sum _{j\in {\mathcal {S}}_{i}} \xi _{y_j}&{} 0 &{} 0&{}\xi _{y_{j1}} &{} 0 &{} \cdots &{}0 &{} \xi _{y_{jn}} &{} 0\\ 0 &{} 0 &{}-\sum _{j\in {\mathcal {S}}_{i}} \xi _{z_j}&{} 0&{} 0 &{}\xi _{z_{j1}} &{}\cdots &{}0 &{} 0&{} \xi _{z_{jn}}\\ -\sum _{j\in {\mathcal {S}}_{i}} \xi _{x_j}&{}0 &{}0 &{} \xi _{x_{j1}} &{}0 &{} 0&{} \cdots &{} \xi _{x_{jn}}&{}0 &{} 0 \\ 0 &{}-\sum _{j\in {\mathcal {S}}_{i}} \xi _{y_j}&{} 0 &{} 0&{}\xi _{y_{j1}} &{}0 &{} \cdots &{}0 &{} \xi _{y_{jn}}&{} 0 \\ 0 &{}0 &{}-\sum _{j\in {\mathcal {S}}_{i}} \xi _{z_j}&{} 0 &{} 0&{}\xi _{z_{j1}} &{} \cdots &{}0 &{} 0&{} \xi _{z_{jn}} \\ \end{bmatrix} \begin{bmatrix}u_{i} \\ v_{i}\\ w_{i}\\ u_{j1} \\ v_{j1}\\ w_{j1}\\ \cdots \\ u_{jn}\\ v_{jn}\\ w_{jn}\\ \end{bmatrix}=\mathscr {B}_i\mathscr {U}_i. \end{aligned}$$
(15)

Similarly, the nonlocal gradient operator \(\tilde{\nabla }{u}\) at point \({\mathbf {x}}_i\) for scalar field is written as

$$\begin{aligned} \tilde{\nabla }{u_i}=\begin{bmatrix}\frac{{\partial u_i}}{ \partial x} \\ \frac{{\partial u_i}}{ \partial y}\\ \frac{{\partial u_i}}{ \partial z}\\ \end{bmatrix}=\begin{bmatrix}-\sum _{j\in {\mathcal {S}}_{i}} \xi _{x_j} &{} \xi _{x_{j1}} &{} \cdots &{}\xi _{x_{jn}} \\ -\sum _{j\in {\mathcal {S}}_{i}} \xi _{y_j} &{} \xi _{y_{j1}} &{} \cdots &{}\xi _{y_{jn}} \\ sum_{j\in {\mathcal {S}}_{i}} \xi _{z_j} &{} \xi _{z_{j1}} &{} \cdots &{}\xi _{z_{jn}} \\ \end{bmatrix}\begin{bmatrix}u_{i} \\ u_{j1}\\ \cdots \\ u_{jn}\\ \end{bmatrix}=\mathscr {B}_i\mathscr {U}_i. \end{aligned}$$
(16)

The 2D form of the first-order nonlocal gradient operators is given in Appendix A.

3.2 Derivation of the higher-order implicit nonlocal differential operators

The higher-order NOM is based on higher-order Taylor series expansion of a multi-variable function. Consider a vector field \({\mathbf {u}}\) at point \({\mathbf {x}}_j\) (\({\mathbf {x}}_j\in {\mathcal {S}}_i\)). For convenience, we shorthand \({\mathbf {u}}({\mathbf {x}}_j)\) by \({\mathbf {u}}_j\), which can be estimated via a Taylor expansion based on \({\mathbf {u}}_i\) in \({\mathbbm {r}}\) dimensions with the highest order of derivatives as \(\mathbbm {n}\):

$$\begin{aligned} {\mathbf {u}}_j={\mathbf {u}}_i+\sum _{(\mathbbm {n}_{1},\ldots ,{\mathbbm {n}}_{{\mathbbm {r}}})\in \alpha _{\mathbbm {r}}^{\mathbbm {n}}}\frac{\varvec{\xi }_{1}^{{\mathbbm {n}}_{1}}\ldots \varvec{\xi }_{{\mathbbm {r}}}^{{\mathbbm {n}}_{{\mathbbm {r}}}}}{{\mathbbm {n}}_{1}!\ldots {\mathbbm {n}}_{{\mathbbm {r}}}!} {\mathbf {u}}_{i,{\mathbbm {n}}_1\ldots {\mathbbm {n}}_{\mathbbm {r}}}+O(\varvec{\xi }^{|\alpha |+1}), \end{aligned}$$
(17)

where

$$\begin{aligned}&\varvec{\xi }_{ij}=({{\mathbf {x}}}_{j1}-{{\mathbf {x}}}_{i1},\ldots ,{{\mathbf {x}}}_{jd}-{{\mathbf {x}}}_{id}) \end{aligned}$$
(18)
$$\begin{aligned}&{\mathbf {u}}_{i,{\mathbbm {n}}_1\ldots {\mathbbm {n}}_{\mathbbm {r}}}=\frac{\partial ^{{\mathbbm {n}}_{1}+\ldots +{\mathbbm {n}}_{{\mathbbm {r}}}}{\mathbf {u}}_i}{\partial {{\mathbf {x}}}_{i1}^{{\mathbbm {n}}_{1}}\ldots \partial {{\mathbf {x}}}_{id}^{{\mathbbm {n}}_{{\mathbbm {r}}}}} \end{aligned}$$
(19)
$$\begin{aligned}&|\alpha |=\max {({\mathbbm {n}}_1+\cdots +{\mathbbm {n}}_{\mathbbm {r}})}, \end{aligned}$$
(20)

where \({\mathbbm {r}}\) represents the dimension and \({\mathbbm {n}}\) denotes the highest order of derivatives. \(\alpha _{\mathbbm {r}}^{\mathbbm {n}}\) is a compilation of multi-indexes that have been flattened and it can be written as

$$\begin{aligned} \alpha _{\mathbbm {r}}^{\mathbbm {n}}&=\{({\mathbbm {n}}_1,\ldots ,{\mathbbm {n}}_{\mathbbm {r}})|1\le \sum _{i=1}^{\mathbbm {r}} {\mathbbm {n}}_i\le {\mathbbm {n}},\, {\mathbbm {n}}_i\in \mathbb {{N}}^0, 1\le i \le {\mathbbm {r}}\}, \end{aligned}$$
(21)

where \({\mathbb {N}}^0=\{0,1,2,\ldots \}\).

To eliminate the round-off error in Eq. 17, we here include the characteristic length scale \({\mathbbm {l}}_i\) of support \({\mathcal {S}}_i\) at \({\mathbf {u}}_i\) , and the modified Taylor series expansion may be rewritten as

$$\begin{aligned} {\mathbf {u}}_j&={\mathbf {u}}_i+\sum _{({\mathbbm {n}}_1,\ldots ,{\mathbbm {n}}_{\mathbbm {r}})\in \alpha _{\mathbbm {r}}^{\mathbbm {n}}}\frac{\varvec{\xi }_{1}^{{\mathbbm {n}}_{1}}\ldots \varvec{\xi }_{{\mathbbm {r}}}^{{\mathbbm {n}}_{{\mathbbm {r}}}}}{{\mathbbm {l}}_i^{{\mathbbm {n}}_1+\cdots +{\mathbbm {n}}_{\mathbbm {r}}}} \Big (\frac{{\mathbbm {l}}_i^{{\mathbbm {n}}_1+\cdots +{\mathbbm {n}}_{\mathbbm {r}}}}{{\mathbbm {n}}_{1}!\ldots {\mathbbm {n}}_{{\mathbbm {r}}}!}u_{i,{\mathbbm {n}}_1\ldots {\mathbbm {n}}_{\mathbbm {r}}}\Big )+O(\varvec{\xi }^{{\mathbbm {n}}+1})\nonumber \\&={\mathbf {u}}_i+\sum _{({\mathbbm {n}}_1,\ldots ,{\mathbbm {n}}_{\mathbbm {r}})\in \alpha _{\mathbbm {r}}^{\mathbbm {n}}}\frac{\varvec{\xi }_{1}^{{\mathbbm {n}}_{1}}\ldots \varvec{\xi }_{{\mathbbm {r}}}^{{\mathbbm {n}}_{{\mathbbm {r}}}}}{{\mathbbm {l}}_i^{{\mathbbm {n}}_1+\cdots +{\mathbbm {n}}_{\mathbbm {r}}}}\,\, {\mathbf {u}}^{\mathbbm {l}}_{i,{\mathbbm {n}}_1\ldots {\mathbbm {n}}_{\mathbbm {r}}}+O(\varvec{\xi }^{{\mathbbm {n}}+1}). \end{aligned}$$
(22)

For any multi-index \(({\mathbbm {n}}_1,\ldots , {\mathbbm {n}}_{\mathbbm {r}})\in \alpha _{\mathbbm {r}}^{\mathbbm {n}}\), \({\mathbf {u}}^{\mathbbm {l}}_{i,{\mathbbm {n}}_1\ldots {\mathbbm {n}}_{\mathbbm {r}}}=\frac{{\mathbbm {l}}_i^{{\mathbbm {n}}_1+\cdots +{\mathbbm {n}}_{\mathbbm {r}}}}{{\mathbbm {n}}_{1}!\ldots {\mathbbm {n}}_{{\mathbbm {r}}}!}{\mathbf {u}}_{i,{\mathbbm {n}}_1\ldots {\mathbbm {n}}_{\mathbbm {r}}},\forall ({\mathbbm {n}}_1,\ldots , {\mathbbm {n}}_{\mathbbm {r}})\in \alpha _{\mathbbm {r}}^{\mathbbm {n}}.\) We let \(\varvec{p}^{\mathbbm {l}}_j\), \(\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i\) and \(\partial _\alpha {\mathbf {u}}_i\) denotes the flattened polynomials, scaled partial derivatives, partial derivatives, respectively, according to multi-index notation \(\alpha _{\mathbbm {r}}^{\mathbbm {n}}\) and they can be shown as

$$\begin{aligned} \varvec{p}^{\mathbbm {l}}_j&=\left( \frac{\varvec{\xi }_{{\mathbbm {r}}}}{{\mathbbm {l}}},\ldots ,\frac{\varvec{\xi }_{1}^{{\mathbbm {n}}_{1}}\ldots \varvec{\xi }_{{\mathbbm {r}}}^{{\mathbbm {n}}_{{\mathbbm {r}}}}}{{\mathbbm {l}}^{{\mathbbm {n}}_1+\cdots +{\mathbbm {n}}_{\mathbbm {r}}}},\ldots ,\frac{\varvec{\xi }_1^{\mathbbm {n}}}{{\mathbbm {l}}^{\mathbbm {n}}}\right) ^T\nonumber \\ \partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i&=\left( {\mathbf {u}}^{\mathbbm {l}}_{i,0\ldots 1},\ldots ,{\mathbf {u}}^{\mathbbm {l}}_{i,{\mathbbm {n}}_1\ldots {\mathbbm {n}}_{\mathbbm {r}}},\ldots ,{\mathbf {u}}^{\mathbbm {l}}_{i,{\mathbbm {n}}\ldots 0}\right) ^T\nonumber \\ \partial _\alpha {\mathbf {u}}_i&=\left( {\mathbf {u}}_{i,0\ldots 1},\ldots ,{\mathbf {u}}_{i,{\mathbbm {n}}_1\ldots {\mathbbm {n}}_{\mathbbm {r}}},\ldots ,{\mathbf {u}}_{i,{\mathbbm {n}}\ldots 0}\right) ^T. \end{aligned}$$
(23)

The \({\mathbbm {l}}\) in the Eq. 23 allows the terms of the same characteristic scale for length thereby eliminating computational round-off error. The current partial derivatives can be recovered by

$$\begin{aligned} \partial _\alpha {\mathbf {u}}_i=\text{ diag }\big [{\mathbbm {l}}_i,\ldots ,\frac{{\mathbbm {l}}_i^{{\mathbbm {n}}_1+\cdots +{\mathbbm {n}}_{\mathbbm {r}}}}{{\mathbbm {n}}_1!\ldots {\mathbbm {n}}_{\mathbbm {r}}!},\ldots ,\frac{{\mathbbm {l}}_i^{{\mathbbm {n}}}}{{\mathbbm {n}}!}\big ]^{-1} \partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i. \end{aligned}$$
(24)

In which diag [\(\mathcal {X}_1, \ldots , \mathcal {X}_{\mathbbm {n}}\)] signifies a diagonal matrix of \(\mathcal {X}_1, \ldots , \mathcal {X}_{\mathbbm {n}}\), whose diagonal entries begin from the upper left corner. Hence, the expansion of the Taylor series with \({\mathbf {u}}_i\) to the left of the Eq. 22 can be rewritten as

$$\begin{aligned} {\mathbf {u}}_{ij}=(\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i)^T\varvec{p}_j^{\mathbbm {l}},\forall j\in {\mathcal {S}}_i, \end{aligned}$$
(25)

where \({\mathbf {u}}_{ij}={\mathbf {u}}_j-{\mathbf {u}}_i\).

Integrate \({\mathbf {u}}_{ij}\) with weighted coefficient \({ \mathbbm {w}}(\varvec{\xi }_{ij}) (\varvec{p}^{\mathbbm {l}}_j)^T\) in support \({\mathcal {S}}_i\), we obtain

$$\begin{aligned} \int _{{\mathcal {S}}_i}{ \mathbbm {w}}(\varvec{\xi }_{ij}) {\mathbf {u}}_{ij} (\varvec{p}^{\mathbbm {l}}_j)^T \text {d}V_j&= (\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i)^T\,\int _{{\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{p}^{\mathbbm {l}}_j\otimes (\varvec{p}^{\mathbbm {l}}_j)^T \text {d}V_j \nonumber \\&=(\partial _\alpha {\mathbf {u}}_i)^T\,\mathbb {L}_i\,\int _{{\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{p}^{\mathbbm {l}}_j\otimes (\varvec{p}^{\mathbbm {l}}_j)^T \text {d}V_j, \end{aligned}$$
(26)

where

$$\begin{aligned} \mathbb {L}_i=\text{ diag }\big [{\mathbbm {l}}_i,\ldots ,\frac{{\mathbbm {l}}_i^{{\mathbbm {n}}_1+\cdots +{\mathbbm {n}}_{\mathbbm {r}}}}{{\mathbbm {n}}_1!\ldots {\mathbbm {n}}_{\mathbbm {r}}!},\ldots ,\frac{{\mathbbm {l}}_i^{{\mathbbm {n}}}}{{\mathbbm {n}}!}\big ]. \end{aligned}$$
(27)

Therefore, the nonlocal operator \(\tilde{\partial }_\alpha {\mathbf {u}}_i\) and its variation can be obtained as

$$\begin{aligned} \left\{ \begin{aligned}&\tilde{\partial }_\alpha {\mathbf {u}}_i={\mathbf {K}}_{\alpha i} \cdot \int _{{\mathcal {S}}_i}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{p}^{\mathbbm {l}}_j {\mathbf {u}}_{ij} \text {d}V_j\\&\tilde{\partial }_\alpha \delta {\mathbf {u}}_i={\mathbf {K}}_{\alpha i}\cdot \int _{{\mathcal {S}}_i}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{p}^{\mathbbm {l}}_j (\delta {\mathbf {u}}_{j}-\delta {\mathbf {u}}_i) \text {d}V_j \end{aligned} \right. \end{aligned}$$
(28)

where

$$\begin{aligned} {\mathbf {K}}_{\alpha i}=\mathbb {L}_i^{-1} \Big (\int _{{\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{p}^{\mathbbm {l}}_j\otimes (\varvec{p}^{\mathbbm {l}}_j)^T \text {d}V_j\Big )^{-1} \end{aligned}$$
(29)

In this paper, points of the domain \(\Omega\) in \({\mathcal {S}}_{i}\) be symbolized as

$$\begin{aligned} {\mathcal {S}}_i&=\{j_1,\ldots ,j_k,\ldots ,j_{n_i}\} \end{aligned}$$
(30)

where \(j_1,\ldots ,j_k,\ldots ,j_{n}\) denote the global indices of neighbors for point \({\mathbf {x}}_i\), and n denotes the quantity of i’s neighbors in \({\mathcal {S}}_i\).

The discrete form of Eq. 28 can be shown as

$$\begin{aligned} \tilde{\partial }_\alpha {\mathbf {u}}_i&={\mathbf {K}}_{\alpha i}\cdot \sum _{j\in {\mathcal {S}}_i}{\mathbf {u}}_{ij}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{p}^{\mathbbm {l}}_j \Delta V_j={\mathbf {K}}_{\alpha i} \varvec{p}^{\mathbbm {l}}_{\mathbbm {w}i} \Delta {\mathbf {u}}_i \end{aligned}$$
(31)
$$\begin{aligned} \tilde{\partial }_\alpha \delta {\mathbf {u}}_i&={\mathbf {K}}_{\alpha i}\cdot \sum _{j\in {\mathcal {S}}_i}\delta {\mathbf {u}}_{ij}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \varvec{p}^{\mathbbm {l}}_j \Delta V_j={\mathbf {K}}_{\alpha i} \varvec{p}^{\mathbbm {l}}_{\mathbbm {w}i} \delta \Delta {\mathbf {u}}_i \end{aligned}$$
(32)

where

$$\begin{aligned} {\mathbf {K}}_{\alpha i}&=\mathbb {L}_i^{-1}\Big (\sum _{j\in {\mathcal {S}}_i}{ \mathbbm {w}}(\varvec{\xi }_{ij})\varvec{p}_{j}^{\mathbbm {l}}\otimes (\varvec{p}_{j}^{\mathbbm {l}})^T \Delta V_{j}\Big )^{-1}\nonumber \\ \varvec{p}^{\mathbbm {l}}_{\mathbbm {w}i}&=\Big ({ \mathbbm {w}}(\varvec{\xi }_{ij_1}) \varvec{p}^{\mathbbm {l}}_{j_1}\Delta V_{j_1},\ldots ,{ \mathbbm {w}}(\varvec{\xi }_{ij_{n_i}}) \varvec{p}^{\mathbbm {l}}_{j_{n_i}}\Delta V_{j_{n_i}}\Big )\nonumber \\ \Delta {\mathbf {u}}_i&=({\mathbf {u}}_{i j_1},\ldots ,{\mathbf {u}}_{i j_k},\ldots ,{\mathbf {u}}_{i j_{n}})^T \end{aligned}$$
(33)

The nonlocal operator gives all partial derivatives with the highest order up to \(\mathbbm {n}\). In PDEs, the group of derivatives is a subgroup of the nonlocal operator. Each term in \(\tilde{\partial }_\alpha {\mathbf {u}}_i\) corresponds to a row of \({\mathbf {K}}_{\alpha i} \varvec{p}^{\mathbbm {l}}_{\mathbbm {w}i}\) multiplied by \(\Delta {\mathbf {u}}_i\). Equation 31 can be used to substitute the differential operators in PDEs to generate a strong form of algebraic equations. Meanwhile, we can solve the linear (nonlinear) weak formulations using the weighted residual methodology and the variational principle, hence the variation of \(\partial _\alpha {\mathbf {u}}_i\) in Eq. 32 is required in these circumstances. Equation 31 can also be shown more succinctly as

$$\begin{aligned} \tilde{\partial }_\alpha {\mathbf {u}}_i={\mathbf {K}}_{\alpha i} \varvec{p}^{\mathbbm {l}}_{\mathbbm {w}i} \Delta {\mathbf {u}}_i=\begin{bmatrix}-(1,\cdots ,1)_{n}{\mathbf {K}}_{\alpha i} {\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}}, {\mathbf {K}}_{\alpha i}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} \end{bmatrix}\begin{bmatrix}{\mathbf {u}}_i \\ {\mathbf {u}}_{j_1}\\ {\mathbf {u}}_{j_2}\\ \cdots \\ {\mathbf {u}}_{j_{n}}\\ \end{bmatrix}={\mathbf {B}}_{\alpha i}{\mathbf {U}}_i \end{aligned}$$
(34)

where \({\mathbf {B}}_{\alpha i}\) is the nonlocal operator coefficient matrix of point \({\mathbf {x}}_i\), \((1,\cdots ,1)_{n_p} {\mathbf {K}}_{\alpha i}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}}\) is the column sum of \({\mathbf {K}}_{\alpha i}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}}\). Using the nodal values in support, the operator matrix generates all partial derivatives of maximal order smaller than \(|\alpha |+1\).

3.3 Elastic material constitution

For elastic material, the strain energy functional \(\psi\) is a function of the deformation gradient \({\varvec{F}}\). According to the principles of traditional solid mechanics, the deformation gradient \({\varvec{F}}\) in 3D form expressed as

$$\begin{aligned} {\varvec{F}}=\nabla \mathbf {u} +{\mathbf {I}}_{3\times 3} = \begin{bmatrix} \frac{{\partial u}}{ \partial x}+1 &{} \frac{{\partial u}}{ \partial y} &{} \frac{{\partial u}}{ \partial z} \\ \frac{{\partial v}}{ \partial x} &{} \frac{{\partial v}}{ \partial y}+1 &{} \frac{{\partial v}}{ \partial z} \\ \frac{{\partial w}}{ \partial x} &{} \frac{{\partial w}}{ \partial y} &{} \frac{{\partial w}}{ \partial z}+1 \\ \end{bmatrix} \end{aligned}$$
(35)

where \({\mathbf {I}}_{3\times 3}\) denotes the identity tensor.

The first Piola–Kirchhoff stress \({\mathbf {P}}\) can be derived from the directly derivative of strain energy \(\psi ({\varvec{F}})\) in the context of total Lagrangian formulation, and it can be derived as

$$\begin{aligned} {\mathbf {P}}=\frac{\partial \psi ({\varvec{F}})}{\partial {\varvec{F}}}=\begin{bmatrix}\mathbb {P}_{11} &{} \mathbb {P}_{12} &{} \mathbb {P}_{13}\\ \mathbb {P}_{21}&{} \mathbb {P}_{22} &{} \mathbb {P}_{23}\\ \mathbb {P}_{31}&{} \mathbb {P}_{32} &{} \mathbb {P}_{33}\end{bmatrix} \end{aligned}$$
(36)

In addition, the 4th order elastic tensor \({\mathbf {D}}_4\) can be obtained using derivation of the first Piola–Kirchhoff stress

$$\begin{aligned} {\mathbf {D}}_4=\frac{\partial {\mathbf {P}}}{\partial {\varvec{F}}}=\frac{\partial {^2 \psi ({\varvec{F}})}}{\partial {{\varvec{F}}^T \partial {\varvec{F}}}} \end{aligned}$$
(37)

To obtain the elasticity matrix, based on the Voigt notation, \({\mathbf {D}}_4\) can be written as a matrix form \(\mathscr {D}_{9\times 9}\)

$$\begin{aligned} {\mathscr {D}_{9\times 9}}=\begin{bmatrix} \frac{\partial \mathbb {P}_{11}}{\partial \mathbb {F}_{11}} &{} \frac{\partial \mathbb {P}_{11}}{\partial \mathbb {F}_{12}}&{}\cdots &{}\frac{\partial \mathbb {P}_{11}}{\partial \mathbb {F}_{33}}\\ \frac{\partial \mathbb {P}_{12}}{\partial \mathbb {F}_{11}} &{} \frac{\partial \mathbb {P}_{12}}{\partial \mathbb {F}_{12}}&{}\cdots &{}\frac{\partial \mathbb {P}_{12}}{\partial \mathbb {F}_{33}}\\ \vdots &{}\vdots &{}\ddots &{}\vdots \\ \frac{\partial \mathbb {P}_{33}}{\partial \mathbb {F}_{11}} &{} \frac{\partial \mathbb {P}_{33}}{\partial \mathbb {F}_{12}}&{}\cdots &{}\frac{\partial \mathbb {P}_{33}}{\partial \mathbb {F}_{33}}\\ \end{bmatrix} = \begin{bmatrix} \frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{11}^{2}} &{} \frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{11}\,\partial \mathbb {F}_{12}}&{}\cdots &{}\frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{11}\,\partial \mathbb {F}_{33}}\\ \frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{12}\partial \mathbb {F}_{11}} &{} \frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{22}^{2}}&{}\cdots &{}\frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{12}\,\partial \mathbb {F}_{33}}\\ \vdots &{}\vdots &{}\ddots &{}\vdots \\ \frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{33}\partial \mathbb {F}_{11}} &{} \frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{33}\,\partial \mathbb {F}_{12}}&{}\cdots &{}\frac{\partial ^{2}\psi (\mathbb {F})}{\partial \mathbb {F}_{33}^{2}}\\ \end{bmatrix}, \end{aligned}$$
(38)

where \(\mathbb {F}(=\mathbb {F}_{11} , \mathbb {F}_{12} ,\cdots , \mathbb {F}_{33}), \mathbb {P}(=\frac{\partial \psi (\mathbb {F})}{\partial \mathbb {F}_{11}},\frac{\partial \psi (\mathbb {F})}{\partial \mathbb {F}_{12}},\cdots ,\frac{\partial \psi (\mathbb {F})}{\partial \mathbb {F}_{33}})\) donates the flattened deformation gradient and flattened first Piola–Kirchhoff stress.

In particular, for isotropic linear elastic material, regarding infinitesimal deformations of a continuous linear elastic material with a tiny displacement gradient relative to unity ( i.e. \(\nabla \mathbf {u} \ll 1\)), any of the strain tensors utilized in finite strain theory (such as the Lagrangian strain tensor) may be geometrically linearized. The non-linear or second-order elements of the finite strain tensor are ignored in this linearization. Hence, we can obtain the Lagrangian strain tensor \(\varvec{\varepsilon }=\frac{1}{2}({\varvec{F}}+{\varvec{F}}^T)-{\mathbf {I}}\) and stress tensor \(\varvec{\sigma }={\mathbf {D}}:\varvec{\varepsilon }\).

The internal functional energy for 3D linear elastic material can be expressed as

$$\begin{aligned} \psi (\varvec{\varepsilon })_{3d}&=\frac{1}{2}{\varvec{\sigma }}:\varvec{\varepsilon } =\frac{1}{2}\varvec{\varepsilon }:{\mathbf {D}}:\varvec{\varepsilon } =\frac{1}{2}\text {d}\mathscr {U}_{3d}^T \mathscr {D}_{3d} \text {d}\mathscr {U}_{3d} \end{aligned}$$
(39)

Likewise, the internal energy functional for plane stress and plane strain conditions can be shown as follows

$$\begin{aligned} \psi (\varvec{\varepsilon })_\mathrm{{plane\,stress}}=\frac{1}{2}\text {d}\mathscr {U}_{2d}^T \mathscr {D}_\mathrm{{plane\,stress}} \text {d}\mathscr {U}_{2d}\nonumber \\ \psi (\varvec{\varepsilon })_\mathrm{{plane\,strain}}=\frac{1}{2}\text {d}\mathscr {U}_{2d}^T \mathscr {D}_\mathrm{{plane\,strain}} \text {d}\mathscr {U}_{2d} \end{aligned}$$
(40)

where

$$\begin{aligned} \text {d}\mathscr {U}_{2d}&=\left( \frac{{\partial u}}{ \partial x},\frac{{\partial u}}{ \partial y},\frac{{\partial v}}{ \partial x},\frac{{\partial v}}{ \partial y}\right) ^T \end{aligned}$$
(41)
$$\begin{aligned} \text {d}\mathscr {U}_{3d}&=\left( \frac{{\partial u}}{ \partial x},\frac{{\partial u}}{ \partial y},\frac{{\partial u}}{ \partial z},\frac{{\partial v}}{ \partial x},\frac{{\partial v}}{ \partial y},\frac{{\partial v}}{ \partial z},\frac{{\partial w}}{ \partial x},\frac{{\partial w}}{ \partial y},\frac{{\partial w}}{ \partial z}\right) ^T \end{aligned}$$
(42)

For linear elastic material, the elastic matrix \(\mathscr {D}\) in plane stress, plane strain and 3D conditions can be expressed as

$$\begin{aligned}&\mathscr {D}_\mathrm{{plane\, stress}}=\frac{E}{1-\nu ^2}\left[ \begin{array}{cccc} 1 &{} 0 &{} 0 &{} \nu \\ 0 &{} \frac{1-\nu }{2} &{} \frac{1-\nu }{2} &{} 0 \\ 0 &{} \frac{1-\nu }{2} &{} \frac{1-\nu }{2} &{} 0 \\ \nu &{} 0 &{} 0 &{} 1 \\ \end{array} \right] , \end{aligned}$$
(43)
$$\begin{aligned}&\mathscr {D}_\mathrm{{plane \, strain}}=\frac{E}{(1-2\nu )(1+\nu )}\left[ \begin{array}{cccc} 1-\nu &{} 0 &{} 0 &{} \nu \\ 0 &{} 1/2-\nu &{} 1/2-\nu &{} 0 \\ 0 &{} 1/2-\nu &{} 1/2-\nu &{} 0 \\ \nu &{} 0 &{} 0 &{} 1-\nu \\ \end{array} \right] , \end{aligned}$$
(44)
$$\begin{aligned}&\mathscr {D}_{3D}=\left[ \begin{array}{ccccccccc} \lambda +2 \mu &{} 0 &{} 0 &{} 0 &{} \lambda &{} 0 &{} 0 &{} 0 &{} \lambda \\ 0 &{} \mu &{} 0 &{} \mu &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 \\ 0 &{} 0 &{} \mu &{} 0 &{} 0 &{} 0 &{} \mu &{} 0 &{} 0 \\ 0 &{} \mu &{} 0 &{} \mu &{} 0 &{} 0 &{} 0 &{} 0 &{} 0 \\ \lambda &{} 0 &{} 0 &{} 0 &{} \lambda +2 \mu &{} 0 &{} 0 &{} 0 &{} \lambda \\ 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} \mu &{} 0 &{} \mu &{} 0 \\ 0 &{} 0 &{} \mu &{} 0 &{} 0 &{} 0 &{} \mu &{} 0 &{} 0 \\ 0 &{} 0 &{} 0 &{} 0 &{} 0 &{} \mu &{} 0 &{} \mu &{} 0 \\ \lambda &{} 0 &{} 0 &{} 0 &{} \lambda &{} 0 &{} 0 &{} 0 &{} \lambda +2 \mu \\ \end{array} \right] , \end{aligned}$$
(45)

where \(\lambda ,\mu\) represent the Lamé constants, which are related to the Young’s modulus E and Poisson’s ratio \(\nu\):

$$\begin{aligned} \left\{ \begin{aligned}&\lambda =\frac{E \nu }{(1+\nu )(1-2\nu )}\\&\mu =\frac{E}{2(1+\nu )} \end{aligned} \right. . \end{aligned}$$
(46)

3.4 Construction of the first-order and higher-order operator energy functional

As a particle-based method, when using node integration the first-order and higher-order NOM suffer from a zero-energy mode [57, 58], which results in numerical instability. To eliminate the effect of the zero-energy mode, traditional PD and SPH introduce a penalty term to the force state [51]. Nevertheless, the approach described above is only applicable in the explicit time integration formulation. NOM employs operator energy functional for nonlocal gradients to achieve the linear field of the field and avoid numerical instabilities.

In first-order NOM, the operator energy functional at point \({\mathbf {x}}_i\) can be construct according to the first-order nonlocal operator \(\nabla \otimes {\mathbf {u}}_i\), it can be expressed in discretization form as

$$\begin{aligned} {\mathcal {F}}^{hg}_i&=\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\int _{{\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij})\Big ([\left( u_j-u_i\right) -\nabla {u_i}\cdot \varvec{\xi }_{ij}]^2+[\left( v_j-v_i\right) -\nabla {v_i}\cdot \varvec{\xi }_{ij}]^2+\nonumber \\&[\left( w_j-w_i\right) -\nabla {w_i}\cdot \varvec{\xi }_{ij}]^2\Big )\text {d}V_j\nonumber \\&=\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\sum _{j\in {\mathcal {S}}_{i}}{ \mathbbm {w}}(\varvec{\xi }_{ij}) \Big ([\left( u_j-u_i\right) -\nabla {u_i}\cdot \varvec{\xi }_{ij}]^2+ [\left( v_j-v_i\right) -\nabla {v_i}\cdot \varvec{\xi }_{ij}]^2+\nonumber \\&[\left( w_j-w_i\right) -\nabla {w_i}\cdot \varvec{\xi }_{ij}]^2\Big ) \Delta V_j \nonumber \\&=\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\Bigg (\sum _{j\in {\mathcal {S}}_{i}} { \mathbbm {w}}(\varvec{\xi }_{ij})\Big (\left( u_j-u_i\right) ^2+\left( v_j-v_i\right) ^2+ \left( w_j-w_i\right) ^2\Big ) \Delta V_j-\nabla \otimes {\mathbf {u}}_i:\nabla \otimes {\mathbf {u}}_i\cdot {\mathbf {K}}_i \Bigg ) \end{aligned}$$
(47)

where \(\nabla {u_i}=[\frac{{\partial u_i}}{ \partial x} ,\frac{{\partial u_i}}{ \partial y},\frac{{\partial u_i}}{ \partial z}]^T\), \(\nabla \otimes {\mathbf {u}}_i=\begin{bmatrix} \frac{{\partial u_i}}{ \partial x}&{}\frac{{\partial u_i}}{ \partial y}&{}\frac{{\partial u_i}}{ \partial z} \\ \frac{{\partial v_i}}{ \partial x} &{}\frac{{\partial v_i}}{ \partial y}&{}\frac{{\partial v_i}}{ \partial z} \\ \frac{{\partial w_i}}{ \partial x} &{}\frac{{\partial w_i}}{ \partial y}&{}\frac{{\partial w_i}}{ \partial z} \end{bmatrix}\), \({\mathbf {K}}_i=\begin{bmatrix} k_{11} &{} k_{12} &{} k_{13}\\ k_{12} &{} k_{22} &{}k_{23}\\ k_{13}&{} k_{23}&{} k_{33}\end{bmatrix}\).

It should be noted that the shape tensor \({\mathbf {K}}_i\) is involved in \(\nabla \otimes {\mathbf {u}}_i:\nabla \otimes {\mathbf {u}}_i\cdot {\mathbf {K}}_i\) and the operator energy functional is valid in any dimension.

For convenience, we let \(\Theta =\frac{1}{ 2}\nabla \otimes {\mathbf {u}}_i:\nabla \otimes {\mathbf {u}}_i\cdot {\mathbf {K}}_i\) , \(\Upsilon _{3d}=\frac{1}{ 2}[\left( u_j-u_i\right) ^2+\left( v_j-v_i\right) ^2+\left( w_j-w_i\right) ^2]\).

$$\begin{aligned} \Theta _{3d}=&\frac{1}{2}\begin{bmatrix} \frac{{\partial u_i}}{ \partial x}&{}\frac{{\partial u_i}}{ \partial y}&{}\frac{{\partial u_i}}{ \partial z} \\ \frac{{\partial v_i}}{ \partial x}&{}\frac{{\partial v_i}}{ \partial y}&{}\frac{{\partial v_i}}{ \partial z} \\ \frac{{\partial w_i}}{ \partial x} &{}\frac{{\partial w_i}}{ \partial y}&{}\frac{{\partial w_i}}{ \partial z} \end{bmatrix} \Bigg (\begin{bmatrix} \frac{{\partial u_i}}{ \partial x} &{}\frac{{\partial u_i}}{ \partial y}&{}\frac{{\partial u_i}}{ \partial z} \\ \frac{{\partial v_i}}{ \partial x} &{}\frac{{\partial v_i}}{ \partial y}&{}\frac{{\partial v_i}}{ \partial z} \\ \frac{{\partial w_i}}{ \partial x} &{}\frac{{\partial w_i}}{ \partial y}&{}\frac{{\partial w_i}}{ \partial z} \end{bmatrix}\begin{bmatrix} k_{11} &{}k_{12}&{}k_{13} \\ k_{21} &{}k_{22}&{}k_{23} \\ k_{31} &{}k_{32}&{}k_{33}\end{bmatrix}\Bigg )\nonumber \\ =&\frac{1}{ 2}\Bigg ( \frac{{\partial u_i}}{ \partial x}[k_{11} \frac{{\partial u_i}}{ \partial x}+k_{12}\frac{{\partial u_i}}{ \partial y}+k_{13}\frac{{\partial u_i}}{ \partial z}]+ \frac{{\partial u_i}}{ \partial y}[k_{12}\frac{{\partial u_i}}{ \partial x}+k_{22}\frac{{\partial u_i}}{ \partial y}+k_{23}\frac{{\partial u_i}}{ \partial z}]+\nonumber \\&\frac{{\partial u_i}}{ \partial z}[k_{13}\frac{{\partial u_i}}{ \partial x}+k_{23}\frac{{\partial u_i}}{ \partial y}+k_{33}\frac{{\partial v_i}}{ \partial z}]+\frac{{\partial v_i}}{ \partial x}[k_{11}\frac{{\partial v_i}}{ \partial x}+k_{12}\frac{{\partial v_i}}{ \partial y}+k_{13}\frac{{\partial v_i}}{ \partial z}]+\nonumber \\&\frac{{\partial v_i}}{ \partial y}[k_{12}\frac{{\partial v_i}}{ \partial x}+k_{22}\frac{{\partial v_i}}{ \partial y}+k_{23}\frac{{\partial v_i}}{ \partial z}]+\frac{{\partial v_i}}{ \partial z}[k_{13}\frac{{\partial v_i}}{ \partial x}+k_{23}\frac{{\partial v_i}}{ \partial y}+k_{33}\frac{{\partial v_i}}{ \partial z}]+\nonumber \\&\frac{{\partial w_i}}{ \partial x}[k_{11}\frac{{\partial w_i}}{ \partial x}+k_{12}\frac{{\partial w_i}}{ \partial y}+k_{13}\frac{{\partial w_i}}{ \partial z}]+\frac{{\partial w_i}}{ \partial y}[k_{12}\frac{{\partial w_i}}{ \partial x}+k_{22}\frac{{\partial w_i}}{ \partial y}+k_{23}\cdot \frac{{\partial w_i}}{ \partial z}]+\nonumber \\&\frac{{\partial w_i}}{ \partial z}[k_{13}\frac{{\partial w_i}}{ \partial x}+k_{23}\frac{{\partial w_i}}{ \partial y}+k_{33}\frac{{\partial w_i}}{ \partial z}]\Bigg ) \end{aligned}$$
(48)

To facilitate numerical implementation, we transform Eq. 47 into a detailed form and the point \({\mathbf {x}}_i\) displacement vector and first-order differential of displacement vector in 3D can be shown as

$$\begin{aligned} \mathscr {U}_i&= ( u_{i},v_{i},w_{i},u_{j1},v_{j1},w_{j1}\cdots u_{jn},v_{jn},w_{jn})^T \nonumber \\ \text {d}\mathscr {U}_i&=(\frac{\partial u_{i}}{ \partial x},\frac{\partial u_{i}}{ \partial y},\frac{\partial u_{i}}{ \partial z},\frac{\partial v_{i}}{ \partial x},\frac{\partial v_{i}}{ \partial y},\frac{\partial v_{i}}{ \partial z},\frac{\partial w_{i}}{ \partial x},\frac{\partial w_{i}}{ \partial y},\frac{\partial w_{i}}{ \partial z})^T \end{aligned}$$
(49)

In this paper, the special variation \(\bar{\delta }{\mathcal {F}}\) , \(\bar{\delta }^2 {\mathcal {F}}\) and \(\delta {\mathcal {F}}\) , \(\delta ^2 {\mathcal {F}}\) are defined as

$$\begin{aligned} \bar{\delta }{\mathcal {F}}&:=\partial _{\text {d}\mathscr {U}} {\mathcal {F}},\bar{\delta }^2 {\mathcal {F}}:=\partial _{\text {d}\mathscr {U}\text {d}\mathscr {U}} {\mathcal {F}}\end{aligned}$$
(50)
$$\begin{aligned} \delta {\mathcal {F}}&:=\partial _{\mathscr {U}}{\mathcal {F}},\delta ^2 {\mathcal {F}}:=\partial _{\mathscr {U}\mathscr {U}} {\mathcal {F}}\end{aligned}$$
(51)

Hence, the following relationships can be derived as

$$\begin{aligned} \bar{\delta }\Theta _{3d}=&\partial _{\text {d}\mathscr {U}_{3d}} \Theta _{3d}\nonumber \\ =&\begin{bmatrix} [k_{11}\frac{\partial u_i}{ \partial x}+k_{12}\frac{\partial u_i}{ \partial y}+k_{13}\frac{\partial u_i}{ \partial z}]&{}[k_{12}\frac{\partial u_i}{ \partial x}+k_{22}\frac{\partial u_i}{ \partial y}+k_{23}\frac{\partial u_i}{ \partial z}]&{}[k_{13}\frac{\partial u_i}{ \partial x}+k_{23}\frac{\partial u_i}{ \partial y}+k_{33}\frac{\partial v_i}{ \partial z}] \\ [k_{11}\frac{\partial v_i}{ \partial x}+k_{12}\frac{\partial v_i}{ \partial y}+k_{13}\frac{\partial v_i}{ \partial z}]&{}[k_{12}\frac{\partial v_i}{ \partial x}+k_{22}\frac{\partial v_i}{ \partial y}+k_{23}\frac{\partial v_i}{ \partial z}] &{}[k_{13}\frac{\partial v_i}{ \partial x}+k_{23}\frac{\partial v_i}{ \partial y}+k_{33}\frac{\partial v_i}{ \partial z}] \\ [k_{11}\frac{\partial w_i}{ \partial x}+k_{12}\frac{\partial w_i}{ \partial y}+k_{13}\frac{\partial w_i}{ \partial z}]&{}[k_{12}\frac{\partial w_i}{ \partial x}+k_{22}\frac{\partial w_i}{ \partial y}+k_{23}\frac{\partial w_i}{ \partial z}]&{}[k_{13}\frac{\partial w_i}{ \partial x}+k_{23}\frac{\partial w_i}{ \partial y}+k_{33}\frac{\partial w_i}{ \partial z}] \end{bmatrix} \end{aligned}$$
(52)
$$\begin{aligned} \bar{\delta }^2 \Theta _{3d}=&\partial _{\text {d}\mathscr {U}_{3d}\text {d}\mathscr {U}_{3d}} \Theta _{3d}\nonumber \\ =&\partial _{\text {d}\mathscr {U}_{3d}} \bar{\delta }\Theta _{3d}\nonumber \\ =&\begin{bmatrix} k_{11}&{} k_{12}&{} k_{13}&{} 0&{} 0 &{}0 &{}0 &{}0&{} 0 \\ k_{12}&{} k_{22}&{} k_{23}&{} 0&{} 0 &{}0 &{}0 &{}0&{} 0 \\ k_{13}&{} k_{23}&{} k_{33}&{} 0&{} 0 &{}0 &{}0 &{}0&{} 0 \\ 0&{} 0 &{}0 &{} k_{11}&{} k_{12}&{} k_{13} &{}0 &{}0&{} 0\\ 0&{} 0 &{}0 &{} k_{12}&{} k_{22}&{} k_{23} &{}0 &{}0&{} 0\\ 0&{} 0 &{}0 &{} k_{13}&{} k_{23}&{} k_{33} &{}0 &{}0&{} 0\\ 0&{} 0 &{}0 &{}0 &{}0&{} 0&{} k_{11}&{} k_{12}&{} k_{13}\\ 0&{} 0 &{}0 &{}0 &{}0&{} 0&{} k_{12}&{} k_{22}&{} k_{23}\\ 0&{} 0 &{}0 &{}0 &{}0&{} 0&{} k_{13}&{} k_{23}&{} k_{33}\\ \end{bmatrix} \end{aligned}$$
(53)
$$\begin{aligned} \delta \Upsilon _{3d}=&\partial _{\mathscr {U}_{3d}} \Upsilon _{3d}\nonumber \\ =&\partial _{\mathscr {U}_{3d}}\{\frac{1}{ 2}[\left( u_j-u_i\right) ^2+\left( v_j-v_i\right) ^2+\left( w_j-w_i\right) ^2]\}\nonumber \\ =&\begin{bmatrix} (u_i-u_j ),(v_i-v_j ),(w_i-w_j ),(-u_i+u_j ),(-v_i+v_j ),(-w_i+w_j ) \end{bmatrix} \end{aligned}$$
(54)
$$\begin{aligned} \delta ^2\Upsilon _{3d}=&\partial _{\mathscr {U}_{3d}\mathscr {U}_{3d}} \Upsilon _{3d}\nonumber \\ =&\partial _{\mathscr {U}_{3d}}\{(u_i-u_j ),(v_i-v_j ),(w_i-w_j ),(-u_i+u_j ),(-v_i+v_j ),(-w_i+w_j )\}\nonumber \\ =&\begin{bmatrix} 1&{}0&{}0&{}-1&{}0&{}0\\ 0&{}1&{}0&{}0&{}-1&{}0\\ 0&{}0&{}1&{}0&{}0&{}-1\\ -1&{}0&{}0&{}1&{}0&{}0\\ 0&{}-1&{}0&{}0&{}1&{}0\\ 0&{}0&{}-1&{}0&{}0&{}1\\ \end{bmatrix} \end{aligned}$$
(55)

According to Eqs. 53 and 55, Eq. 47 can be rewritten as

$$\begin{aligned} {\mathcal {F}}^{hg}_i&=\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\Bigg (\sum _{j\in {\mathcal {S}}_{i}} { \mathbbm {w}}(\varvec{\xi }_{ij})\Big (\left( u_j-u_i\right) ^2+\left( v_j-v_i\right) ^2+\left( w_j-w_i\right) ^2\Big ) \Delta V_j-\nabla \otimes {\mathbf {u}}_i:\nabla \otimes {\mathbf {u}}_i\cdot {\mathbf {K}}_i\Bigg )\nonumber \\&=\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\Big ({\mathscr {U}_i}^T\begin{bmatrix}\sum _{j\in {\mathcal {S}}_{i}} {\mathbf {I}}_j &{} -{\mathbf {I}}_{j1} &{} \cdots &{} -{\mathbf {I}}_{j_n}\nonumber \\ -{\mathbf {I}}_{j1} &{} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ \vdots &{} {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ -{\mathbf {I}}_{j_n} &{} {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}\mathscr {U}_i-{\text {d}\mathscr {U}_i}^T \begin{bmatrix}{\mathbf {K}}_i&{} 0 &{} 0\\ 0 &{} {\mathbf {K}}_i&{}0 \\ 0&{} 0&{} {\mathbf {K}}_i\end{bmatrix}\text {d}\mathscr {U}_i\Big )\nonumber \\&=\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\Big ({\mathscr {U}_i}^T\begin{bmatrix}\sum _{j\in {\mathcal {S}}_{i}} {\mathbf {I}}_j &{} -{\mathbf {I}}_{j1} &{} \cdots &{} -{\mathbf {I}}_{j_n} \\ -{\mathbf {I}}_{j1} &{} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ \vdots &{} {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ -{\mathbf {I}}_{j_n} &{} {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}\mathscr {U}_i-{\mathscr {U}_i}^T {\mathscr {B}_i}^T \begin{bmatrix}{\mathbf {K}}_i&{} 0 &{} 0\\ 0 &{} {\mathbf {K}}_i&{}0 \\ 0&{} 0&{} {\mathbf {K}}_i\end{bmatrix} {\mathscr {B}_i} \mathscr {U}_i\Big )\nonumber \\&=\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}{\mathscr {U}_i}^T\Big (\begin{bmatrix}\sum _{j\in {\mathcal {S}}_{i}} {\mathbf {I}}_j &{} -{\mathbf {I}}_{j1} &{} \cdots &{} -{\mathbf {I}}_{j_n} \\ -{\mathbf {I}}_{j1} &{} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ \vdots &{} {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ -{\mathbf {I}}_{j_n} &{} {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}-{\mathscr {B}_i}^T \begin{bmatrix}{\mathbf {K}}_i&{} 0 &{} 0\\ 0 &{} {\mathbf {K}}_i&{}0 \\ 0&{} 0&{} {\mathbf {K}}_i\end{bmatrix} {\mathscr {B}_i} \Big )\mathscr {U}_i \end{aligned}$$
(56)

where \({\mathbf {I}}_j={ \mathbbm {w}}(\varvec{\xi }_{ij})\Delta V_j (1,1,1)\otimes (1,1,1)^T\).

$$\begin{aligned} \mathscr {K}^{hg}_{i}&=\partial _{\mathscr {U}_{i} \mathscr {U}_{i} }{\mathcal {F}}^{hg}_i=\frac{p^{hg}}{m_{{\mathbf {K}}_i}}\Bigg (\begin{bmatrix}\sum _{j\in {\mathcal {S}}_{i}} {\mathbf {I}}_j &{} -{\mathbf {I}}_{j1} &{} \cdots &{} -{\mathbf {I}}_{j_n} \\ -{\mathbf {I}}_{j1} &{} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ \vdots &{} {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ -{\mathbf {I}}_{j_n} &{} {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}-{\mathscr {B}_i}^T\begin{bmatrix}{\mathbf {K}}_i&{} 0 &{} 0\\ 0 &{} {\mathbf {K}}_i&{}0 \\ 0&{} 0&{} {\mathbf {K}}_i\end{bmatrix}{\mathscr {B}_i}\Bigg ) \end{aligned}$$
(57)

The global tangent stiffness matrix of operate energy functional, internal residual and tangent stiffness matrix of physical energy functional in support \({\mathcal {S}}_{i}\) can be obtained by

$$\begin{aligned} \mathop {\mathscr {K}_i} \limits ^{hg}=\sum _{j\in {\mathcal {S}}_{i}}\partial _{\mathscr {U}_{i} \mathscr {U}_{i} }{\mathcal {F}}^{hg}_i \Delta V_j =\sum _{j\in {\mathcal {S}}_{i}}\mathscr {K}^{hg}_{i}\Delta V_j \end{aligned}$$
(58)
$$\begin{aligned} \mathscr {R}_i=\sum _{j\in {\mathcal {S}}_{i}}\partial _{\mathscr {U}_i}\psi (\varvec{\varepsilon })_i \Delta V_j =\sum _{j\in {\mathcal {S}}_{i}}{\mathscr {B}_i}^T\cdot \mathscr {D}\cdot \Delta \mathscr {U}_i \Delta V_j \end{aligned}$$
(59)
$$\begin{aligned} \mathscr {K}_i=\sum _{j\in {\mathcal {S}}_{i}}\partial _{\mathscr {U}_i}\mathscr {R}_i \Delta V_j =\sum _{j\in {\mathcal {S}}_{i}}{\mathscr {B}_i}^T\cdot \mathscr {D}\cdot {\mathscr {B}_i}\Delta V_j \end{aligned}$$
(60)

Finally, the summation of 3D form for the first-order global tangent stiffness matrix and hourglass tangent stiffness matrix in support \({\mathcal {S}}_{i}\) can be obtained

$$\begin{aligned} \mathbb {K}_{i}&=\mathscr {K}_{i}+\mathop {\mathscr {K}_i} \limits ^{hg}\nonumber \\ {}&=\sum _{j\in {\mathcal {S}}_{i}} \Delta V_j\Bigg ({\mathscr {B}_i}^T\cdot \mathscr {D}\cdot \mathscr {B}_i+\frac{p^{hg}}{m_{{\mathbf {K}}_i}}\Big (\begin{bmatrix}\sum _{j\in {\mathcal {S}}_{i}} {\mathbf {I}}_j &{} -{\mathbf {I}}_{j1} &{} \cdots &{} -{\mathbf {I}}_{j_n} \\ -{\mathbf {I}}_{j1} &{} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ \vdots &{} {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ -{\mathbf {I}}_{j_n} &{} {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}-{\mathscr {B}_i}^T\begin{bmatrix}{\mathbf {K}}_i&{} 0 &{} 0\\ 0 &{} {\mathbf {K}}_i&{}0 \\ 0&{} 0&{} {\mathbf {K}}_i\end{bmatrix}{\mathscr {B}_i}\Big )\Bigg )\nonumber \\&=\sum _{j\in {\mathcal {S}}_{i}} \Delta V_j\Bigg ({\mathscr {B}_i}^T \Big (\mathscr {D}-\frac{p^{hg}}{m_{{\mathbf {K}}_i}}\begin{bmatrix}{\mathbf {K}}_i&{} 0 &{} 0\\ 0 &{} {\mathbf {K}}_i &{}0 \\ 0&{} 0&{} {\mathbf {K}}_i\end{bmatrix}\Big )\mathscr {B}_i+\frac{p^{hg}}{m_{{\mathbf {K}}_i}}\begin{bmatrix}\sum _{j\in {\mathcal {S}}_{i}} {\mathbf {I}}_j &{} -{\mathbf {I}}_{j1} &{} \cdots &{} -{\mathbf {I}}_{j_n} \\ -{\mathbf {I}}_{j1} &{} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ \vdots &{} {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ -{\mathbf {I}}_{j_n} &{} {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}\Bigg ) \end{aligned}$$
(61)

The derivation of the first-order hourglass tangent stiffness matrix and the global tangent stiffness matrix in 2D form is given in Appendix B.

The operator energy functional for higher-order NOM at point \({\mathbf {x}}_i\) can be construct according to the higher-order nonlocal operator \(\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i\), it can be expressed as

$$\begin{aligned} {\mathcal {F}}^{hg}_{\alpha i}=&\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\sum _{j \in {\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij})\big ({\mathbf {u}}_{ij}-(\varvec{p}_j^{\mathbbm {l}})^T\tilde{\partial }^{\mathbbm {l}}_\alpha {\mathbf {u}}_i \big )^2 \Delta V_j\nonumber \\ =&\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\sum _{j\in {\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij})\big ({\mathbf {u}}_{ij}^2+\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i^T \varvec{p}^{\mathbbm {l}}_j\otimes (\varvec{p}_j^{\mathbbm {l}})^T\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i-2 {\mathbf {u}}_{ij} (\varvec{p}_j^{\mathbbm {l}})^T\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i\big )\Delta V_j\nonumber \\ =&\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\Big (\sum _{j\in {\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij}) {\mathbf {u}}_{ij}^2\Delta V_j+\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i^T \sum _{j\in {\mathcal {S}}_i}{ \mathbbm {w}}(\varvec{\xi }_{ij})\varvec{p}^{\mathbbm {l}}_j\otimes (\varvec{p}_j^{\mathbbm {l}})^T \Delta V_j\,\,\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i-2 \Delta {\mathbf {u}}_i^T\varvec{p}_{\mathbbm {w}i}^T \partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i\Big )\nonumber \\ =&\frac{p^{hg}}{2m_{{\mathbf {K}}_i}}\Big (\sum _{j\in {\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij}) {\mathbf {u}}_{ij}^2\Delta V_j+\tilde{\partial }_\alpha {\mathbf {u}}_i^T \mathbb {L}_i \sum _{j\in {\mathcal {S}}_i}{ \mathbbm {w}}(\varvec{\xi }_{ij})\varvec{p}^{\mathbbm {l}}_j\otimes (\varvec{p}_j^{\mathbbm {l}})^T \Delta V_j\,\,\mathbb {L}_i\partial ^{\mathbbm {l}}_\alpha {\mathbf {u}}_i-2 \Delta {\mathbf {u}}_i^T(\varvec{p}_{\mathbbm {w}i}^{{\mathbbm {l}}})^T \mathbb {L}_i\tilde{\partial }_\alpha {\mathbf {u}}_i\Big ) \end{aligned}$$
(62)

By submitting the Eq. 34 into the below Eq. 62 and it can be rewritten as

$$\begin{aligned} {\mathcal {F}}^{hg}_{\alpha i} =&\frac{p^{hg}}{2m_{{\mathbf {K}}_{i}}}\Big (\sum _{j\in {\mathcal {S}}_i} { \mathbbm {w}}(\varvec{\xi }_{ij}) {\mathbf {u}}_{ij}^2\Delta V_j-\Delta {\mathbf {u}}_i^T(\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}})^T \big (\sum _{j\in {\mathcal {S}}_i}{ \mathbbm {w}}(\varvec{\xi }_{ij})\varvec{p}^{\mathbbm {l}}_j\otimes (\varvec{p}_j^{\mathbbm {l}})^T \Delta V_j\big )^{-1}\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}}\Delta {\mathbf {u}}_i\Big )\nonumber \\ =&\frac{p^{hg}}{2m_{{\mathbf {K}}_{ i}}}\Big (\Delta {\mathbf {u}}_{i}^T \text{ diag }\big [{ \mathbbm {w}}(\varvec{\xi }_{j_1})\Delta V_{j_1},\ldots ,{ \mathbbm {w}}(\varvec{\xi }_{j_{n_i}})\Delta V_{j_{n_i}}\big ] \Delta {\mathbf {u}}_i-\Delta {\mathbf {u}}_i^T(\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}})^T {\mathbf {K}}_{\alpha i}\mathbb {L}_i \varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}} \Delta {\mathbf {u}}_i\Big )\nonumber \\ =&\frac{p^{hg}}{2m_{{\mathbf {K}}_{ i}}}\Delta {\mathbf {u}}_{i}^T \Big ( \begin{bmatrix} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}-(\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}})^T {\mathbf {K}}_{\alpha i}\mathbb {L}_i\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}}\Big )\Delta {\mathbf {u}}_i\nonumber \\ =&\frac{p^{hg}}{2m_{{\mathbf {K}}_{ i}}}({\mathbf {K}}_{\alpha i}^{-1}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} {\mathbf {B}}_{\alpha i}{\mathbf {U}}_i)^T \Big ( \begin{bmatrix} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}-(\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}})^T {\mathbf {K}}_{ i}\mathbb {L}_i\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}}\Big ){\mathbf {K}}_{\alpha i}^{-1}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} {\mathbf {B}}_{\alpha i}{\mathbf {U}}_i \end{aligned}$$
(63)

where \({\mathbf {I}}_j={ \mathbbm {w}}(\varvec{\xi }_{ij})\Delta V_j (1,1,1)\otimes (1,1,1)^T\).

The first and second derivative \({\mathcal {F}}^{hg}_{\alpha i}\) yield the higher-order residual and the tangent stiffness matrix of operator energy functional and can be expressed as

$$\begin{aligned} \mathscr {R}^{hg}_{\alpha i}&=\frac{\partial {\mathcal {F}}^{hg}_{\alpha i}}{\partial {\mathbf {U}}_i }\nonumber \\&=\frac{p^{hg}}{m_{{\mathbf {K}}_{ i}}}({\mathbf {K}}_{\alpha i}^{-1}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} {\mathbf {B}}_{\alpha i})^T \Big ( \begin{bmatrix} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}-(\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}})^T {\mathbf {K}}_{\alpha i}\mathbb {L}_i\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}}\Big ) {\mathbf {K}}_{\alpha i}^{-1}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} {\mathbf {B}}_{\alpha i}{\mathbf {U}}_i \end{aligned}$$
(64)
$$\begin{aligned} \mathscr {K}^{hg}_{\alpha i}&=\frac{\partial \mathscr {R}^{hg}_{\alpha i}}{\partial {\mathbf {U}}_i ^T}=\frac{\partial ^2{\mathcal {F}}^{hg}_{\alpha i}}{\partial {\mathbf {U}}_i \partial {\mathbf {U}}_i ^T}\nonumber \\&=\frac{p^{hg}}{m_{{\mathbf {K}}_{i}}}({\mathbf {K}}_{\alpha i}^{-1}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} {\mathbf {B}}_{\alpha i})^T \Big ( \begin{bmatrix} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}-(\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}})^T {\mathbf {K}}_{\alpha i}\mathbb {L}_i\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}}\Big ) {\mathbf {K}}_{\alpha i}^{-1}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} {\mathbf {B}}_{\alpha i} \end{aligned}$$
(65)

The higher-order global tangent stiffness matrix of operator energy functional in support \({\mathcal {S}}_{i}\) can be computed by

$$\begin{aligned} \mathop {\mathscr {K}_{\alpha i}} \limits ^{hg}=\sum _{j\in {\mathcal {S}}_{i}}\partial _{{\mathbf {U}}_i {\mathbf {U}}_i }{\mathcal {F}}^{hg}_{\alpha i} \Delta V_j =\sum _{j\in {\mathcal {S}}_{i}}\mathscr {K}^{hg}_{\alpha i}\Delta V_j \end{aligned}$$
(66)

Finally, the summation of the higher-order global tangent stiffness matrix and hourglass tangent stiffness matrix in support \({\mathcal {S}}_{i}\) can be obtained

$$\begin{aligned} \mathbb {K}_{\alpha i}&=\mathscr {K}_{\alpha i}+\mathop {\mathscr {K}_{\alpha i}} \limits ^{hg}\nonumber \\&=\sum _{j\in {\mathcal {S}}_{i}} \Bigg ({{\mathbf {B}}_{\alpha i}}^T\cdot \mathscr {D}\cdot {\mathbf {B}}_{\alpha i}+\frac{p^{hg}}{m_{{\mathbf {K}}_{ i}}}({\mathbf {K}}_{\alpha i}^{-1}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} {\mathbf {B}}_{\alpha i})^T \Big ( \begin{bmatrix} {\mathbf {I}}_{j1} &{} {\mathbf {0}} &{} {\mathbf {0}}\\ {\mathbf {0}} &{} \ddots &{} {\mathbf {0}}\\ {\mathbf {0}} &{} {\mathbf {0}} &{} {\mathbf {I}}_{j_n} \end{bmatrix}\nonumber \\&-(\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}})^T {\mathbf {K}}_{\alpha i}\mathbb {L}_i\varvec{p}_{\mathbbm {w}i}^{\mathbbm {l}}\Big ) {\mathbf {K}}_{\alpha i}^{-1}{\mathbf {p}}_{\mathbbm {w}i}^{\mathbbm {l}} {\mathbf {B}}_{\alpha i}\Bigg ) \Delta V_j \end{aligned}$$
(67)

3.5 Numerical implementation with an open-source code

The numerical implementation of the first-order and higher-order NOM are summarized as the following steps, and a flow chart of the NOM implementation procedure is depicted in Fig. 2.

Fig. 2
figure 2

NOM implementation procedure

Step 1. Discretization of the solution domain.

Consider the solution domain to be a discrete domain consisting of discrete points of varying sizes and shapes that are linked to one another. There are two methods to achieve the discretization of the solution domain. For the first method, a user-defined subroutine GridDomain is customized, which can discretize the solution domain evenly. This method is mainly used for the discretization of the rule solution domain. The second method can be achieved as follows: initially, the model is created using finite element software (such as ABAQUS), then the model is divided into grids of different sizes according to the characteristics of the model and export the model information into a inp format file. The model mesh and node information can be read through a user-defined subroutine ParseAbaqusFile, therefore the discrete solution domain with different densities can be achieved.

The Mathematica code for discretization of the solution domain is shown below. In the user-defined subroutine GridDomain, where xmin, xmax are the minimum and maximum values of solution domain and dx is the spacing between points.

figure a

Step 2. Definition of the problem and solution domain.

Determine the overall attributes and geometric boundary conditions of the solution domain based on the real case, and assign values to the corresponding parameters.

Step 3. Specify and search for the number of neighbors for each point in support and build index numbers for the specified neighbors.

In this step, a user-defined subroutine NeiList is customized by the built-in command Nearest of Mathematica to find the required number of neighbors, and the process of building index number for the specified neighbor points can be achieved by the user-defined subroutine NeiIIndex. The Mathematica code for finding the specified area points and specified number neighbor points in the solution domain is shown below, where coord is the coordinate of the points, numNei represents the number of specified neighbors and ndim denotes the dimension of coordinate.

figure b

Step 4. Establish the nonlocal operator coefficient matrix, hourglass tangent stiffness matrix, and the summation of global tangent stiffness matrix and hourglass tangent stiffness matrix in first-order and higher-order form.

\(\textcircled {1}\) First-order nonlocal operator method.

As shown in below Mathematica code, three user-defined subroutines BHgmatrix, Dmatrix and Kmatrix are customized to calculate the nonlocal operator coefficient matrix \({\mathscr {B}}\), hourglass tangent stiffness matrix \(\mathop {\mathscr {K}} \limits ^{hg }\), elastic material constitution matrix \(\mathscr {D}\) and the summation of hourglass tangent stiffness matrix and tangent stiffness matrix \(\mathbb {K}\). In the user-defined subroutine BHgmatrix, initially the basic forms \({\mathscr {B}_i}\), \(\mathop {\mathscr {K}_{i}} \limits ^{hg}\) and shape tensor \({\mathbf {K}}_i\) at point \({\mathbf {x}}_i\) are constructed, which are named as bmatrix, hgmatrix and kmatrix, respectively. Subsequently by Eq. 7, shape tensor can be calculated; by the equation \({\mathbf {I}}_j={ \mathbbm {w}}(\varvec{\xi }_{ij}) V_j (1,1,1)\otimes (1,1,1)^T\) and Eq. 56, the matrix \({\mathbf {I}}_j\) can be calculated and the \(\mathop {\mathscr {K}_{i}} \limits ^{hg}\) matrix can be assembled. Similarly, by equation \({\mathbf {R}}_{j}={ \mathbbm {w}}\left( \varvec{\xi }_{ij}\right) \varvec{\xi }_{ij} ^T V_j\cdot {\left[ \sum _{j\in {\mathcal {S}}_{i}}{ \mathbbm {w}}\left( \varvec{\xi }_{ij}\right) {\varvec{\xi }_{ij}}\otimes \varvec{\xi }_{ij} \Delta V_j\right] ^{-1}}\) and Eq. 15, the intermediate variables \({\mathbf {R}}_{j}\) can be obtained and the \({\mathscr {B}_i}\) matrix is assembled. In the user-defined subroutine Dmatrix, by Eqs. 43, 44 and 45, the linear elastic solid elastic matrix \(\mathscr {D}\) for plane stress, plane strain and 3D conditions can be obtained. Where type=1,2,3 represent the three constitutive models mentioned above. In the user-defined subroutine Kmatrix, by Eq. 67, the summation of global tangent stiffness matrix and hourglass tangent stiffness matrix \(\mathbb {K}\) can be established. In the below Mathematica code, where WeiF represents the weight function, voli represents the volume of each point, Es, mu represents the Young’s Modulus and Poisson’s ratio, respectively.

figure c

\(\textcircled {2}\) Higher-order nonlocal operator method.

The main codes for higher-order NOM are presented in Appendix C, which includes constructing the global higher-order nonlocal operator coefficient matrix \({\mathbf {B}}_{\alpha }\), global hourglass tangent stiffness matrix \(\mathop {\mathscr {K}_{\alpha }} \limits ^{hg }\) and the summation of global tangent stiffness matrix and hourglass tangent stiffness matrix \(\mathbb {K}_{\alpha }\). Initially, a user-defined subroutine MultiIndex is customized to construct multi-index notation in Eq. 21. where \({\varvec{{d}}}\) denotes the dimension, \({\varvec{{sum}}}\) denotes the maximal order of derivatives. Then, the customized user-defined subroutine GFD0CoeffHalf can obtain the factors of multi-index, polynomials and partial derivatives in designated dimensions with maximal higher-order derivatives in Eq. 23. For constructing the elastic material constitution matrix, according to Eqs. 3638, the user-defined subroutine FuncRK is compiled to obtain elastic matrix \(\mathscr {D}\). For higher-order global hourglass tangent stiffness matrix \(\mathop {\mathscr {K}_{\alpha }} \limits ^{hg }\) and the summation of global tangent stiffness matrix and hourglass tangent stiffness matrix \(\mathbb {K}_{\alpha }\), according to Eqs. 33, 34 and 67, two main user-defined subroutines NOMPwKhg and NOMRK are customized to achieve the establishment of corresponding matrix.

Step 5. Search boundary points in discrete domain and impose corresponding boundary conditions based on actual problems.

A user-defined subroutine FindPoints is customize for searching boundary points. When using user-defined subroutine FindPoints, it’s need to call another customized subroutine LessThancoord at the same time. Subsequently, to employ Dirichlet and Neumann boundary conditions to the boundary points, two user-defined subroutines DirichletBoundaryApply and NeumannBoundaryApply are customized. Where the penalty method is used in the user-defined subroutine DirichletBoundaryApply. The related Mathematica codes are shown as below, where Ksp represents the summation of global tangent stiffness matrix and hourglass tangent stiffness matrix \(\mathbb {K}\), Rsp represents the global internal residual, pd represents the index of the points of application of specified displacement, pc represents the penalty coefficient and pf represents the index of the points of application of specified force.

figure d

Step 6. Solve the global displacement in the discrete domain.

According to step 1 to step 5, the summation of global tangent stiffness matrix and hourglass tangent stiffness matrix \(\mathbb {K}\) and global residual vector \(\mathscr {R}\) can be calculated. And the global displacement matrix can be calculated by solving the following linear algebra Eq. 68.

$$\begin{aligned} (\mathscr {K}+\mathop {\mathscr {K}} \limits ^{hg}){\mathbf {u}}=\mathbb {K}{\mathbf {u}}= \mathscr {R} \end{aligned}$$
(68)

we employ the built-in command LinearSolve of Mathematica to solve the global displacement vector, then we use the user-defined subroutine UMatrix convert displacement vector into displacement matrix form. The related Mathematica codes are shown below.

figure e

4 Numerical examples

Four numerical examples in 2D or 3D are presented to validate the first-order and higher-order NOM in this section. The numerical results are compared with the analytical solution or that by FEM software to verify the feasibility.

4.1 A cantilever beam under shear load

In this section, a 2D cantilever beam loaded at the end with shear load is considered. Figure 3a depicts geometry and boundary conditions of the cantilever beam. The beam with \(\mathcal {H}=3\)m in height, \(\mathcal {L}=8\)m in length. The cantilever beam parameters are: \(E=6\times 10^3\)MPa, \(\nu =0.33\). The shear load is parabolic distributed. The beam is discretized into 308,1155,2511,4428,6885 points respectively, which corresponding to \(\Delta x\in \{\mathcal {H}/10,\mathcal {H}/20,\mathcal {H}/30,\mathcal {H}/40,\mathcal {H}/50\}\). Where \(\Delta x\) denotes the spacing of the points, the discretization of \(\Delta x=20\) is shown in Fig. 3b. Plane stress conditions are considered in this section. The analytical solution refers to literature [59, 60].

$$\begin{aligned} u_x&=\frac{\mathcal {P} (y-\mathcal {H}/2)}{6 E\mathcal {I}}\big [(6 \mathcal {L}-3 x)x+(2+\nu )((y-\mathcal {H}/2)^2-\frac{\mathcal {H}^2}{4})\big ] \end{aligned}$$
(69)
$$\begin{aligned} u_y&=-\frac{\mathcal {P}}{6 E\mathcal {I}}\big [3 \nu (y-\mathcal {H}/2)^2(\mathcal {L}-x)+(4+5 \nu )\frac{\mathcal {H}^2 x}{4}+(3\mathcal {L}-x)x^2 \big ] \end{aligned}$$
(70)
$$\begin{aligned} \sigma _{xx}(x,y)&=\frac{\mathcal {P}(\mathcal {L}-x)(y-\mathcal {H}/2)}{\mathcal {I}},\sigma _{yy}(x,y)=0,\tau _{xy}(x,y)=-\frac{\mathcal {P}}{2 \mathcal {I}}\big (\frac{\mathcal {H}^2}{4}-(y-\mathcal {H}/2)^2\big ), \end{aligned}$$
(71)

where \(x\in [0,\mathcal {L}],y\in [0,\mathcal {H}]\), \(\mathcal {P}\)=-5 kN, \(\mathcal {I}=\frac{\mathcal {H}^3}{12}\). The discretized cantilever beam on displacement boundary are constrained using the accurate displacements according to Eqs. 69 and 70, as well as the force boundary according to Eq. 71.

Fig. 3
figure 3

a Set up of the cantilever beam; b the discretization of the cantilever beam(\(\Delta x\)=\(\mathcal {H}\)/20)

To obtain the displacement of each point, we need to solve the Eq. 68, which can be shown in detail as Eq. 72. In this work, we use the penalty approach to apply Dirichlet boundary conditions. This method can be achieved through the following steps:

$$\begin{aligned} \begin{bmatrix} k_{11} &{} k_{12} &{} \cdots &{} \cdots &{} \cdots &{} k_{1n}\\ k_{21} &{} k_{22} &{}\cdots &{} \cdots &{} \cdots &{}k_{2n}\\ \cdots &{}\cdots &{}\cdots &{} \cdots &{} \cdots &{}\cdots \\ k_{i1}&{} k_{i2}&{}\cdots &{} k_{ii} &{} \cdots &{} k_{in}\\ \cdots &{}\cdots &{}\cdots &{} \cdots &{} \cdots &{}\cdots \\ k_{n1} &{} k_{n2} &{}\cdots &{} \cdots &{} \cdots &{}k_{nn}\\ \end{bmatrix} \begin{bmatrix}u_{1} \\ u_{2}\\ \vdots \\ u_{i}\\ \vdots \\ u_{n}\\ \end{bmatrix}=\begin{bmatrix}R_{1} \\ R_{2}\\ \vdots \\ R_{i}\\ \vdots \\ R_{n}\\ \end{bmatrix} \end{aligned}$$
(72)

When the displacement of point i \(u_{i}=\overline{u_{i}}\), we modify the i-th equation as follows, multiply it’s diagonal element \(K_{ii}\) by a penalty factor \(\eta\)(In computations, \(\eta\) is set to \(10^{10}\).) and replace \(R_{i}\) with \(\eta k_{ii}\overline{u_{i}}\) to obtain:

$$\begin{aligned} \begin{bmatrix} k_{11} &{} k_{12} &{} \cdots &{} \cdots &{} \cdots &{} k_{1n}\\ k_{21} &{} k_{22} &{}\cdots &{} \cdots &{} \cdots &{}k_{2n}\\ \cdots &{}\cdots &{}\cdots &{} \cdots &{} \cdots &{}\cdots \\ k_{i1}&{} k_{i2}&{}\cdots &{} \eta k_{ii} &{} \cdots &{} k_{in}\\ \cdots &{}\cdots &{}\cdots &{} \cdots &{} \cdots &{}\cdots \\ k_{n1} &{} k_{n2} &{}\cdots &{} \cdots &{} \cdots &{}k_{nn}\\ \end{bmatrix} \begin{bmatrix}u_{1} \\ u_{2}\\ \vdots \\ u_{i}\\ \vdots \\ u_{n}\\ \end{bmatrix}=\begin{bmatrix}R_{1} \\ R_{2}\\ \vdots \\ \eta k_{ii}\overline{u_{i}}\\ \vdots \\ R_{n}\\ \end{bmatrix} \end{aligned}$$
(73)

The modified i-th equation can be expressed as:

$$\begin{aligned} k_{i1}u_{1}+k_{i2}u_{2}+\cdots +\eta k_{ii}u_{i}+\cdots +k_{in}u_{n}=\eta k_{ii}\overline{u_{i}} \end{aligned}$$
(74)

Since \(\eta k_{ii}\gg k_{ij}(i\ne j)\), the \(\eta k_{ii}u_{i}\) term at the left end of the equation is much larger than the other terms, so it can be approximated \(\eta k_{ii}u_{i}\approx \eta k_{ii}\overline{u_{i}}\). Then we can obtain \(u_{i}\approx \overline{u_{i}}\). According to the Eq. 73, we can obtain the displacement of each point. It should be noted that this method is suitable for any given displacement of points, as the order of the formula and the displacement order of the points remain unchanged during the solution process.

The number of target point’s neighbors and the radius of support size in NOM can be very flexible and unlimited. However, a large number of neighbors is expensive in the k-nearest neighbor’s search. Based on our numerical experience, eight points closest to the target point are selected to construct the target point’s support domain. The difference between the numerical result and analytical solution is measured by the L2-norm, which is calculated by

$$\begin{aligned} \Vert {\mathbf {u}}\Vert _{L2}=\sqrt{\frac{\sum _j ({\mathbf {u}}_j-{\mathbf {u}}_j^{exact})\cdot ({\mathbf {u}}_j-{\mathbf {u}}_j^{exact}) \Delta V_j}{\sum _j {\mathbf {u}}^{exact}_j\cdot {\mathbf {u}}_j^{exact} \Delta V_j}}. \end{aligned}$$
(75)

Table.1 shows the statistical results of the L2-norm for displacement at various discretizations, Fig. 4 depicts the displacement for discretization at \(\Delta x=\mathcal {H}/50\). The displacement cloud diagram of the cantilever beam for discretization at \(\Delta x=\mathcal {H}/50\) using first-order NOM numerical results and analytical results can be seen in Fig. 5. As shown in Table 1, Figs. 4 and 5, good agreements can be seen between the first-order NOM numerical results and analytical results. It shows very close variations in L2-norm and the displacement errors in different directions.

Table 1 The statistical results of L2-norm and error for \({u_x}_{max}\) and \({u_y}_{max}\) at different discretizations
Fig. 4
figure 4

The displacement and stress for discretization at \(\Delta x=\mathcal {H}/50\). a Displacement of points y=\(\mathcal {H}\)/2 in the x direction; b displacement of points x=\(\mathcal {L}\)/2 in the y direction; c stress of points x=\(\mathcal {L}\)/2 in the y direction; d stress of points x=\(\mathcal {L}\)/2 in the y direction

Fig. 5
figure 5

The displacement cloud diagram of the cantilever beam for discretization at \(\Delta x=\mathcal {H}/50\). a Displacement in y direction by first-order NOM numerical results; b displacement in y direction analytical results; c displacement in x direction by first-order NOM numerical results; d displacement in x direction analytical results

4.2 Problem of an infinite plate with a hole in tension

Consider a 2D infinite plate with a circular hole, as shown in Fig. 6. The plate’s length is \(\mathcal {L}\) and there is a small circular hole with a radius of \(\rho =\mathbbm {a}\) in the plate. Because the plate’s thickness is substantially smaller than its length, it can be considered a plane stress problem. The force boundary condition of \(\mathcal {P}\) = 1 MPa. Based on the symmetry of the structure and load, one-quarter of the model is used for analysis.

Fig. 6
figure 6

Setup of infinite plate with a circular hole

When the plate’s width is substantially more than the radius of the small hole, we can obtain the stresses analytical solution [61] in polar coordinate system according to classical elasticity theory, and it can be expressed as

$$\begin{aligned} \sigma _{\rho }&=\frac{\mathcal {P}}{2}\left( {1-\frac{\mathbbm {a}^{2}}{\rho ^{2}}}\right) +\frac{\mathcal {P}}{2}\cos 2\theta \left( {1-\frac{\mathbbm {a}^{2}}{\rho ^{2}}}\right) \left( {1-3 \frac{\mathbbm {a}^{2}}{\rho ^{2}}}\right) ,\nonumber \\ \sigma _{\theta }&=\frac{\mathcal {P}}{2}\left( {1+\frac{\mathbbm {a}^{2}}{\rho ^{2}}}\right) -\frac{\mathcal {P}}{2}\cos 2\theta \left( {1+3 \frac{\mathbbm {a}^{4}}{\rho ^{4}}}\right) \\ \tau _{\rho \theta }&=\tau _{\theta \rho }=-\frac{\mathcal {P}}{2}\sin 2\theta \left( {1-\frac{\mathbbm {a}^{2}}{\rho ^{2}}}\right) \left( {1+3 \frac{\mathbbm {a}^{2}}{\rho ^{2}}}\right) . \nonumber \end{aligned}$$
(76)

The highest hoop normal stress is achieved at the hole’s edge, as illustrated in Fig. 6. When \(\rho =\mathbbm {a}\), \(\theta =\frac{\pi }{2}(\frac{3\pi }{2})\), \(\sigma _{\theta }\) attains the maximum value of three times the uniformly distributed stress \(\mathcal {P}\), \((\sigma _{\theta })_\mathrm{{max}} = 3\mathcal {P}\), and \(\sigma _{\theta }\) sharply approaches to \(\mathcal {P}\) as it moves away to the edge. We characterize the stress concentration phenomena using the stress concentration factor K in this case. We solve stress concentration problems by the first-order NOM, plane stress condition is considered. The numerical results were compared with ABAQUS standard and analytical solutions. The parameters for the plate include \(E=3\times 10^4 \mathrm{{MPa}}, \nu =0.3\), and the radius of the hole is \(\rho\) = 1 m. To facilitate the application of force boundary conditions, we converted the Eq. 76 from polar coordinate system to Cartesian coordinate system, it can be shown as

$$\begin{aligned} \sigma _{xx}(\rho ,\theta )&=\mathcal {P}-\mathcal {P}{\frac{\mathbbm {a}^{2}}{\rho ^{2}}}\left( {\frac{3\cos 2\theta }{2}} +\cos 4\theta \right) +\mathcal {P}{\frac{3\mathbbm {a}^{4}}{2\rho ^{4}}}\cos 4\theta \nonumber \\ \sigma _{yy}(\rho ,\theta )&=-\mathcal {P}{\frac{\mathbbm {a}^{2}}{\rho ^{2}}}\left( {\frac{\cos 2\theta }{2}} -\cos 4\theta \right) -\mathcal {P}{\frac{3\mathbbm {a}^{4}}{2\rho ^{4}}}\cos 4\theta \nonumber \\ \tau _{xy}(\rho ,\theta )&=-\mathcal {P}{\frac{\mathbbm {a}^{2}}{\rho ^{2}}}\left( {\frac{\sin 2\theta }{2}} +\sin 4\theta \right) +\mathcal {P}{\frac{3\mathbbm {a}^{4}}{2\rho ^{4}}}\sin 4\theta \end{aligned}$$
(77)

To validate the feasibility of the first-order NOM, we compare the numerical simulation results with the analytical solutions. The analytical solution of the displacement under plane stress conditions can be expressed as

$$\begin{aligned} u_{x}(\rho ,\theta )&={\frac{\mathcal {P}\mathbbm {a}}{8\mu }}\left( {\frac{\rho }{\mathbbm {a}}}(\kappa +1)\cos \theta +{\frac{2\mathbbm {a}}{\rho }}((1+\kappa )\cos \theta +\cos 3\theta )-{\frac{2\mathbbm {a}^{3}}{\rho ^{3}}}\cos 3\theta \right) \nonumber \\ u_{y}(\rho ,\theta )&={\frac{\mathcal {P}\mathbbm {a}}{8\mu }}\left( {\frac{\rho }{\mathbbm {a}}}(\kappa -3)\sin \theta +{\frac{2\mathbbm {a}}{\rho }}((1-\kappa )\sin \theta +\sin 3\theta )-{\frac{2\mathbbm {a}^{3}}{\rho ^{3}}}\sin 3\theta \right) \end{aligned}$$
(78)

where \(\mu =\frac{E}{2(1+\nu )}\), and \(\kappa =\frac{3-\nu }{1+\nu }\).

For the displacement boundary conditions, we set \(u_x = 0, u_y = 0\) at left and bottom boundaries by penalty method, meanwhile, for the force boundary conditions, we applied the traction force at right and top boundaries computed by Eq. 77.

To obtain a good discrete result, initially, we build the model and meshes in ABAQUS, then export it as an “model.inp” file, which includes the element and point coordinate information. We read the exported “model.inp” file in the environment of Mathematica. We can calculate the coordinates of each point in the model, the area of each element, and assign parameters such as area and force to the relevant points of the element according to the core principle. So as to realize the discreteness of the unit in the environment of Mathematica. It should be noted that only the nodes are used and no interaction between elements. The Mathematica software reads the “model.inp” model \((\mathcal {L}/\mathbbm {a}=5)\) and discretization of the model as shown in Fig. 7. In this study, we use the built-in command Nearest of Mathematica to find the required number of neighbor points, and eight neighbors are selected.

Fig. 7
figure 7

a The “model.inp” model shown in mathematica; b discretization of the model

We fix the diameter of the hole to 2m and change the \(\mathcal {L}\). Four cases of relative size of plate width and hole radius with \(\mathcal {L}/ \mathbbm {a}\)=5,7,9,11 and four cases with total 525,2050,4575,8100 nodes are investigated. The plate is discretized according to ABAQUS mesh elements and CPS3 elements are adopted in ABAQUS [62] to calculate the reference results. At first we test the maximum value of stress in the x-direction \((\sigma _{xx} )_{max}\), according to the formulation \(K=\frac{(\sigma _{xx} )_{max}}{\mathcal {P} }\), we can obtain the corresponding K and compared it to the analytic solutions. According to the first-order NOM, ABAQUS standard, and analytical solution, the statistical results of the stress concentration factor K, as shown in Table 2.

Table 2 The statistical results of the stress concentration factor K at different \(\mathcal {L}/a\) ratios, where 525 and 2050 denotes the total number of points in the model

The displacement and stress distribution of the model\(( \mathcal {L}/\mathbbm {a}=5)\) on polar coordinate system \(\rho =2\) at the case of with total 4575 and 8100 nodes using first-order NOM are compared to the analytic solutions, as seen in Figs. 8 and 9. The displacement’s L2 norm computed by Eq. 75 and stress field at four different discretization cases are shown in Table 3. These characteristics agree well with the theoretical analysis of this problem mentioned above, and it proved that the first-order NOM established in this paper has good applicability.

Fig. 8
figure 8

Analytical and numerical results of the stress and displacement. a The results of the stress (Nnodes = 4575); b the results of the displacement (Nnodes = 4575)

Fig. 9
figure 9

Analytical and numerical results of the stress and displacement. a The results of the stress (Nnodes=8100); b the results of the displacement (Nnodes=8100)

Table 3 The L2 norm of the displacement and stress at four different discretization cases

4.3 Crack propagation problem by NOM with phase-field modeling

Phase field fracture modeling [63,64,65,66,67,68] shows great advantages for modeling complex crack propagation, and its based on the \(\Gamma\)-convergence of the approximations of free discontinuity problems [69]. In this section, we use NOM to establish implicit phase field modeling and a phase field \(\phi (\varvec{x}, t) \in [0,1]\) is introduced to approximate the fracture surface, \(\Gamma\). Where \(\phi (\varvec{x}, t)= 1\) denotes the complete damage of the material and \(\phi (\varvec{x}, t) = 0\) denotes the material is undamaged.

According to literature [70], the density of the crack surface per unit volume \(\gamma (\phi )\) and the surface energy in the solid due to the formation of crack can be shown as

$$\begin{aligned} \gamma (\phi ,\nabla \phi )= \frac{\phi ^2}{2 l_0} +\frac{l_0}{2} \nabla \phi \cdot \nabla \phi , \end{aligned}$$
(79)
$$\begin{aligned} \int _\Gamma G_c\text {d}A\approx \int _\Omega G_c\left( \frac{\phi ^2}{2 l_0} +\frac{l_0}{2} \nabla \phi \cdot \nabla \phi \right) \text {d}V, \end{aligned}$$
(80)

where \(G_c\) represent critical energy release rate, \(l_0\) is a length scale factor that governs the phase field’s transition area, hence it can reflect the width of the crack, When \(l_0\rightarrow 0\), the \(\Gamma\)-limit recovers the sharp discontinuous interface of the crack.

To guarantee that the crack is only driven by tensile load in phase field simulation, the elastic energy must be decomposed into tensile and compressive components [71]. The strain tensor \(\varvec{\varepsilon }\) can be decomposed as follows by using Eigen-decomposition

$$\begin{aligned} \varvec{\varepsilon }_+=\sum _{a=1}^d\langle \varepsilon _a\rangle _+ \mathbf{n} _a\otimes \mathbf{n} _a , \varvec{\varepsilon }_-=\sum _{a=1}^d\langle \varepsilon _a\rangle _- \mathbf{n} _a\otimes \mathbf{n} _a, \end{aligned}$$
(81)

where the tensile and compressive parts of strain tensors are \(\varvec{\varepsilon }_+\) and \(\varvec{\varepsilon }_-\), respectively; \(\langle x\rangle _\pm :=(x\pm |x|)/2\); the principal strain is \(\varepsilon _{a}\), and the principal strain direction is \(\mathbf{n} _a\).

The elastic energy density \(\psi _{\varvec{\varepsilon }}(\varvec{\varepsilon })\) and Cauchy stress tensor \(\varvec{\sigma }\) for the tensile and compressive parts are represented by the decomposed strain tensor as following

$$\begin{aligned}&\psi _{\mathbbm {e}}(\varvec{\varepsilon },\phi )=[(1-\phi )^2+\kappa _0]\psi _{\mathbbm {e}}^{+} (\varvec{\varepsilon })+\psi _{\mathbbm {e}}^{-} (\varvec{\varepsilon })\nonumber \\&\psi _{\mathbbm {e}}^{+} (\varvec{\varepsilon })=\frac{\lambda }{2}\langle tr(\varvec{\varepsilon })\rangle _+^2+\mu \langle tr(\varvec{\varepsilon }_+)^2 \rangle \nonumber \\&\psi _{\mathbbm {e}}^{-} (\varvec{\varepsilon },\phi )=\frac{\lambda }{2}\langle tr(\varvec{\varepsilon })\rangle _-^2+\mu \langle tr(\varvec{\varepsilon }_-)^2 \rangle \end{aligned}$$
(82)
$$\begin{aligned} \varvec{\sigma }=\frac{\partial \psi _{\mathbbm {e}}(\varvec{\varepsilon },\phi )}{\partial \varvec{\varepsilon }}&=[(1-\phi )^2+\kappa _0] \frac{\partial \psi _{\mathbbm {e}}^{+} (\varvec{\varepsilon })}{\partial \varvec{\varepsilon }}+\frac{\partial \psi _{\mathbbm {e}}^{-} (\varvec{\varepsilon })}{\partial \varvec{\varepsilon }}\nonumber \\&=[(1-\phi )^2+\kappa _0] [\lambda \langle tr(\varvec{\varepsilon })\rangle _+ {\varvec{{I}}} +2 \mu \varvec{\varepsilon }_+] +\lambda \langle tr(\varvec{\varepsilon })\rangle _- {\varvec{{I}}} +2 \mu \varvec{\varepsilon }_-, \end{aligned}$$
(83)

where \(\kappa _0\) (\(\kappa _0>0\) and \(\kappa _0\ll 1\)) is a tiny positive factor that prevents the positive component of the elastic energy density from degrading completely, \(\lambda ,\mu\) are the Lamé parameters. \({\varvec{{I}}}\) donates identity tensor.

The overall potential functional is calculated as the sum of the phase field approximations for the fracture energy, elastic energy, body energy, and potential energy caused by the surface load, it can be shown as

$$\begin{aligned} \Pi (\varvec{u},\phi )&=\underbrace{\int _\Omega \frac{G_c}{2}(\frac{\phi ^2}{l_0} +l_0 \nabla \phi \cdot \nabla \phi )\text {d}\Omega +\int _\Omega [(1-\phi )^2+\kappa _0]\psi _{\mathbbm {e}}^{+} (\varvec{\varepsilon })+\psi _{\mathbbm {e}}^{-} (\varvec{\varepsilon })\text {d}\Omega }_{W_{int}} \nonumber \\&-\underbrace{\int _\Omega {\mathbf {b}}\cdot \varvec{u} \text {d}\Omega -\int _{\partial \Omega _{f}} \varvec{f} \cdot \varvec{u}\text {d}\Gamma }_{W_{ext}} \end{aligned}$$
(84)

where \({\mathbf {b}}\) denotes the body force, \(\varvec{u}\) donates the displacement, and \(\varvec{f}\) donates the surface loads at the boundary, \({W_\mathrm{{int}}}\) donates internal energy, \({W_\mathrm{{ext}}}\) donates external work.

The Lagrange energy functional can be expressed as

$$\begin{aligned} L=\frac{1}{2}\int _\Omega \rho \dot{\varvec{u}}\cdot \dot{\varvec{u}}\text {d}\Omega -\Pi (\varvec{u},\phi ) \end{aligned}$$
(85)

According to Hamilton’s principle, the first variation of the Lagrange energy functional L should be 0, namely \(\delta L=0\), hence we can obtain the following phase-field governing equations and Neumann boundary conditions

$$\begin{aligned} {[}(1-\phi )^2+\kappa _0]\nabla \cdot \varvec{\sigma }+{\mathbf {b}}=\rho \ddot{\varvec{u}}&\qquad \mathrm{{in}} \quad {\Omega } \nonumber \\ {[}2 l_0 \psi _{\mathbbm {e}}^{+}+G_c ]\phi - G_c l_0^2\nabla ^2 \phi =2 l_0 \psi _{\mathbbm {e}}^{+}&\qquad \mathrm{{in}} \quad {\Omega }\nonumber \\ \varvec{\sigma }\cdot \varvec{n}^*=\varvec{f}&\qquad \mathrm{{on}} \quad {\partial \Omega _{f}}\nonumber \\ \nabla \phi \cdot \varvec{n}^*=0&\qquad \mathrm{{on}} \quad {\partial \Omega _{f}} \end{aligned}$$
(86)

where \(\varvec{n}^*\) is the outward-pointing normal vector for boundary \({\partial \Omega _{f}}\).

To maintain the phase field that increases monotonically [70], the local history field of strain \(H(\varvec{x},{t})\) is introduced and it can be shown as

$$\begin{aligned} H(\varvec{x},{t})=\underset{\mathbbm {s}\in [0,{t}]}{\max } \psi _{\mathbbm {e}}^+(\varvec{\varepsilon }(\varvec{x},\mathbbm {s})) \end{aligned}$$
(87)

we use \(H(\varvec{x},t)\) replace the \(\psi _{\mathbbm {e}}^{+}\) in the Eq. 86, then we can obtain

$$\begin{aligned} {[}(1-\phi )^2+\kappa _0]\nabla \cdot \varvec{\sigma }+{\mathbf {b}}&=\rho \ddot{\varvec{u}} , \nonumber \\ {[}2 l_0 H+G_c ]\phi - G_c l_0^2\nabla ^2 \phi&=2 l_0 H ,\nonumber \\ \varvec{\sigma }\cdot \varvec{n}^*=\varvec{f} , \nonumber \\ \nabla \phi \cdot \varvec{n}^*=0 \end{aligned}$$
(88)

Since the implicit NOM is based on the governing equations weak form, and the weak forms of Eq. 88 are formulated as follows

$$\begin{aligned}&\int _\Omega G_c (\frac{1}{l_0}\phi {\delta }\phi +l_0 \nabla \phi \cdot \nabla {\delta }\phi )\text {d}\Omega +\int _\Omega -2(1-\phi ){\delta }\phi H\text {d}\Omega =0 \nonumber \\&\int _\Omega -\varvec{\sigma }:{\delta }\varvec{\varepsilon }\text {d}\Omega +\int _\Omega {\mathbf {b}}\cdot {\delta }\varvec{u} \text {d}\Omega +\int _{\partial \Omega _f} \varvec{f} \cdot {\delta }\varvec{u}\text {d}\Gamma =0 \end{aligned}$$
(89)

The continuous support \({\mathcal {S}}_{i}\) is expressed in NOM by

$$\begin{aligned} N_{i}=\{j_1,..,j_k,..,j_{n}\} \end{aligned}$$
(90)

where \(j_1,..,j_k,..,j_{n}\) denote the global indices of point i’s neighbors.

The nonlocal operator for displacement \(\tilde{\nabla }\otimes \varvec{u}_{i}\) and phase field \(\tilde{\nabla }\phi _{i}\) in discrete form can be rewritten as

$$\begin{aligned}&\tilde{\nabla }\otimes \varvec{u}_{i}\simeq \sum _{j\in {\mathcal {S}}_{i}} { \mathbbm {w}}(\varvec{\xi }_{ij}) ( \varvec{u}_{j}- \varvec{u}_{i})\otimes ({\mathbf {K}}_{i}^{-1} \varvec{\xi }_{ij}) \Delta V_{j}=\mathscr {B}_i^{\varvec{u}} \cdot \tilde{\varvec{u}_{i}} \end{aligned}$$
(91)
$$\begin{aligned}&\tilde{\nabla }\phi _{i}\simeq \sum _{j\in {\mathcal {S}}_{i}} { \mathbbm {w}}(\varvec{\xi }_{ij}) ( \phi _{j}- \phi _{i}) ({\mathbf {K}}_{i}^{-1} \varvec{\xi }_{ij}) \Delta V_{j}=\mathscr {B}_i^{\phi }\cdot \tilde{\phi _{i}} \end{aligned}$$
(92)

where \(\simeq\) denotes discretization, \(\tilde{\varvec{u}_{i}}(= {\mathbf {u}}_i, {\mathbf {u}}_{j_1},..,{\mathbf {u}}_{j_k},..,{\mathbf {u}}_{j_{n}})\) is all the variations of the displacement in support \({\mathcal {S}}_i\), \(\tilde{\phi _{i}}(=\phi _i, \phi _{j_1},.., \phi _{j_k},.., \phi _{j_{n}})\) represents all variations of the phase field in support \({\mathcal {S}}_i\). \(\Delta V_{j}\) is the volume of neighbor point j, \(\mathscr {B}_i^{\varvec{u}}\) and \(\mathscr {B}_i^{\phi }\) are the the coefficient matrices, as shown in Eqs. 15 and 16.

The research was based on a library of linear elastic material. According to the above expressions, Eq. 89 can be shown as

$$\begin{aligned}&\sum _{j\in {\mathcal {S}}_{i}}\big (G_c l_0 [\mathscr {B}_i^{\phi }]^T \cdot \mathscr {B}_i^{\phi }\cdot \tilde{\phi _{i}} +[G_c \frac{1}{l_0}\tilde{\phi _{i}}-2(\varvec{N}-\tilde{\phi _{i}}) H]\big )\Delta V_j =0 \nonumber \\&\sum _{j\in {\mathcal {S}}_{i}} -[{\mathscr {B}_i^{\varvec{u}}}]^T\mathbf{D} _{ijkl} \{\varvec{\varepsilon }_{i}\}\Delta V_j+\sum _{j\in {\mathcal {S}}_{i}}{\mathbf {b}}_i \varvec{N}\Delta V_j+\int _{\partial \Omega _f} \varvec{f} _i \varvec{N}\Delta S_j=0 \end{aligned}$$
(93)

where \(\varvec{N}=[1,0,\cdots ,0,0] ^T\) is a \((n_i+1)\)-dimensional column vector.

We can obtain the point \({\mathbf {x}}_i\) residual of the overall systems

$$\begin{aligned} \varvec{R}_i^{\varvec{u}}&=\varvec{F}_{i}^{\varvec{u},ext}-\varvec{F}_{i}^{\varvec{u}, int}\nonumber \\&=\underbrace{\sum _{j\in {\mathcal {S}}_{i}}\varvec{f} _{i} \Delta S_j + \sum _{j\in {\mathcal {S}}_{i}}{\mathbf {b}}_{i} \Delta V_j }_{\varvec{F}_{i}^{\varvec{u},ext}} - \sum _{j\in {\mathcal {S}}_{i}} [{\mathscr {B}_i^{\varvec{u}}}]^T\mathbf{D} _{ijkl} \{\varvec{\varepsilon }_{i}\} \Delta V_j \nonumber \\ R_i^{\phi }&= - F_{i}^{\phi , int}\nonumber \\&=\sum _{j\in {\mathcal {S}}_{i}} \big (G_c l_0 [\mathscr {B}_i^{\phi }]^T \cdot \mathscr {B}_i^{\phi }\cdot \tilde{\phi _{i}} +[G_c \frac{1}{l_0}\tilde{\phi _{i}}-2(\varvec{N}-\tilde{\phi _{i}}) H]\big )\Delta V_j \end{aligned}$$
(94)

where \(\varvec{F}_{i}^{\varvec{u},\mathrm{{int}}}\), \(\varvec{F}_{i}^{\varvec{u},\mathrm{{ext}}}\) are internal force, external force, respectively, which correspond to the displacement field.

Whereas \(F_{i}^{\phi ,{{int}}}\) is the internal force corresponding to the phase field. The corresponding tangent stiffness matrices can be obtained based on the internal forces:

$$\begin{aligned}&\mathscr {K}_{i}^{\varvec{u}}=\frac{\partial \varvec{F}_{i}^{\varvec{u}, int}}{{\partial \tilde{\varvec{u}}}_i}=\sum _{j\in {\mathcal {S}}_{i}}[{\mathscr {B}_i^{\varvec{u}}}]^T\mathbf{D} _{ijkl} {\mathscr {B}_i^{\varvec{u}}}\Delta V_j \end{aligned}$$
(95)
$$\begin{aligned}&\mathscr {K}_{i}^{\phi }=\frac{\partial F_{i}^{\phi , int}}{{\partial \tilde{\phi }}_i}=\sum _{j\in {\mathcal {S}}_{i}} \big ([\mathscr {B}_i^{\phi }]^T G_c {l_0} \mathscr {B}_i^{\phi }+ (\frac{G_c}{l_0}+2 H)\varvec{N}\otimes \varvec{N}^T\big )\Delta V_j \end{aligned}$$
(96)

where \(\mathbf{D} _{ijkl}\) is a elasticity matrix, and it can be obtained using Eigen-decomposition algorithm for fourth-order isotropic tensor [70]

$$\begin{aligned} \mathbf{D} _{ijkl} =\frac{\partial \{\varvec{\sigma }_{ij}\}}{\partial \{\varvec{\varepsilon }_{kl}\}}=\frac{\partial }{\partial \{\varvec{\varepsilon }_{kl}\}}\big ([(1-\phi )^2+\kappa _0]\varvec{\sigma }_{ij}^{+} +\varvec{\sigma }_{ij}^-\big )=[(1-\phi )^2+\kappa _0] \mathbf{D} _{ijkl}^{+} +\mathbf{D} _{ijkl}^{-} \end{aligned}$$
(97)

The stress based on the Eigen-decomposition method can be expressed as

$$\begin{aligned}&\varvec{\sigma }^{\pm } =\lambda \langle \varepsilon _1+\varepsilon _2+\varepsilon _3\rangle _{{\pm }}I_{3\times 3} +2\mu (\langle \varepsilon _1\rangle _{{\pm }}\varvec{n}_1\otimes \varvec{n}_1+\langle \varepsilon _2\rangle _{{\pm }}\varvec{n}_2\otimes \varvec{n}_2+\langle \varepsilon _3\rangle _{{\pm }}\varvec{n}_3\otimes \varvec{n}_3) \end{aligned}$$
(98)

where \(\lambda ,\mu\) are the Lamé constants, \(I_{3\times 3}\) is the identity matrix, \(\varvec{n}_1,\varvec{n}_2,\varvec{n}_3\) are Eigenvectors for principal strains \(\varepsilon _1,\varepsilon _2,\varepsilon _3\) of \(\varvec{\varepsilon }(=\sum _{i=1} ^3\varepsilon _i\varvec{n}_i\otimes \varvec{n}_i)\) (Fig. 10).

Fig. 10
figure 10

Geometry and boundary conditions

Then Eq. 110 can be shown as

$$\begin{aligned}&\mathscr {K}_{i}^{\varvec{u}}=\sum _{j\in {\mathcal {S}}_{i}}[{\mathscr {B}_i^{\varvec{u}}}]^T\big ([(1-\phi )^2+\kappa _0] \mathbf{D} _{ijkl} ^{+} +\mathbf{D} _{ijkl}^{-}\big ) {\mathscr {B}_i^{\varvec{u}}}\Delta V_j \end{aligned}$$
(99)

However, Eq. 89 suffers from the zero-energy mode, the penalty force from the nonlocal operator functional should be added, then the summation of global tangent stiffness matrix and hourglass tangent stiffness matrix in displacement and phase field as shown in following

$$\begin{aligned}&\mathbb {K}_{i}^{\varvec{u}}=\sum _{j\in {\mathcal {S}}_{i}}\Big ([{\mathscr {B}_i^{\varvec{u}}}]^T\big ([(1-\phi )^2+\kappa _0] \mathbf{D} _{ijkl} ^{+} +\mathbf{D} _{ijkl}^{-}\big ) {\mathscr {B}_i^{\varvec{u}}}+\mathop {\mathscr {K}_i^{\varvec{u}}} \limits ^{hg}\Big )\Delta V_j \end{aligned}$$
(100)
$$\begin{aligned}&\mathbb {K}_{i}^{\phi }=\sum _{j\in {\mathcal {S}}_{i}}\Big ([\mathscr {B}_i^{\phi }]^T G_c {l_0} \mathscr {B}_i^{\phi }+ \big (\frac{G_c}{l_0}+2 H\big )\varvec{N}\otimes \varvec{N}^T+\mathop {\mathscr {K}_i^{\phi }} \limits ^{hg}\Big )\Delta V_j \end{aligned}$$
(101)

In this case, we consider a single notched square plate subjected to static tension loading. Figure 12 depicts the geometrical and boundary conditions of the plate. We consider the plate parameters as follows: \(E=2.1\times 10^5\text{ MPa } ,\nu =0.3\) and the energy release rate \(g_c=2.7\times 10^{-3} \text{ kN/mm }\). The plane strain condition is considered in this test. We deleted the points closest to the initial crack to produce the initial crack and each point has eight neighbors to construct their own support domain. The single edge notched square plate is discretized into 40401 points. The phase-field length scale is set to \(l_0=0.015\) mm. Due to the maximal order of partial derivatives in Eq. 89 is 1, the first-order NOM is employed. The penalty method is used to enforce the Dirichlet boundary conditions for phase and displacement fields. In this case, to prevent the singularity during computation, \(\kappa _0=1\times 10^{-6}\) is chosen. Due to the mutation property of crack propagation, in the staggered scheme, a small vertical displacement increment \(\Delta u=1\times 10^{-5}\) mm is applied to the upper boundary of the plate and the bottom boundary is fixed all the time.

Figure 11 depicts the crack patterns in horizontal direction at various displacements for \(l_0=0.015\). Figure 12 depicts the reaction force-displacement curves. As expected in the literature [72], when adopted staggered scheme, the rate of the crack evolves seems to be delayed in comparison to a completely monolithic scheme. In comparison with the results by Miehe [70, 72], the load curves obtained by the implicit nonlocal model align well with the reference result with the increase of the vertical displacement \(\Delta u\). The crack tip still has a small bond force caused by the support and dual-support which leads to slight differences appear at post localization where FEM exhibits a sharper decay compared to the NOM.

Fig. 11
figure 11

2D single-edge-notched tension test. Crack pattern at displacement field and phase field for a length scale of \(l_0=0.015\) mm

Fig. 12
figure 12

Reaction force-displacement curves for \(l_0=0.015\) mm

4.4 3D gradient elasticity cantilever beam under shear load

To illustrate the feasibility of higher-order NOM, we expand it to handle the gradient elasticity beam issue. The isotropic elasticity gradient material’s energy functional [73, 74] can be represented as

$$\begin{aligned} \mathbb {W}=&\int _\Omega \frac{1}{2}\bar{\varvec{\sigma }}:\varvec{\varepsilon }+\frac{\ell ^2}{2}\nabla \bar{\varvec{\sigma }}\dot{:}\nabla \varvec{\varepsilon }\,\text {d}\Omega -\int _{\Omega } \varvec{b} \cdot \varvec{u} \text {d}\Omega -\int _{\partial \Omega } {\varvec{\mathbb {P}}} \cdot \varvec{u} \text {d}S-\int _{\partial \Omega } {\varvec{\mathbb {R}}} \cdot (\varvec{n}^* \cdot \nabla \varvec{u}) \text {d}S \end{aligned}$$
(102)

where \(\bar{\varvec{\sigma }}\) represent the Cauchy-like stress tensor. \(\ell\) represent the gradient material factor, \(\varvec{\varepsilon }=\frac{1}{2}\left( \nabla \varvec{u}+ \varvec{u} \nabla \right)\) represent the infinitesimal strain tensor. \(\varvec{b}\) represent body force density, whereas \(\varvec{\mathbb {P}}\) and \(\varvec{\mathbb {R}}\) represent the traction force and double traction force act on on \(\partial \Omega\). \(\varvec{n}^*\) represents the outward-pointing normal vector for the boundary surface.

Based on the strain gradient elasticity theory [75], the variation of the strain energy and the external work can be written as

$$\begin{aligned} \delta \mathbb {W}^{int}&=\int _{\Omega }\big ({\bar{\varvec{\sigma }}}:\varvec{\varepsilon }(\delta \varvec{u})+\varvec{\mu } \dot{:}\nabla \varvec{\varepsilon }(\delta \varvec{u})\big )\text {d}\Omega =\int _{\Omega }\big ({\bar{\varvec{\sigma }}}:\varvec{\varepsilon }(\delta \varvec{u})+\frac{\ell ^2}{2} \nabla \bar{\varvec{\sigma }}{:}\nabla \varvec{\varepsilon }(\delta \varvec{u})\big )\text {d}\Omega \end{aligned}$$
(103)
$$\begin{aligned} \delta \mathbb {W}^{ext}&=\int _{\Omega } \varvec{b} \cdot \delta \varvec{u} \text {d}\Omega +\int _{\partial \Omega } \varvec{\mathbb {P}} \cdot \delta \varvec{u} \text {d}S+\int _{\partial \Omega } \varvec{\mathbb {R}} \cdot (\varvec{n}^* \cdot \nabla \delta \varvec{u}) \text {d}S \end{aligned}$$
(104)

where \(\varvec{\mu }\) denotes the third rank double stress tensor.

In Eq. 103, the Cauchy-like quantities \({\bar{\varvec{\sigma }}}\), work-conjugate to \(\varvec{\varepsilon }\), and the double stress \(\varvec{\mu }\), work-conjugate to \(\nabla \varvec{\varepsilon }\), are derived from the partial derivatives of the strain energy density with respect to \(\varvec{\varepsilon }\) and \(\nabla \varvec{\varepsilon }\) [74], respectively. Accordingly, we can obtain \(\bar{\varvec{\sigma }}\) and \(\varvec{\mu }\) as shown in follows

$$\begin{aligned} \bar{\varvec{\sigma }}=\frac{\partial \mathbb {W}^{int}}{\partial {\varvec{\varepsilon }}}=2 \mu \varvec{\varepsilon }+\lambda \text {tr}(\varvec{\varepsilon }) {\mathbf {I}},\,\varvec{\mu }=\frac{\partial \mathbb {W}^{int}}{\partial {\nabla \varvec{\varepsilon }}}=\ell ^2 \nabla \bar{\varvec{\sigma }}\end{aligned}$$
(105)

where \(\text {tr}\varvec{\varepsilon }=\nabla \cdot \varvec{u}\), \({\mathbf {I}}\) is the symmetric second rank unit tensor.

The Cauchy-like stress tensor \(\bar{\varvec{\sigma }}\) and strain tensor \(\varvec{\varepsilon }\) are coupled typically by Hooke’s law [76], but the double stress tensor \(\varvec{\mu }\) is expressed on the basis of the Cauchy stress tensor, yielding the total stress tensor \(\varvec{\sigma }\) in the form

$$\begin{aligned} \varvec{\sigma }=\varvec{\bar{\varvec{\sigma }}}-\ell ^{2} \Delta \varvec{\bar{\varvec{\sigma }}} \end{aligned}$$
(106)

According to the principle of virtual work, \(\delta {\mathcal {F}}_{int}-\delta {\mathcal {F}}_{ext}=0\) is valid for \(\delta \varvec{u}\) in \(\Omega\) and on surface \(\partial \Omega\), which lead to the following governing equation and boundary conditions in terms of the Cauchy-like stress are written below

$$\begin{aligned}&\left( 1-\ell ^{2} \Delta \right) (\mu \Delta \varvec{u}+(\lambda + \mu )\nabla \nabla \cdot {\mathbf {u}})+\varvec{b}=0&\quad \text{ in } \Omega \end{aligned}$$
(107a)
$$\begin{aligned}&\varvec{n}^* \cdot \left( \varvec{\bar{\varvec{\sigma }}}-\ell ^{2} \Delta \varvec{\bar{\varvec{\sigma }}}\right) -\ell ^{2} \nabla _{\partial \Omega } \cdot (\varvec{n}^* \cdot \nabla \varvec{\bar{\varvec{\sigma }}})+\ell ^{2}\left( \nabla _{\partial \Omega } \cdot \varvec{n}^*\right) \varvec{n}^* \otimes \varvec{n}^* : \nabla \varvec{\bar{\varvec{\sigma }}}={\varvec{\mathbb {P}}}&\quad \text{ on } \partial \Omega _{\varvec{\mathbb {P}}} \end{aligned}$$
(107b)
$$\begin{aligned}&\varvec{u}=\bar{\varvec{u}}&\quad \text{ on } \partial \Omega _{\varvec{u}} \end{aligned}$$
(107c)
$$\begin{aligned}&\ell ^{2} \varvec{n}^* \otimes \varvec{n}^* : \nabla \varvec{\bar{\varvec{\sigma }}}={\varvec{\mathbb {R}}}&\quad \text{ on } \partial \Omega _{\varvec{\mathbb {R}}} \end{aligned}$$
(107d)
$$\begin{aligned}&\varvec{n}^* \cdot \nabla \varvec{u}=\frac{\partial \bar{\varvec{u}}}{\partial \varvec{n}^*}= \bar{\varvec{v}}&\quad \text{ on } \partial \Omega _{\varvec{v}} \end{aligned}$$
(107e)

where \(\bar{\varvec{u}},\bar{\varvec{v}},{\varvec{\mathbb {P}}},{\varvec{\mathbb {R}}}\) represent known functions, \(\nabla _{\partial \Omega }(=\nabla -\varvec{n}^* \otimes \varvec{n}^* \cdot \nabla )\) denotes surface gradient. The boundary surface is composed of disjoint and have the follow relationships: \(\partial \Omega =\partial \Omega _{\varvec{\mathbb {P}}}\cup \partial \Omega _{\varvec{\mathbb {R}}}\cup \partial \Omega _{\varvec{u}}\cup \partial \Omega _{\varvec{v}}\), \(\partial \Omega _{\varvec{\mathbb {P}}}\cup \partial \Omega _{\varvec{u}}=\partial \Omega _{\varvec{\mathbb {R}}}\cup \partial \Omega _{\varvec{v}}\) and \(\partial \Omega _{\varvec{\mathbb {P}}}\cap \partial \Omega _{\varvec{u}}=\partial \Omega _{\varvec{\mathbb {R}}}\cap \partial \Omega _{\varvec{v}}=\emptyset\) .

To make the expression clearer, we simplify the Eq. 102 and make some modifications to following

$$\begin{aligned} \mathbb {W}_i=&\int _\Omega \mathbbm {w}_i(\varvec{\xi }_{ij})\mathbb {W}_{i1}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i1}\right) \text {d}\Omega +\int _\Omega \mathbbm {w}_i(\varvec{\xi }_{ij})\mathbb {W}_{i2}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i2}\right) \text {d}\Omega -\int _{\Omega } \mathbbm {w}_i(\varvec{\xi }_{ij})\mathbb {W}_{i3}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i3}\right) \text {d}\Omega \nonumber \\&-\int _{\partial \Omega _{\varvec{\mathbb {P}}}}\mathbbm {w}_i (\varvec{\xi }_{ij})\mathbb {W}_{i4}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i4}\right) \text {d}S-\int _{\partial \Omega _{\varvec{u}}} \mathbbm {w}_i(\varvec{\xi }_{ij}) \mathbb {W}_{i5}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i5}\right) \text {d}S\nonumber \\ =&\int _\Omega \mathbbm {w}_i(\varvec{\xi }_{ij})\mathbb {W}_{i1}\left( {\mathbf {B}}_{\alpha i1}{\mathbf {U}}_{i1}\right) \text {d}\Omega +\int _\Omega \mathbbm {w}_i(\varvec{\xi }_{ij}) \mathbb {W}_{i2}\left( {\mathbf {B}}_{\alpha i2}{\mathbf {U}}_{i2}\right) \text {d}\Omega -\int _{\Omega }\mathbbm {w}_i (\varvec{\xi }_{ij})\mathbb {W}_{i3}\left( {\mathbf {B}}_{\alpha i3}{\mathbf {U}}_{i3}\right) \text {d}\Omega \nonumber \\&-\int _{\partial \Omega _{\varvec{\mathbb {P}}}}\mathbbm {w}_i(\varvec{\xi }_{ij}) \mathbb {W}_{i4}\left( {\mathbf {B}}_{\alpha i4}{\mathbf {U}}_{i4}\right) \text {d}S-\int _{\partial \Omega _{\varvec{u}}} \mathbbm {w}_i(\varvec{\xi }_{ij}) \mathbb {W}_{i5}\left( {\mathbf {B}}_{\alpha i5}{\mathbf {U}}_{i5}\right) \text {d}S \end{aligned}$$
(108)

where

$$\begin{aligned} \begin{array}{l} \mathbbm {w}_i(\varvec{\xi }_{ij})=(1-\xi _{ij}/\mathbbm {l})^n \,\,\text {denotes the weight function} \\ \mathbb {W}_{i1}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i1}\right) =\frac{1}{2} \varvec{\sigma }_{i}: \varvec{\varepsilon }_{i}, \text{ and } \tilde{\partial }_\alpha {\mathbf {u}}_{i1}=\left( \frac{{\partial u_i}}{ \partial x}, \frac{{\partial u_i}}{ \partial y}, \frac{{\partial u_i}}{ \partial z}, \frac{\partial v_i}{ \partial x}, \frac{\partial v_i}{ \partial y}, \frac{\partial v_i}{ \partial z}, \frac{\partial w_i}{ \partial x} , \frac{\partial w_i}{ \partial y}, \frac{\partial w_i}{ \partial z}\right) ^{T} \\ \mathbb {W}_{i2}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i2}\right) =\frac{l^{2}}{2} \nabla \varvec{\sigma }_{i}: \nabla \varvec{\varepsilon }_{i}, \text{ and } \tilde{\partial }_\alpha {\mathbf {u}}_{i2}=\left( \frac{{\partial ^2 u_i}}{ \partial x \partial x}, \frac{{\partial ^2 u_i}}{ \partial x\partial y}, \frac{{\partial ^2 u_i}}{ \partial x \partial z},\frac{{\partial ^2 u_i}}{ \partial y \partial y}, \frac{{\partial ^2 u_i}}{ \partial y\partial z}, \frac{{\partial ^2 u_i}}{ \partial z \partial z},\cdots \right) ^{T} \\ \mathbb {W}_{i3}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i3}\right) =-\varvec{b}_i \cdot \varvec{u}_i \text{ and } \tilde{\partial }_\alpha {\mathbf {u}}_{i3}=(u_i, v_i,w_i)^{T} \\ \mathbb {W}_{i4}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i4}\right) =-{\varvec{\mathbb {P}}_i } \cdot \varvec{u}_i, \text{ and } \tilde{\partial }_\alpha {\mathbf {u}}_{i4}=(u_i, v_i,w_i)^{T} \\ \mathbb {W}_{i5}\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i5}\right) =-\varvec{\mathbb {P}}_i \cdot (\varvec{u}_i-\overline{\varvec{u}_i}), \text{ and } \tilde{\partial }_\alpha {\mathbf {u}}_{i5}=(u_i, \frac{{\partial u_i}}{ \partial x}, \frac{{\partial u_i}}{ \partial y}, \frac{{\partial u_i}}{ \partial z},\frac{{\partial ^2 u_i}}{ \partial x \partial x}, \frac{{\partial ^2 u_i}}{ \partial x\partial y}, \frac{{\partial ^2 u_i}}{ \partial x \partial z},\frac{{\partial ^2 u_i}}{ \partial y \partial y}, \frac{{\partial ^2 u_i}}{ \partial y\partial z}, \frac{{\partial ^2 u_i}}{ \partial z \partial z},\\ \frac{{\partial ^3 u_i}}{ \partial x \partial x\partial x}, \frac{{\partial ^3 u_i}}{ \partial x \partial x\partial y}, \frac{{\partial ^3 u_i}}{ \partial x \partial x \partial z},\frac{{\partial ^3 u_i}}{ \partial x \partial y \partial y}, \frac{{\partial ^3 u_i}}{ \partial x \partial y\partial z}, \frac{{\partial ^3 u_i}}{ \partial x\partial z \partial z},\frac{{\partial ^3 u_i}}{ \partial y \partial y \partial y},\frac{{\partial ^3 u_i}}{ \partial y \partial y \partial z}, \frac{{\partial ^3 u_i}}{ \partial y \partial z\partial z}, \frac{{\partial ^3 u_i}}{ \partial z\partial z \partial z}\cdots )^{T}\nonumber \\ \end{array} \end{aligned}$$
(109)

According to the Eq. 108, we can establish the residual and the corresponding tangent stiffness matrix at point \({\mathbf {x}}_i\) of the overall system:

$$\begin{aligned} \varvec{R}_i&=\frac{\partial \mathbb {W}_i}{\partial {\mathbf {U}}_{i}}\nonumber \\&=\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i1}\right) ^T\mathbf{D} _{i1}{\mathbf {B}}_{\alpha i1}\Delta V_j +\sum _{j\in {\mathcal {S}}_{i}} \mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i2}\right) ^T\mathbf{D} _{i2}{\mathbf {B}}_{\alpha i2}\Delta V_j +\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i3}\right) ^T\mathbf{D} _{i3}{\mathbf {B}}_{\alpha i3}\Delta V_j\nonumber \\&+\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i4}\right) ^T\mathbf{D} _{i4}{\mathbf {B}}_{\alpha i4}\Delta S_j +\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i5}\right) ^T\mathbf{D} _{i5}{\mathbf {B}}_{\alpha i5} \Delta S_j \end{aligned}$$
(110)
$$\begin{aligned}&\mathscr {K}_{i}=\frac{\partial \varvec{R}_i}{\partial {\mathbf {U}}_{i}}\nonumber \\&=\frac{\partial }{\partial {\mathbf {U}}_{i}}\big (\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i1}\right) ^T\mathbf{D} _{i1}{\mathbf {B}}_{\alpha i1}\Delta V_j +\sum _{j\in {\mathcal {S}}_{i}} \mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i2}\right) ^T\mathbf{D} _{i2}{\mathbf {B}}_{\alpha i2}\Delta V_j +\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i3}\right) ^T\mathbf{D} _{i3}{\mathbf {B}}_{\alpha i3}\Delta V_j\nonumber \\&+\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i4}\right) ^T\mathbf{D} _{i4}{\mathbf {B}}_{\alpha i4}\Delta S_j +\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( \tilde{\partial }_\alpha {\mathbf {u}}_{i5}\right) ^T\mathbf{D} _{i5}{\mathbf {B}}_{\alpha i5} \Delta S_j\big )\nonumber \\&=\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( {\mathbf {B}}_{\alpha i1}\right) ^T\mathbf{D} _{i1}{\mathbf {B}}_{\alpha i1}\Delta V_j +\sum _{j\in {\mathcal {S}}_{i}} \mathbbm {w}_i\left( {\mathbf {B}}_{\alpha i2}\right) ^T\mathbf{D} _{i2}{\mathbf {B}}_{\alpha i2}\Delta V_j +\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( {\mathbf {B}}_{\alpha i3}\right) ^T\mathbf{D} _{i3}{\mathbf {B}}_{\alpha i3}\Delta V_j\nonumber \\&+\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( {\mathbf {B}}_{\alpha i4}\right) ^T\mathbf{D} _{i4}{\mathbf {B}}_{\alpha i4}\Delta S_j +\sum _{j\in {\mathcal {S}}_{i}}\mathbbm {w}_i\left( {\mathbf {B}}_{\alpha i5}\right) ^T\mathbf{D} _{i5}{\mathbf {B}}_{\alpha i5} \Delta S_j \end{aligned}$$
(111)

A 3D gradient elasticity cantilever beam under uniform shear load is considered. The cantilever beam with dimensions of \(25\times 10\times 3\) m\(^3\). The material parameters are considered: \(E=6\times 10^4\) MPa, \(\nu =0.33\). The uniform shear force \(P_y=-1.0\times 10^{-3}\) MPa. The higher-order NOM based on numerical integration [77] is employed to investigate the effectiveness of the current method for gradient elasticity cantilever beam. The cantilever beam is discretized into 3744 points and hexahedral background meshes are generated for the numerical integration. We employ 40 Gauss neighbor points in the numerical test. For separate variables (uvw) in 3D cantilever beam, Eq. 108 include the differential operators \(\nabla u\), \(\nabla v\),\(\nabla w,\nabla ^2 u,\nabla ^2 v,\nabla ^2 w,\nabla ^3 u,\nabla ^3 v,\nabla ^3 w\). The maximal order of partial derivatives in Eq. 108 is three, hence we select the third order of nonlocal operators in Eq. 31. In addition, various gradient coefficients \(\ell =0,1.5,3.0,4.5\) are studied by current method and the displacement field for various gradient coefficients is given in Fig. 13. Figure 14 presents the displacement for points on the line \((y=10,z=0)\). The results obtained by higher-order NOM correspond well with those obtained by ABAQUS and with the gradient coefficient raising, the deform of the beam become more uniformly.

Fig. 13
figure 13

Displacement for various different gradient coefficients

Fig. 14
figure 14

Displacement for points on the line \((y=10,z=0)\)

5 Conclusions

In this paper, we present the implementation procedure of first-order and higher-order NOM, and an open-source Mathematica code is presented and explained in detail. The performance of first-order NOM and higher-order NOM results are demonstrated compare with the corresponding analytical solutions or the results of the FEM commercial software. Concluding remarks can be stated as follows:

Similar to the FEM and meshless method, NOM can establish the operator energy functional and tangent stiffness matrix by some matrix multiplications. However, unlike FEM and the meshless method, NOM can derive differential operators directly without employing shape functions. Hence, the complexity of the NOM is significantly reduced. The NOM requires only the definition of the energy, for a given energy functional, the nonlocal operators can be established automatically by the highest order of partial derivative and dimensions. Support, dual-support, nonlocal differential operators, and operator energy functional are the fundamental components of NOM. According to several numerical examples, which illustrate the method’s high performance and capabilities. In conclusion, NOM is an easy-to-use, flexible, and efficient numerical method, further development of this method will incorporate anisotropic material and elastic-plastic material.