원시데이터 수집 시스템
선정목록으로

Minimization of p-Laplacian via the Finite Element Method in MATLAB

관련 수소연료전지 · (5) 연료전지용 수분제어장치(가습기)

기본 정보

저자
  1. Matonoha, Ctirad
  2. Moskovka, Alexej
  3. Valdman, Jan
DOI
10.48550/arxiv.2103.02125
저널
arXiv (Cornell University)
발행년도
2022
발행기관
Cornell University
피인용수
0
라이선스
0
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.48550/arxiv.2103.02125
토픽
Composite Material Mechanics
OpenAlex ID
W6910565719

평가 내용

관련도
관련
사업분야
수소연료전지 · (5) 연료전지용 수분제어장치(가습기)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > 연료전지용 수분제어장치(가습기)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

Minimization of energy functionals is based on a discretization by the finite element method and optimization by the trust-region method. A key tool is a local evaluation of the approximated gradients together with sparsity of the resulting Hessian matrix. We describe a vectorized MATLAB implementation of the p-Laplace problem in one and two space-dimensions, however it is easily applicable to other energy formulations.

본문 21,515자

본문 펼치기
## Minimization of p-Laplacian via the Finite Element Method in MATLAB Ctirad Matonoha <sup>1</sup>, Alexej Moskovka <sup>2</sup>, and Jan Valdman <sup>3</sup> <sup>_,_</sup> <sup>4</sup> <sup>_⋆_</sup> 1The Czech Academy of Sciences, Institute of Computer Science, Pod Vod´arenskou vˇeˇz´ı 2, 18207 Prague 8, Czechia ``` matonoha@cs.cas.cz ``` 2Faculty of Applied Sciences, Department of Mathematics, University of West Bohemia, Technick´a 8, 30614 Pilsen, Czechia ``` alexmos@kma.zcu.cz ``` 3The Czech Academy of Sciences, Institute of Information Theory and Automation, Pod Vod´arenskou vˇeˇz´ı 4, 18208 Prague 8 4Department of Applied Informatics, Faculty of Science, University of South Bohemia, Braniˇsovsk´a 31, 37005 Cesk´e <sup>ˇ</sup> Budˇejovice, Czechia ``` jan.valdman@utia.cas.cz ``` Abstract. Minimization of energy functionals is based on a discretization by the finite element method and optimization by the trust-region method. A key tool to an efficient implementation is a local evaluation of the approximated gradients together with sparsity of the resulting Hessian matrix. Vectorization concepts are explained for the p-Laplace problem in one and two space-dimensions. Keywords: finite elements, energy functional, trust-region methods, pLaplace equation, MATLAB code vectorization. 1 Introduction We are interested in a (weak) solution of the p-Laplace equation [5,8]: _∆pu_ = _f_ in _Ω,_ (1) _u_ = _g_ on _∂Ω,_ where the p-Laplace operator is defined as _∆pu_ = _∇·_ - _|∇u|_ <sup>_p−_</sup> <sup>2</sup> _∇u_ - for some power _p >_ 1. The domain _Ω_ _∈_ R <sup>_d_</sup> is assumed to have a Lipschitz boundary _∂Ω_, _f_ _∈_ _L_ <sup>2</sup> ( _Ω_ ) and _g_ _∈_ _W_ <sup>1</sup> <sup>_−_</sup> <sup>1</sup> <sup>_/p,p_</sup> ( _∂Ω_ ), where _L_ and _W_ denote standard Lebesque and Sobolev spaces. It is known that (1) represents an Euler-Lagrange equation where the p-Laplace operator is defined as _∆pu_ = _∇·_ - _|∇u|_ <sup>_p−_</sup> <sup>2</sup> _∇u_ _⋆_ The work of C. Matonoha was supported by the long-term strategic development financing of the Institute of Computer Science (RVO:67985807). The work of A. Moskovka and J. Valdman was supported by the Czech-Austrian Mobility MSMT Grant: 8J21AT001. 2 Ctirad Matonoha, Alexej Moskovka, Jan Valdman corresponding to a minimization problem _J_ ( _v_ ) := <sup><u>1</u></sup> _v∈V_ <sup>_J_</sup> <sup>(</sup> <sup>_v_</sup> <sup>)</sup> <sup>_,_</sup> _p_ _Ω_ _f v_ d _x,_ (2) _J_ ( _u_ ) = min _v∈V_ _p_ _Ω_ _|∇v|_ <sup>_p_</sup> d _x −_ where _V_ = _Wg_ <sup>1</sup> <sup>_,p_</sup> ( _Ω_ ) = _{v_ _∈_ _W_ <sup>1</sup> <sup>_,p_</sup> _, v_ = _g_ on _∂Ω}_ includes Dirichlet boundary conditions on _∂Ω_ . The minimizer _u ∈_ _V_ of (2) is known to be unique for _p >_ 1. Due to the high complexity of the p-Laplace operator (with the exception of the case _p_ = 2 which corresponds to the classical Laplace operator), the analytical handling of (1) is difficult. The finite element method [2,3] can be applied as an approximation of (2) and results in a minimization problem _|∇v|_ <sup>_p_</sup> d _x −_ _Ω_ min _J_ ( _v_ ) := <sup><u>1</u></sup> _v∈Vh_ <sup>_J_</sup> <sup>(</sup> <sup>_v_</sup> <sup>)</sup> <sup>_,_</sup> _p_ _J_ ( _uh_ ) = _v_ min _∈V_ _p_ _Ω_ _f v_ d _x_ (3) formulated over the finite-dimensional subspace _Vh_ of _V_ . We consider for simplicity the case _Vh_ = _P_ <sup>1</sup> ( _T_ ) only, where _P_ <sup>1</sup> ( _T_ ) is the space of nodal basis functions defined on a triangulation _T_ of the domain _Ω_ using the simplest possible elements (intervals for _d_ = 1, triangles for _d_ = 2, tetrahedra for _d_ = 3). The subspace _Vh_ is spanned by a set of _nb_ basis functions _ϕi_ ( _x_ ) _∈_ _Vh, i_ = 1 _, . . ., nb_ and a trial function _v_ _∈_ _Vh_ is expressed by a linear combination _v_ ( _x_ ) = _nb_ _i_ =1 _vi ϕi_ ( _x_ ) _,_ _x ∈_ _Ω,_ where _v_ ¯ = ( _v_ 1 _, . . ., vnb_ ) _∈_ R <sup>_nb_</sup> is a vector of coefficients. The minimizer _uh_ _∈_ _Vh_ of (3) is represented by a vector of coefficients _u_ ¯ = ( _u_ 1 _, . . ., unb_ ) _∈_ R <sup>_nb_</sup> and some coefficients of _u,_ ¯ ¯ _v_ related to Dirichlet boundary conditions are prescribed. In this paper, the first-order optimization methods are combined with FEM implementations [1,7] in order to solve (3) efficiently. These are the quasi-Newton (QN) and the trust-region (TR) methods [4] that are available in the MATLAB Optimization Toolbox. The QN methods only require the knowledge of _J_ ( _v_ ) and is therefore easily applicable. The TR methods additionally require the numerical gradient vector _∇J_ (¯ _v_ ) _∈_ R <sup>_nb_</sup> _,_ _v_ ¯ _∈_ R <sup>_nb_</sup> and also allow to specify a sparsity pattern of the Hessian matrix _∇_ <sup>2</sup> _J_ (¯ _v_ ) _∈_ R <sup>_nb×nb_</sup> _,_ ¯ _v_ _∈_ R <sup>_nb_</sup>, i.e., only positions (indices) of nonzero entries. The sparsity pattern is directly given by a finite element discretization. We compare four different options: _•_ option 1 : the TR method with the gradient evaluated directly via its explicit form and the specified Hessian sparsity pattern. _•_ option 2 : the TR method with the gradient evaluated approximately via central differences and the specified Hessian sparsity pattern. Minimization of p-Laplacian via FEM in MATLAB 3 _•_ option 3 : the TR method with the gradient evaluated approximately via central differences and no Hessian sparsity pattern. _•_ option 4 : the QN method. Clearly, option 1 is only applicable if the exact form of gradient is known while option 2 with the approximate gradient is only bounded to finite elements discretization and is always feasible. Similarly to option 2, option 3 also operates with the approximate form of gradient, however the Hessian matrix is not specified. Option 3 serves as an intermediate step between options 2 and 4. Option 4 is based on the Broyden–Fletcher–Goldfarb–Shanno (BFGS) formula. 2 One-dimensional problem The p-Laplace equation (1) can be simplified as _x_ <sup>=</sup> <sup>_f_</sup> in _Ω_ = ( _a, b_ ) (4) and the energy as 0 -1 -2 -3 -4 -5 -6 -7 -8 - _|ux|_ <sup>_p−_</sup> <sup>2</sup> _ux_ _J_ ( _v_ ) := <sup><u>1</u></sup> _p_ p=1.8 p=2 p=3 - _b_ _a_ _|vx|_ <sup>_p_</sup> d _x −_ _Ω_ _f v_ d _x ._ (5) -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Fig. 1. Solutions for _p_ _∈{_ 1 _._ 8 _,_ 2 _,_ 3 _}, Ω_ = ( _−_ 1 _,_ 1) _, f_ = _−_ 10 and Dirichlet boundary conditions _u_ ( _−_ 1) = _u_ (1) = 0. Assume for simplicity an equidistant distribution of _n_ +2 discretization points ordered in a vector ( _x_ 0 _, . . ., xn_ +1) _∈_ R <sup>_n_</sup> <sup>+2</sup> _,_ where _xi_ := _a_ + _i h_ for _i_ = 0 _,_ 1 _, . . ., n_ + 1 and _h_ := ( _b−a_ ) _/_ ( _n_ +1) denotes an uniform length of all sub-intervals. It means that _x_ 0 = _a, xn_ +1 = _b_ are boundary nodes. 4 Ctirad Matonoha, Alexej Moskovka, Jan Valdman There are _n_ + 2 = _nb_ well-known hat basis functions _ϕ_ 0( _x_ ) _, . . ., ϕn_ +1( _x_ ) satisfying the property _ϕi_ ( _xj_ ) = _δij, i, j_ = 0 _, . . ., n_ + 1 _,_ where _δ_ denotes the Kronecker symbol. Then, _v_ _∈_ _Vh_ is a piecewise linear and globally continuous function on ( _a, b_ ) represented by a vector of coefficients _v_ ¯ = ( _v_ 0 _, . . ., vn_ +1) _∈_ R <sup>_n_</sup> <sup>+2</sup> _._ The minimizer _uh_ _∈_ _Vh_ is similarly represented by a vector _u_ ¯ = ( _u_ 0 _, . . ., un_ +1) _∈_ R <sup>_n_</sup> <sup>+2</sup> . Dirichlet boundary conditions formulated at both interval ends imply _v_ 0 = _u_ 0 = _g_ ( _a_ ) _, vn_ +1 = _un_ +1 = _g_ ( _b_ ) _,_ where boundary values _g_ ( _a_ ) _, g_ ( _b_ ) are prescribed. It is convenient to form a mass matrix _M_ _∈_ R <sup>(</sup> <sup>_n_</sup> <sup>+2)</sup> <sup>_×_</sup> <sup>(</sup> <sup>_n_</sup> <sup>+2)</sup> with entries _._ (6)    1 _/_ 3 _,_ _i_ = _j_ _∈{_ 1 _, n_ + 2 _}_ 2 _/_ 3 _,_ _i_ = _j_ _∈{_ 2 _, . . ., n_ + 1 _}_ 1 _/_ 6 _,_ _|i −_ _j|_ = 1 0 _,_ otherwise _Mi,j_ = - _b_ _a_ _ϕi−_ 1( _x_ ) _ϕj−_ 1( _x_ ) d _x_ = _h ·_ If we assume that _f_ _∈_ _Vh_ is represented by a (column) vector _f_ <sup>¯</sup> = ( _f_ 0 _, . . ., fn_ +1) _∈_ R <sup>_n_</sup> <sup>+2</sup>, then the linear energy term reads exactly - _b_ _a_ _n_ +1 _fv_ d _x_ = _f_ <sup>¯</sup> <sup>_T_</sup> _M_ _v_ ¯ = <sup>¯</sup> _b_ <sup>_T_</sup> _v_ ¯ = _i_ =0 _bivi,_ where <sup>¯</sup> _b_ = ( _b_ 0 _, . . ., bn_ +1) = _f_ <sup>¯</sup> <sup>_T_</sup> _M_ _∈_ R <sup>_n_</sup> <sup>+2</sup> . The gradient energy term is based on the derivative _vx_ which is a piecewise constant function and reads _vx|_ ( _xi−_ 1 _,xi_ ) = ( _vi −_ _vi−_ 1) _/h,_ _i_ = 1 _, . . ., n_ + 1 _._ Now, it is easy to derive the following minimization problem: _Problem_ _1_ _(p-Laplacian_ _in_ _1D_ _with_ _Dirichlet_ _conditions_ _at_ _both_ _ends)._ Find _u_ = ( _u_ 1 _, . . ., un_ ) _∈_ R <sup>_n_</sup> satisfying _n_ +1 _i_ =0 <u>1</u> _J_ ( _u_ ) = _v_ min _∈_ R <sup>_n J_</sup> <sup>(</sup> <sup>_v_</sup> <sup>)</sup> <sup>_,_</sup> _J_ ( _v_ ) = _p h_ <sup>_p−_</sup> <sup>1</sup> _n_ +1 - _|vi −_ _vi−_ 1 _|_ <sup>_p_</sup> _−_ _i_ =1 _bivi,_ (7) where values _v_ 0 := _g_ ( _a_ ) _, vn_ +1 := _g_ ( _b_ ) are prescribed. Note that the full solution vector reads _u_ ¯ = ( _g_ ( _a_ ) _, u, g_ ( _b_ )) _∈_ R <sup>_n_</sup> <sup>+2</sup> _,_ where _u ∈_ R <sup>_n_</sup> solves Problem 1 above. Figure 1 illustrates discrete minimizers _u_ ¯ for ( _a, b_ ) = ( _−_ 1 _,_ 1), _f_ = _−_ 10 and _p_ _∈{_ 1 _._ 8 _,_ 2 _,_ 3 _}_ assuming zero Dirichlet conditions _u_ ( _a_ ) = _u_ ( _b_ ) = 0. Recall that the exact solution _u_ is known in this simple example. Table 1 depicts performance of all four options for the case _p_ = 3 only, in _√_ which the exact energy reads _J_ ( _u_ ) = _−_ <sup><u>16</u></sup> 3 10 _≈−_ 16 _._ 8655. The first column of every option shows evaluation time, while the second column provides the total number of linear systems to be solved (iterations), including rejected steps. Clearly, performance of options 1 and 2 dominates over options 3 and 4. Minimization of p-Laplacian via FEM in MATLAB 5 <u>option</u> <u>1:</u> <u>option</u> <u>2:</u> <u>option</u> <u>3:</u> <u>option</u> <u>4:</u> <u>n</u> <u>time</u> <u>iters</u> <u>time</u> <u>iters</u> <u>time</u> <u>iters</u> <u>time</u> <u>iters</u> 1e1 0.01 8 0.01 6 0.02 6 0.02 17 1e2 0.03 12 0.05 11 0.49 11 0.29 94 1e3 0.47 37 0.50 15 96.22 14 70.51 922 Table 1. MATLAB performance in 1D for _p_ = 3. Times are given in seconds. 3 Two-dimensional problem The equation (1) in 2D has the form = _f_ in _Ω_ (8) �� - _<u>∂u</u>_ _∂y_ 2 �2 <sup>�</sup> <sup>_<u>p−</u>_</sup> <sup><u>2</u></sup> _∇u_ _∇·_ ��� _<u>∂u</u>_ _∂x_ �2 + and the corresponding energy reads _J_ ( _v_ ) := <sup><u>1</u></sup> _p_ �� _Ω_ - _|vx|_ <sup>_p_</sup> + _|vy|_ <sup>_p_</sup> <sup>�</sup> d _x_ d _y −_ _f v_ d _x_ d _y ._ (9) _Ω_ 1.5 2 0 -0.5 -1 -1.5 -2 -2.5 2 0 -0.2 -0.4 -0.6 -0.8 -1 -1.2 -1.4 2 1.5 2 1 1.5 1 1.5 1 1 0.5 0.5 0 0 x y 0.5 0.5 0 0 x y Fig. 2. Numerical solutions with contour lines for _p_ = 1 _._ 8 (left) and _p_ = 3 (right) and a L-shape domain _Ω, f_ = _−_ 10 and zero Dirichlet boundary conditions on _∂Ω_ . Assume a domain _Ω_ _∈_ R <sup>2</sup> with a polygonal boundary _∂Ω_ is discretized by a regular triangulation of triangles [3]. The sets _T_ and _N_ denote the sets of all triangles and their nodes (vertices) and _|T |_ and _|N|_ their sizes, respectively. Let _Ndof_ _⊂N_ be the set of all internal nodes and _N_ _\ Ndof_ denotes the set of boundary nodes. A trial function _v_ _∈_ _Vh_ = _P_ 1( _T_ ) is a globally continuous and linear scalar function on each triangle _T_ _∈T_ represented by a vector of coefficients _v_ ¯ = 6 Ctirad Matonoha, Alexej Moskovka, Jan Valdman ( _v_ 1 _, . . ., v|N|_ ) _∈_ R <sup>_|N|_</sup> _._ Similarly the minimizer _uh_ _∈_ _Vh_ is represented by a vector of coefficients _u_ ¯ = ( _u_ 1 _, . . ., u|N |_ ) _∈_ R <sup>_|N |_</sup> _._ Dirichlet boundary conditions imply _vi_ = _ui_ = _g_ ( _Ni_ ) _,_ where _Ni_ _∈N_ _\ Ndof_ _,_ (10) and the function _g_ : _∂Ω_ _→_ R prescribes Dirichlet boundary values. _Example_ _1._ A triangulation _T_ of the L-shape domain _Ω_ is given in Figure 3 (left) in which _|T |_ = 24 _, |N|_ = 21 _._ The Hessian sparsity pattern (right) can be directly extracted from the triangulation: it has a nonzero value at the position _i, j_, if nodes _i_ and _j_ share a common edge. The set of internal nodes that appear 21 8 1 21 7 21 8 1 24 18 6 23 18 6 19 20 18 12 11 17 5 16 5 17 6 17 5 16 4 14 2 11 10 20 8 1 16 19 14 13 15 22 16 4 21 4 12 3 7 9 10 9 21 1 9 2 12 3 13 15 Fig. 3. A triangular mesh (left) and the corresponding Hessian sparsity pattern (right). in the minimization process reads _Ndof_ = _{N_ 10 _, N_ 13 _, N_ 14 _, N_ 17 _, N_ 20 _},_ while the remaining nodes belong to the boundary _∂Ω_ . For an arbitrary node _Nk_, _k_ _∈{_ 1 _,_ 2 _, . . ., |N|}_ we define a global basis function _ϕk_ which is linear on every triangle and holds _ϕk_ ( _Nl_ ) = _δkl, l_ _∈{_ 1 _,_ 2 _, . . ., |N|} ._ Note that with these properties all global basis functions are uniquely defined. Similarly to 1D, assume _f_ _∈_ _Vh_ is represented by a (column) vector _f_ <sup>¯</sup> _∈_ R <sup>_|N |_</sup>, and introduce a (symmetric) mass matrix _M_ _∈_ R <sup>_|N |×|N |_</sup> with entries _Mi,j_ = �� �� _i_ =1 <sup>_bivi,_</sup> <sup>where</sup> <sup>_b_</sup> <sup>=</sup> <sup>_f_</sup> <sup>¯</sup> <sup>_T M_</sup> <sup>_∈_</sup> <sup>R</sup> <sup>_|N |_</sup> <sup>.</sup> _fv_ d _x_ d _y_ = <sup>�</sup> _i_ <sup>_|N |_</sup> =1 _i_ <sup>_|N |_</sup> =1 <sup>_bivi,_</sup> <sup>where</sup> <sup>_b_</sup> <sup>=</sup> <sup>_f_</sup> <sup>¯</sup> <sup>_T M_</sup> <sup>_∈_</sup> <sup>R</sup> <sup>_|N |_</sup> <sup>.</sup> _ϕiϕj_ d _x_ d _y._ Then it holds �� _Ω_ _Ω_ Next, for an arbitrary element _Ti_ _∈T_, _i ∈{_ 1 _,_ 2 _, . . ., |T |}_, denote _ϕ_ <sup>_i,_</sup> <sup>1</sup> _, ϕ_ <sup>_i,_</sup> <sup>2</sup> _, ϕ_ <sup>_i,_</sup> <sup>3</sup> all three local basis functions on the _i_ -th element and let _ϕ_ <sup>_i,j_</sup> _x_ <sup>_i,j_</sup> _x_ <sup>_, ϕi,j_</sup> _y_ all three local basis functions on the _i_ -th element and let _ϕ_ <sup>_i,j_</sup> _x_ <sup>_, ϕi,j_</sup> _y_ <sup>_, j_</sup> <sup>_∈{_</sup> <sup>1</sup> <sup>_,_</sup> <sup>2</sup> <sup>_,_</sup> <sup>3</sup> <sup>_}_</sup> be the partial derivatives with respect to ’x’ and ’y’ of the _j_ -th local basis function on the _i_ -th element, respectively. In order to formulate the counterpart of (7) in two dimensions, we define gradient vectors _vx,el, vy,el_ _∈_ R <sup>_|T |_</sup> with entries _vx,el_ <sup>_i_</sup> <sup>=</sup> 3 _j_ =1 _ϕ_ <sup>_i,j_</sup> _x_ <sup>_i,j_</sup> _x_ <sup>_vi,j,_</sup> _v_ <sup>_i_</sup> _y,el_ <sup>_i_</sup> <sup>=</sup> 3 _j_ =1 _ϕ_ <sup>_i,j_</sup> _y_ <sup>_vi,j,_</sup> Minimization of p-Laplacian via FEM in MATLAB 7 where _v_ <sup>_i,j_</sup> is the value of _v_ in the _j_ -th node of the _i_ -th element. With these substitutions we derive the 2D counterpart of Problem 1: _Problem_ _2_ _(p-Laplacian_ _in_ _2D)._ Find a minimizer _u ∈_ R <sup>_|N |_</sup> satisfying min _J_ ( _v_ ) = <sup><u>1</u></sup> _v∈_ R <sup>_|N | J_</sup> <sup>(</sup> <sup>_v_</sup> <sup>)</sup> <sup>_,_</sup> _p_ _y,el_ <sup>_i_</sup> <sup>_|p_</sup> <sup>�</sup> _−_ _x,el_ <sup>_i_</sup> <sup>_|p_</sup> <sup>+</sup> <sup>_|vi_</sup> _|N |_ _i_ =1 _bivi_ (11) _J_ ( _u_ ) = _v∈_ minR _p_ _|T |_ _i_ =1 _|Ti|_ - _|v_ <sup>_i_</sup> with prescribed values _vi_ = _g_ ( _Ni_ ) for _Ni_ _∈N_ _\ Ndof_ . <u>option</u> <u>1:</u> <u>option</u> <u>2:</u> <u>option</u> <u>3:</u> <u>option</u> <u>4:</u> _<u>|Ndof</u>_ _<u>|</u>_ <u>time</u> <u>iters</u> <u>time</u> <u>iters</u> <u>time</u> <u>iters</u> <u>time</u> <u>iters</u> 33 0.04 8 0.05 8 0.15 8 0.06 19 161 0.20 10 0.29 9 3.19 9 0.56 31 705 0.75 9 1.17 9 70.59 9 12.89 64 2945 3.30 10 5.02 9 - - 388.26 133 12033 16.87 12 24.07 10 - - - 48641 75.32 12 107.38 10 - - - Table 2. MATLAB performance in 2D for _p_ = 3. Times are given in seconds. Figure 2 illustrates numerical solutions for the L-shape domain from Figure 3, for _f_ = _−_ 10 and _p_ _∈{_ 1 _._ 8 _,_ 3 _}_ . Table 2 depicts performance of all options for _p_ = 3. Similarly to 1D case (cf. Table 1), performance of options 1 and 2 clearly dominates over options 3 and 4. Symbol ’-’ denotes calculation which ran out of time or out of memory. The exact solution _u_ is not known in this example but numerical approximations provide the upper bound _J_ ( _u_ ) _≈−_ 8 _._ 1625. 3.1 Remarks on 2D implementation As an example of our MATLAB implementation, we introduce below the following block describing the evaluation of formula (11): 1 <mark>f u n c t i o n</mark> <mark>e=energy ( v )</mark> 2 <mark>v</mark> <mark>elems=v ( elems2nodes ) ;</mark> 3 <mark>v</mark> <mark>x</mark> <mark>elems=sum</mark> <mark>( dphi</mark> <mark>x .</mark> <mark>∗</mark> <mark>v</mark> <mark>elems</mark> <mark>, 2 )</mark> <mark>;</mark> 4 <mark>v</mark> <mark>y</mark> <mark>elems=sum</mark> <mark>( dphi</mark> <mark>y .</mark> <mark>∗</mark> <mark>v</mark> <mark>elems</mark> <mark>, 2 )</mark> <mark>;</mark> 5 <mark>i n t g r d s =(1/p) ∗sum</mark> <mark>( abs ( [</mark> <mark>v</mark> <mark>x</mark> <mark>elems</mark> <mark>v</mark> <mark>y</mark> <mark>elems</mark> <mark>] )</mark> <mark>.ˆ p, 2 )</mark> <mark>;</mark> 6 <mark>e=sum</mark> <mark>( areas .</mark> <mark>∗</mark> <mark>i n t g r d s )</mark> <mark>−</mark> <mark>b ’</mark> <mark>∗</mark> <mark>v ;</mark> 7 <mark>end</mark> The whole code is based on several matrices and vectors that contain the topology of the triangulation and gradients of basis functions. Note that these objects are assembled effectively by using vectorization techniques from [1,7] once and do not change during the minimization process. These are (with dimensions): `elems2nodes` _|T | ×_ 3 - for a given element returns three corresponding nodes 8 Ctirad Matonoha, Alexej Moskovka, Jan Valdman `areas` _|T | ×_ 1 - vector of areas of all elements, `areas(i)` = _|Ti|_ `dphi` ~~`x`~~ _|T | ×_ 3 - partial derivatives of all three basis functions with respect to _x_ on every element `dphi` ~~`y`~~ _|T | ×_ 3 - partial derivatives of all three basis functions with respect to _y_ on every element The remaining objects are recomputed in every new evaluation of the energy: `v` ~~`e`~~ `lems` _|T | ×_ 3 - where `v` ~~`e`~~ `lems(i,j)` represents _v_ <sup>_i,j_</sup> above `v` ~~`x`~~ ~~`e`~~ `lems` _|T | ×_ 1 - where `v` ~~`x`~~ `elems(i)` represents _vx,el_ <sup>_i_</sup> `v` ~~`x`~~ ~~`e`~~ `lems` _|T | ×_ 1 - where `v` ~~`x`~~ `elems(i)` represents _vx,el_ <sup>_i_</sup> <sup>above</sup> `v` ~~`y`~~ ~~`e`~~ `lems` _|T | ×_ 1 - where `v` ~~`y`~~ `elems(i)` represents _vy,el_ <sup>_i_</sup> <sup>above</sup> _y,el_ <sup>_i_</sup> <sup>above</sup> The evaluation of the energy above is vital to option 4. For other options, exact and approximate gradients of the discrete energy (11) are needed, but not explained in detail here. Additionally, for options 1 and 2, the Hessian pattern is needed and is directly extracted from the object `elems2nodes` introduced above. Implementation and outlooks Our MATLAB implementation is available at ``` https://www.mathworks.com/matlabcentral/fileexchange/87944 ``` for download and testing. The code is designed in a modular way that different scalar problems involving the first gradient energy terms can be easily added. Additional implementation details on evaluation of exact and approximate gradients will be explained in the forthcoming paper. We are particularly interested in further vectorization of current codes resulting in faster performance and also in extension to vector problems such as nonlinear elasticity. Another goal is to exploit line search methods from [6]. References 1. Anjam I., Valdman J.: _Fast_ _MATLAB_ _assembly_ _of_ _FEM_ _matrices_ _in_ _2D_ _and_ _3D:_ _edge_ _elements._ Applied Mathematics and Computation, 2015, 267, 252-263. 2. Barrett, John W., Liu, Jian G.: _Finite_ _Element_ _Approximation_ _of_ _the_ _p-Laplacian_, Mathematics of Computation, 1993, 61(204):523-537. 3. Ciarlet P.G.: _The_ _Finite_ _Element_ _Method_ _for_ _Elliptic_ _Problems._ SIAM, Philadelphia, 2002. 4. Conn A.R., Gould N.I.M., Toint P.L.: _Trust-Region_ _Methods._ SIAM, Philadelphia, 2000. 5. Dr´abek P., Milota J.: _Methods_ _of_ _Nonlinear_ _Analysis:_ _Applications_ _to_ _Differential_ _Equations_ (second edition), Birkhauser, 2013. 6. L.Lukˇsan, M.T˚uma, C.Matonoha, J.Vlˇcek J., N.Rameˇsov´a, M.Siˇska, <sup>ˇ</sup> J.Hartman: UFO 2017. Interactive System for Universal Functional Optimization. Technical Report V-1252. Prague, ICS AS CR 2017. `[http://www.cs.cas.cz/luksan/ufo.](http://www.cs.cas.cz/luksan/ufo.html)` ``` html ``` 7. Rahman T., Valdman J.: _Fast_ _MATLAB_ _assembly_ _of_ _FEM_ _matrices_ _in_ _2D_ _and_ _3D:_ _nodal_ _elements._ Applied Mathematics and Computation, 2013, 219, 7151-7158. 8. Lindqvist P.: _Notes of the p-Laplace Equation_ (second edition), report 161 (2017) of the Department of Mathematics and Statistics, University of Jyva¨askyl¨a, Finland.

섹션 본문

섹션 본문이 없습니다.

참고문헌

참고문헌 정보가 없습니다.