libmesh解析
本工作只是尝试解析原libmesh的代码,供学习使用
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 
tensor_tools.C
浏览该文件的文档.
1 // The libMesh Finite Element Library.
2 // Copyright (C) 2002-2023 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License, or (at your option) any later version.
8 
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
13 
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 
18 #include "libmesh/tensor_tools.h"
19 #include "libmesh/vector_value.h"
20 #include "libmesh/tensor_value.h"
21 #include "libmesh/type_n_tensor.h"
22 
23 namespace libMesh
24 {
25 namespace TensorTools
26 {
27 // Needed for ExactSolution to compile
29 {
30  libmesh_error_msg("Operation not defined for scalar quantities.");
31 }
32 
34 {
35  const Number duz_dy = grad(2,1);
36  const Number duy_dz = grad(1,2);
37  const Number dux_dz = grad(0,2);
38  const Number duz_dx = grad(2,0);
39  const Number duy_dx = grad(1,0);
40  const Number dux_dy = grad(0,1);
41 
42  return VectorValue<Number>(duz_dy - duy_dz,
43  dux_dz - duz_dx,
44  duy_dx - dux_dy);
45 }
46 
47 // Needed for ExactSolution to compile. Will implement when needed.
49 {
50  libmesh_not_implemented();
51 }
52 
53 // Needed for ExactSolution to compile
55 {
56  libmesh_error_msg("Operation not defined for scalar quantities.");
57 }
58 
60 {
61  const Number dux_dx = grad(0,0);
62  const Number duy_dy = grad(1,1);
63  const Number duz_dz = grad(2,2);
64 
65  return dux_dx + duy_dy + duz_dz;
66 }
67 
68 // Needed for ExactSolution to compile. Will implement when needed.
70 {
71  libmesh_not_implemented();
72 }
73 
74 }
75 }
Number div_from_grad(const VectorValue< Number > &)
虚拟函数。标量的散度未定义,但需要使ExactSolution编译通过
Definition: tensor_tools.C:54
此类定义了LIBMESH_DIM维的实数或复数空间中的向量。
Definition: tensor_tools.h:35
该类最终将定义一个在类型为T的LIBMESH_DIM维空间中的N阶张量。
Definition: tensor_tools.h:38
Number curl_from_grad(const VectorValue< Number > &)
Definition: tensor_tools.C:28
此类定义了LIBMESH_DIM维度的实数或复数空间中的张量。typedef RealTensorValue总是定义为实数值的张量, 而NumberTensorValue则根据库的配置定义为实数或复数值...
Definition: tensor_tools.h:37