18 #ifndef LIBMESH_CONST_FEM_FUNCTION_H
19 #define LIBMESH_CONST_FEM_FUNCTION_H
22 #include "libmesh/dense_vector.h"
23 #include "libmesh/fem_function_base.h"
24 #include "libmesh/int_range.h"
41 template <
typename Output=Number>
68 virtual std::unique_ptr<FEMFunctionBase<Output>>
clone ()
const override
69 {
return std::make_unique<ConstFEMFunction>(*this); }
80 const Real = 0.)
override
96 for (
auto i : index_range(output))
107 #endif // LIBMESH_CONST_FEM_FUNCTION_H
ConstFEMFunction(const Output c)
构造函数,用于初始化常量值。
virtual std::unique_ptr< FEMFunctionBase< Output > > clone() const override
克隆函数。创建并返回一个与当前实例相同类型的新实例。
virtual Output operator()(const FEMContext &c, const Point &p, const Real=0.) override
重载操作符,用于计算标量值。
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual ~ConstFEMFunction()=default
默认析构函数。
ConstFEMFunction & operator=(const ConstFEMFunction &)=default
FEMFunctionBase是一个基类,用户可以从中派生出“函数样式”的对象,以在FEMSystem中使用。