PostMesh:用于高阶有限元分析的曲线网格生成器

  • x1_801467
    了解作者
  • 2.1MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-21 19:56
    上传日期
网格后 PostMesh是基于固体力学的后验高阶曲线网格生成器,该生成器基于带有C ++,Cython和Python API的OpenCascade。 其主要目标是充当CAD模型与高阶有限元方案之间的桥梁。 因此,它可以用作具有各种经过编译和解释的代码库的插件。 哲学 PostMesh是一种后验曲线网格生成器,因为它需要事先使用线性网格。 然后将更高阶的节点放置在线性网格上,并使用CAD库计算这些节点到精确边界的投影,然后将其作为Dirichlet边界条件馈入线性,线性化或非线性固体力学问题。 建造要求 PostMesh依赖于以下第三方库: 构建过程 C ++ 11兼容编译器-右值引用,可变参数模板,lambdas等 -CAD处理 -矩阵运算和SIMD矢量化 -Cython绑定 -Python界面 在基于unix的系统上安装这些依赖关系很简单。 要在基于Debian的系统上构建O
PostMesh-master.zip
  • PostMesh-master
  • src
  • PostMeshCurve.cpp
    33.5KB
  • PostMeshBase.cpp
    21.7KB
  • PostMeshSurface.cpp
    64.1KB
  • examples
  • sphere
  • sphere_edges.dat
    14.6KB
  • sphere_faces.dat
    29.3KB
  • sphere.py
    3.4KB
  • sphere_points.dat
    44.2KB
  • Makefile
    746B
  • sphere.cpp
    4.3KB
  • sphere.igs
    4.5KB
  • sphere_elements.dat
    68.4KB
  • nodal_spacing_p4.dat
    378B
  • leaf
  • leaf.py
    5.5KB
  • leaf.iges
    1.7KB
  • leaf_elements.dat
    19.8KB
  • Makefile
    741B
  • leaf_points.dat
    15KB
  • leaf_edges.dat
    2.2KB
  • leaf.cpp
    4.2KB
  • Makefile
    109B
  • docs
  • mech2d.png
    244.8KB
  • wing2d.png
    265.2KB
  • inner_surface.png
    273.1KB
  • torus.png
    156.5KB
  • f6BL_58.png
    482.9KB
  • Car_23s.png
    244.2KB
  • F6Iso_2.png
    244.9KB
  • almond.png
    155.2KB
  • bindings
  • PostMeshPy.pxd
    4.8KB
  • PostMeshPy.pyx
    29.4KB
  • include
  • PostMeshBase.hpp
    6.8KB
  • CNPFuncs.hpp
    12.5KB
  • PyInterface.hpp
    308B
  • AuxFuncs.hpp
    9.9KB
  • EIGEN_INC.hpp
    2.6KB
  • PostMeshSurface.hpp
    3.2KB
  • OCC_INC.hpp
    2.5KB
  • PyInterfaceEmulator.hpp
    1.6KB
  • PostMeshCurve.hpp
    2.4KB
  • STL_INC.hpp
    1.1KB
  • MANIFEST.in
    83B
  • LICENSE.md
    1.1KB
  • setup.py
    5.4KB
  • README.md
    7KB
  • Makefile
    1.1KB
  • .gitignore
    183B
