将不同函数的结果组合成单个向量的函数。所有重写的虚拟函数在function_base.h中都有文档。 更多...
#include <composite_function.h>
Public 成员函数 | |
CompositeFunction ()=default | |
默认构造函数。 更多... | |
CompositeFunction (CompositeFunction &&)=default | |
该类可以使用默认的移动构造和分配。 更多... | |
CompositeFunction & | operator= (CompositeFunction &&)=default |
CompositeFunction (const CompositeFunction &)=delete | |
该类包含unique_ptr成员,因此不能默认复制或分配。 更多... | |
CompositeFunction & | operator= (const CompositeFunction &)=delete |
virtual | ~CompositeFunction ()=default |
子函数向量会自动清理。 更多... | |
void | attach_subfunction (const FunctionBase< Output > &f, std::vector< unsigned int > index_map) |
附加新的子函数,以及从附加的子函数的索引到组合函数的索引的映射。 更多... | |
virtual Output | operator() (const Point &p, const Real time=0) override |
重载操作符,用于计算标量值。 更多... | |
virtual void | operator() (const Point &p, const Real time, DenseVector< Output > &output) override |
重载操作符,用于计算矢量值。 更多... | |
virtual Output | component (unsigned int i, const Point &p, Real time) override |
重载操作符,用于计算特定分量的值。 更多... | |
virtual std::unique_ptr < FunctionBase< Output > > | clone () const override |
克隆函数。创建并返回一个与当前实例相同类型的新实例。 更多... | |
unsigned int | n_subfunctions () const |
获取子函数的数量。 更多... | |
unsigned int | n_components () const |
获取组件的数量。 更多... | |
virtual void | init () |
实际的初始化过程。 更多... | |
virtual void | clear () |
清除函数。 更多... | |
void | operator() (const Point &p, DenseVector< Output > &output) |
Evaluation function for time-independent vector-valued functions. 更多... | |
bool | initialized () const |
void | set_is_time_dependent (bool is_time_dependent) |
设置函数是否依赖时间的函数。 这仅应该由无法本地确定时间依赖性的子类使用。 在这种情况下,应在构造之后立即使用这个函数。 更多... | |
bool | is_time_dependent () const |
Protected 属性 | |
const FunctionBase * | _master |
指向我们的主函数对象的const指针,初始化为 nullptr。 可能存在需要多个函数的情况,但为了节省内存,一个主函数对象可以处理一些集中的数据。 更多... | |
bool | _initialized |
当 init() 被调用以确保一切都准备好后,可以调用 operator() (...) 时为 true。 更多... | |
bool | _is_time_dependent |
成员变量用于缓存函数是否真正依赖于时间。 更多... | |
Private 属性 | |
std::vector< std::unique_ptr < FunctionBase< Output > > > | subfunctions |
std::vector< std::vector < unsigned int > > | index_maps |
对于每个子函数,存储从子函数的索引到全局函数索引的映射的列表。 更多... | |
std::vector< std::pair < unsigned int, unsigned int > > | reverse_index_map |
对于每个全局指数,存储该指数是哪个子函数的本地指数。 每个元素是一个std::pair<unsigned int, unsigned int>,表示子函数的索引和子函数中的本地指数。 更多... | |
将不同函数的结果组合成单个向量的函数。所有重写的虚拟函数在function_base.h中都有文档。
在文件 composite_function.h 第 44 行定义.
|
explicitdefault |
默认构造函数。
|
default |
该类可以使用默认的移动构造和分配。
|
delete |
该类包含unique_ptr成员,因此不能默认复制或分配。
|
virtualdefault |
子函数向量会自动清理。
|
inline |
附加新的子函数,以及从附加的子函数的索引到组合函数的索引的映射。
组合函数将返回一个向量,其索引 index_map
[i] 处的值是附加函数在索引 i 处的值, 即, (*this)(x, t)(index_map[i]) 将返回 f(x, t)(i)。
f | 要附加的子函数。 |
index_map | 从附加子函数的索引到组合函数索引的映射。 |
在文件 composite_function.h 第 79 行定义.
参考 libMesh::FunctionBase< Output >::_is_time_dependent, libMesh::FunctionBase< Output >::clone(), libMesh::CompositeFunction< Output >::index_maps, libMesh::invalid_uint, libMesh::FunctionBase< Output >::is_time_dependent(), libMesh::CompositeFunction< Output >::reverse_index_map , 以及 libMesh::CompositeFunction< Output >::subfunctions.
参考自 libMesh::CompositeFunction< Output >::clone().
|
inlinevirtualinherited |
清除函数。
这个函数可以用来清除函数对象的状态,以备重新使用。
被 libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T > , 以及 libMesh::AnalyticFunction< Output > 重载.
在文件 function_base.h 第 95 行定义.
|
inlineoverridevirtual |
克隆函数。创建并返回一个与当前实例相同类型的新实例。
实现了 libMesh::FunctionBase< Output >.
在文件 composite_function.h 第 187 行定义.
参考 libMesh::CompositeFunction< Output >::attach_subfunction(), libMesh::CompositeFunction< Output >::CompositeFunction(), libMesh::CompositeFunction< Output >::index_maps , 以及 libMesh::CompositeFunction< Output >::subfunctions.
|
inlineoverridevirtual |
重载操作符,用于计算特定分量的值。
i | 要计算的分量的索引。 |
p | 计算点的坐标。 |
time | 时间值。 |
重载 libMesh::FunctionBase< Output > .
在文件 composite_function.h 第 167 行定义.
参考 libMesh::invalid_uint, libMesh::CompositeFunction< Output >::reverse_index_map , 以及 libMesh::CompositeFunction< Output >::subfunctions.
参考自 libMesh::CompositeFunction< Output >::operator()().
|
inlinevirtualinherited |
实际的初始化过程。
这个函数可以用来进行函数对象的初始化工作。
被 libMesh::ParsedFunction< Output, OutputGradient >, libMesh::ParsedFunction< T > , 以及 libMesh::AnalyticFunction< Output > 重载.
在文件 function_base.h 第 89 行定义.
|
inlineinherited |
p
和时间 time
处的向量的分量 i。
子类可以选择重写这个函数以提高效率,因为默认实现基于向量评估,通常是不必要的低效率。
i | 分量的索引。 |
p | 坐标点。 |
time | 时间。 |
i+1
的DenseVector的operator(),如果operator() 在该限制之外进行访问,将导致意外行为。 在文件 function_base.h 第 216 行定义.
|
inlineinherited |
true
,否则返回 false。
这个函数用于查询函数对象是否依赖于时间。有些函数对象的时间依赖性是从外部确定的,因此可以使用这个函数设置。
在文件 function_base.h 第 232 行定义.
参考自 libMesh::CompositeFunction< Output >::attach_subfunction().
|
inline |
获取组件的数量。
在文件 composite_function.h 第 208 行定义.
参考 libMesh::CompositeFunction< Output >::reverse_index_map.
|
inline |
获取子函数的数量。
在文件 composite_function.h 第 199 行定义.
参考 libMesh::CompositeFunction< Output >::subfunctions.
|
inlineinherited |
Evaluation function for time-independent vector-valued functions.
Sets output values in the passed-in output
DenseVector.
在文件 function_base.h 第 252 行定义.
|
inlineoverridevirtual |
重载操作符,用于计算标量值。
p | 计算点的坐标。 |
time | 时间值,默认为0。 |
实现了 libMesh::FunctionBase< Output >.
在文件 composite_function.h 第 128 行定义.
参考 libMesh::CompositeFunction< Output >::component().
|
inlineoverridevirtual |
重载操作符,用于计算矢量值。
p | 计算点的坐标。 |
time | 时间值。 |
output | 计算得到的矢量值。 |
实现了 libMesh::FunctionBase< Output >.
在文件 composite_function.h 第 140 行定义.
参考 libMesh::CompositeFunction< Output >::index_maps, libMesh::DenseVector< T >::resize(), libMesh::CompositeFunction< Output >::reverse_index_map, libMesh::DenseVector< T >::size(), libMesh::CompositeFunction< Output >::subfunctions , 以及 libMesh::DenseVector< T >::zero().
|
default |
|
delete |
|
inlineinherited |
设置函数是否依赖时间的函数。 这仅应该由无法本地确定时间依赖性的子类使用。 在这种情况下,应在构造之后立即使用这个函数。
在文件 function_base.h 第 224 行定义.
|
protectedinherited |
当 init()
被调用以确保一切都准备好后,可以调用 operator()
(...) 时为 true。
这个成员变量用于跟踪函数对象是否已经完成初始化,如果已经准备好进行评估,则为 true。
在文件 function_base.h 第 191 行定义.
参考自 libMesh::AnalyticFunction< Output >::AnalyticFunction(), libMesh::ConstFunction< Output >::ConstFunction(), libMesh::ParsedFunction< Output, OutputGradient >::ParsedFunction() , 以及 libMesh::WrappedFunction< Output >::WrappedFunction().
|
protectedinherited |
成员变量用于缓存函数是否真正依赖于时间。
在文件 function_base.h 第 197 行定义.
参考自 libMesh::CompositeFunction< Output >::attach_subfunction() , 以及 libMesh::ConstFunction< Output >::ConstFunction().
|
protectedinherited |
指向我们的主函数对象的const指针,初始化为 nullptr。
可能存在需要多个函数的情况,但为了节省内存,一个主函数对象可以处理一些集中的数据。
这个成员变量用于指向主函数对象的指针,有时候多个函数对象需要共享一些数据,可以通过主函数对象来管理。
在文件 function_base.h 第 184 行定义.
|
private |
对于每个子函数,存储从子函数的索引到全局函数索引的映射的列表。
index_maps[i] 存储第 i 个子函数的索引映射。
在文件 composite_function.h 第 222 行定义.
参考自 libMesh::CompositeFunction< Output >::attach_subfunction(), libMesh::CompositeFunction< Output >::clone() , 以及 libMesh::CompositeFunction< Output >::operator()().
|
private |
对于每个全局指数,存储该指数是哪个子函数的本地指数。 每个元素是一个std::pair<unsigned int, unsigned int>,表示子函数的索引和子函数中的本地指数。
在文件 composite_function.h 第 229 行定义.
参考自 libMesh::CompositeFunction< Output >::attach_subfunction(), libMesh::CompositeFunction< Output >::component(), libMesh::CompositeFunction< Output >::n_components() , 以及 libMesh::CompositeFunction< Output >::operator()().
|
private |
在文件 composite_function.h 第 215 行定义.
参考自 libMesh::CompositeFunction< Output >::attach_subfunction(), libMesh::CompositeFunction< Output >::clone(), libMesh::CompositeFunction< Output >::component(), libMesh::CompositeFunction< Output >::n_subfunctions() , 以及 libMesh::CompositeFunction< Output >::operator()().