Skip to content

Latest commit

 

History

History
135 lines (102 loc) · 5.59 KB

fem_to_mesh.md

File metadata and controls

135 lines (102 loc) · 5.59 KB

FEM_TO_MESH
Convert finite element mesh data from FEM to MESH format {#fem_to_mesh-convert-finite-element-mesh-data-from-fem-to-mesh-format align="center"}


FEM_TO_MESH is a C++ program which reads a set of FEM files defining the node coordinates, boundary nodes, and elements of a finite element mesh, and rewrites the data as a MESH file.

The program can convert 2D meshes of triangles, or 3D meshes of tetrahedrons.

Usage: {#usage align="center"}

fem_to_mesh prefix

where prefix is the file name prefix, so that:

  • prefix**_nodes.txt** is a file containing node coordinates;
  • prefix**_boundary_node_mask.txt** is a file listing a "0" for each interior node and a "1" for each boundary node; (This file can be created by the triangulation_boundary_nodes or tet_mesh_boundary programs.)
  • prefix**_elements.txt** is a file listing the nodes forming each element;
  • prefix**.mesh** is the name of the MESH file to be created.

Licensing: {#licensing align="center"}

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Languages: {#languages align="center"}

FEM_TO_MESH is available in a C++ version and a FORTRAN90 version and a MATLAB version.

Related Data and Programs: {#related-data-and-programs align="center"}

FEM_TO_TEC, a FORTRAN90 program which converts FEM models into TECPLOT ASCII files.

FEM2D, a data directory which contains examples of 2D FEM files, text files that describe a 2D finite element geometry and associated nodal values;

FEM3D, a data directory which contains examples of 3D FEM files, three text files that describe a 3D finite element geometry and associated nodal values.

ICE_TO_MESH, a C++ program which reads a NETCDF file containing an ICE dataset and rewrites the information as a MESH file.

MESH, a data directory which contains examples of MESH files, which can be used to define the geometry of a finite element mesh in 2D or 3D, using triangles, quadrilaterals, tetrahedrons or hexahedrons.

TET_MESH_BOUNDARY, a C++ program which returns the nodes and faces of the boundary of a tetrahedral mesh, which themselves form a 3D triangular mesh or "TRI_SURFACE".

TRIANGULATION_BOUNDARY_NODES, a C++ program which reads data defining a triangulation, determines which nodes lie on the boundary, and writes their coordinates to a file.

Reference: {#reference align="center"}

  1. Pascal Frey,
    MEDIT: An interactive mesh visualization software,
    Technical Report RT-0253,
    Institut National de Recherche en Informatique et en Automatique,
    03 December 2001.

Source Code: {#source-code align="center"}

Examples and Tests: {#examples-and-tests align="center"}

ELL is a 2D L-shaped region, with a grid of 65 nodes and 96 elements of order 3 triangles.

P01 is 3D FEM data for a rectangular channel of dimensions 3x1x1 physical units, using 584 nodes and 2568 tetrahedral elements.

List of Routines: {#list-of-routines align="center"}

  • MAIN is the main program for FEM_TO_MESH.
  • CH_CAP capitalizes a single character.
  • CH_EQI is true if two characters are equal, disregarding case.
  • CH_TO_DIGIT returns the integer value of a base 10 digit.
  • FILE_COLUMN_COUNT counts the columns in the first line of a file.
  • FILE_ROW_COUNT counts the number of row records in a file.
  • I4MAT_DATA_READ reads data from an I4MAT file.
  • I4MAT_HEADER_READ reads the header from an I4MAT file.
  • MESH_WRITE writes mesh data to a MESH file.
  • R8MAT_DATA_READ reads the data from an R8MAT file.
  • R8MAT_HEADER_READ reads the header from an R8MAT file.
  • S_LEN_TRIM returns the length of a string to the last nonblank.
  • S_TO_I4 reads an I4 from a string.
  • S_TO_I4VEC reads an I4VEC from a string.
  • S_TO_R8 reads an R8 from a string.
  • S_TO_R8VEC reads an R8VEC from a string.
  • S_WORD_COUNT counts the number of "words" in a string.
  • TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the C++ source codes.


Last revised on 09 December 2010.