内容介绍
# PostMesh <!--![almond](doc/almond.png)--> <!--![mech](doc/mech2d.png)--> <div> </div> **PostMesh** is a solid mechanics based a posteriori high order curvilinear mesh generator based on OpenCascade with C++, Cython and Python APIs. Its main goal is to serve as a bridge between CAD models and high order finite element schemes. Hence, it can be used as a plugin with various compiled and interpreted code-bases. ## Philosophy PostMesh is an a posteriori curvilinear mesh generator, in that it requires a linear mesh in advance. Higher order nodes are then placed on the linear mesh and the projection of these nodes to the exact boundary is computed with the CAD library and subsequently fed as the Dirichlet boundary condition to either a linear, a linearised or a non-linear solid mechanics problem. ## Build Requirements PostMesh depends on the following third party libraries: - **[GNU make]** - build process - **C++11 compatible compiler** - Rvalue references, variadic templates, lambdas etc - **[OpenCascade]** - CAD processing - **[Eigen]** - Matrix operations and SIMD vectorisation - **[Cython]** - Cython bindings - **[NumPy]** - Python interface [GNU make]: http://www.gnu.org/software/make [OpenCascade]: http://www.opencascade.com [Eigen]: http://eigen.tuxfamily.org [Cython]: http://www.cython.org [NumPy]: http://www.numpy.org Installing these dependencies on unix based systems is straight-forward. For building OpenCascade on Debian based systems, do `apt-get install liboce-*`and on macOS `brew install oce`. Note that, the default location for `Eigen` and `OpenCascade` headers and libraries (under Linux and macOS) are `/usr/local/include/eigen/`, `/usr/local/include/oce/` and `/usr/local/lib`, respectively. ## Installation Both C++ and Python bindings are distributed through this repository. The Python module is available through PyPi pip install PostMeshPy To build PostMesh shared library for C++ API, you typically do git clone https://github.com/romeric/PostMesh cd PostMesh make [sudo] make install To further build the C++ examples, (after building and installing PostMesh shared library) do cd examples make To build Cython/Python bindings manually (make sure you are in PostMesh directory) [sudo] python setup.py install Or using pip python setup.py build_ext python setup.py bdist_wheel cd ../ && pip install PostMesh/dist/*.whl ### Usage PostMesh provides a very intuitive objected oriented API. The interfaces are designed such that C++ and Python codes look and feel the same. Have a look at the examples directory for getting started with PostMesh. For conveninece, here are two complete examples. #### A complete C++ example: [3D] surface projections for high order tetrahedral elements ````c++ // MAKE AN INSTANCE OF PostMeshSurface auto curvilinear_mesh = PostMeshSurface(); // PASS MESH DATA TO PostMesh - PostMesh TAKES RAW POINTERS AS INPUT ARGUMENTS curvilinear_mesh.SetMeshElements(elements, elements_rows, elements_cols); curvilinear_mesh.SetMeshPoints(points,points_rows, points_cols); curvilinear_mesh.SetMeshEdges(edges, edges_rows, edges_cols); curvilinear_mesh.SetMeshFaces(faces, faces_rows, faces_cols); curvilinear_mesh.SetScale(scale); curvilinear_mesh.SetCondition(condition); curvilinear_mesh.SetProjectionPrecision(precision); curvilinear_mesh.ComputeProjectionCriteria(); curvilinear_mesh.ScaleMesh(); curvilinear_mesh.InferInterpolationPolynomialDegree(); curvilinear_mesh.SetNodalSpacing(nodal_spacing, nodal_spacing_rows, nodal_spacing_cols); // READ THE GEOMETRY FROM THE IGES FILE curvilinear_mesh.ReadIGES(iges_filename); // EXTRACT GEOMETRY INFORMATION FROM THE IGES FILE curvilinear_mesh.GetGeomVertices(); // EXTRACT TRUE BOUNDARY FACES FROM CAD FILE curvilinear_mesh.GetGeomFaces(); curvilinear_mesh.GetGeomPointsOnCorrespondingFaces(); // FIRST IDENTIFY WHICH SURFACES CONTAIN WHICH FACES curvilinear_mesh.IdentifySurfacesContainingFaces(); // PROJECT ALL BOUNDARY POINTS FROM THE MESH TO THE SURFACE curvilinear_mesh.ProjectMeshOnSurface(); // PERFORM POINT INVERSION FOR THE INTERIOR POINTS (ORTHOGONAL POINT PROJECTION) // THE INPUT ARGUMENTS SPECIFY PROJECTION ON CURVE INTERSECTIONS // AND MODIFICATION OF THE LINEAR MESH IF NECESSARY curvilinear_mesh.MeshPointInversionSurface(1,1); // OBTAIN MODIFIED MESH POINTS - THIS IS NECESSARY TO ENSURE LINEAR MESH IS ALSO CORRECT curvilinear_mesh.ReturnModifiedMeshPoints(points); // OBTAIN DIRICHLET DATA - (THE DISPLACMENT OF BOUNDARY NODES) DirichletData Dirichlet_data = curvilinear_mesh.GetDirichletData(); ```` #### A complete Python example: [2D] curve projections for high order triangular elements Although all C++ methods are also available in Python, there are some convenience functions defined at Python level that can help shorten the script ````python # MAKE AN INSTANCE OF PostMeshCurve curvilinear_mesh = PostMeshCurve("tri",2) curvilinear_mesh.SetScale(scale) curvilinear_mesh.SetCondition(condition) # SET MESH curvilinear_mesh.SetMesh(elements=elements, points=points, edges=edges, faces=np.zeros((1,4),dtype=np.uint64),spacing=nodal_spacing,scale_mesh=True) curvilinear_mesh.SetProjectionPrecision(1.0e-04) curvilinear_mesh.ComputeProjectionCriteria() curvilinear_mesh.GetBoundaryPointsOrder() # SET CAD GEOMETRY curvilinear_mesh.SetGeometry(cad_filename) # PERFORM POINT PROJECTION AND POINT INVERSION curvilinear_mesh.PerformPointProjectionInversionCurve(projection_type="arc_length") # OBTAIN MODIFIED MESH POINTS - THIS IS NECESSARY TO ENSURE LINEAR MESH IS ALSO CORRECT curvilinear_mesh.ReturnModifiedMeshPoints(points) # OBTAIN DIRICHLET DATA - (THE DISPLACMENT OF BOUNDARY NODES) Dirichlet_nodes, Dirichlet_values = curvilinear_mesh.GetDirichletData() ```` ## Reference/Citation PostMesh can be cited as ````latex @Article{Poya2016, author="Poya, Roman and Sevilla, Ruben and Gil, Antonio J.", title="A unified approach for a posteriori high-order curved mesh generation using solid mechanics", journal="Computational Mechanics", year="2016", volume="58", number="3", pages="457--490", doi={10.1007/s00466-016-1302-2}, url={https://link.springer.com/article/10.1007/s00466-016-1302-2} } ```` ## Disclaimer PostMesh does not directly produce curved volume meshes, but only curved surface meshes. As mentioned before, the former step can be achieved by relying on a solid mechanics solver.
评论
    相关推荐