OpenFOAM 中的有限体积离散

介绍 这篇文章中你将会学到: 基于任意多面体网格的有限体积离散方法 时间项的处理方式 对流项的处理方式 源项的处理方式 边界条件的处理方式 OpenFOAM 中对有限体积

OpenFOAM 中的 autoPtr

autoPtr 类和 tmp 类一样,也是智能指针。头文件里面对 autoPtr 类的描述为: An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and with pointer allocation checking on access. 可见 autoPtr 和 std::auto_ptr 功能类似,是不支持引用计数

C++11 中的智能指针

C++11 中正式引入了智能指针 unique_ptr、shared_ptr 和 weak_ptr,并推荐使用 unique_ptr 代替 C++03 中过时的 auto_ptr 。本文重点介绍前两种智能指针

OpenFOAM 中的 tmp 类

tmp 类是 OpenFOAM 中用来封装对象的一个类,这里将介绍 tmp 的机制及用法。 基础知识 在介绍 tmp 类之前我们有必要了解一些 C++ 的机制。在 C++ 中,当一个函数的返回值为对象