1. Getting started
The meshes and fields needed to make all this examples are located in the examples folder at the FEconv root directory.
In order to get a full description of the use of each FEconv option you can visit the Reference Guide.
2. Mesh conversion
This samples shows how to convert several mesh formats supported by FEconv.
This formats are identified by the file extension, due to the overlap among some extensions this samples introduce the option -ff and the option -gm, for reading FreeFem++ and Gmsh mesh files respectively.
The option -r and the option -t must be used when reading single precission PF3 mesh files.
UNV (Universal file) mesh to VTU (Visualization Toolkit) mesh:feconv examples/mesh.unv output.vtu |
bdf (Nastran) mesh to PF3 (Cedrat Flux) mesh:feconv examples/mesh.bdf output.pf3 |
MPHTXT (Comsol) mesh to MFM (Modulef Formatted Mesh) mesh:feconv examples/mesh.mphtxt output.mfm |
MSH (Ansys) mesh to UNV (Universal file) mesh:feconv examples/ansys_mesh.msh output.unv |
PF3 (Cedrat) mesh to MSH (Ansys) mesh:feconv -r soft -t 1.e-7 examples/mesh.pf3 output.msh |
MFM (Modulef Formatted File) mesh to MSH (FreeFem++) mesh:feconv -ff examples/mesh.mfm output.msh |
MSH (FreeFem++) mesh to MPHTXT (Comsol) mesh:feconv -ff examples/freefem_mesh.msh output.mphtxt |
MSH (Gmsh) mesh to MUM (Modulef Unformatted Mesh) mesh:feconv -gm examples/gmsh_mesh.msh output.mum |
MESH (FreeFeem++) mesh to MUM (Modulef Unformatted File) mesh:feconv -ff examples/mesh.mesh output.mum |
3. Load external fields
External field files can be loaded by using option -if, this examples shows how to use this option.
This examples also use the option -r and the option -t for reading single precission PF3 mesh files.
Load MFF field:feconv -if examples/field/nodefield1.mff examples/mesh.mfm output.unv |
Load MUF field:feconv -if examples/field/cellfield1.muf examples/mesh.mum output.unv |
Load IP field:feconv -if examples/field/cellfield1.ip examples/ansys_mesh.msh output.vtu |
Load DEX field:feconv -r soft -t 1.e-7 -if examples/field/nodefield1.dex examples/mesh.pf3 output.vtu |
4. Save external fields
The option -of allows to save external field files, you can see its behaviour in the following examples.
With the option -in user can select a single field or several fields to be readed from the source file.
Save MFM fieldfeconv -in nodefield1 -of examples/field/nodefield1.mff examples/mesh.vtu output.mff |
Save MUF fieldfeconv -in nodefield2 -of examples/field/nodefield2.muf examples/mesh.vtu output.muf |
Save IP fieldfeconv -in cellfield1 -of examples/field/cellfield1.ip examples/mesh.vtu output.msh |
Save DEX fieldfeconv -in nodefield1 -of examples/field/nodefield1.dex examples/mesh.vtu output.pf3 |
5. Change field names
By combining the option -in, for selecting input fields, with option -on user can change the field names in the destinations file.
A single fieldfeconv -in nodefield1 -on Temp examples/mesh.vtu output.unv |
Several fieldsfeconv -in [nodefield1,cellfield1] -on [Temp,Press] examples/mesh.vtu output.unv |
6. Mesh transform
There are several options for mesh transformation.
- With Option -l1 output mesh will contain Lagrange P1 finite elements.
- With Option -l2 output mesh will contain Lagrange P2 finite elements.
- With Option -nd output mesh will contain Whitney (edge) finite elements.
- With Option -rt output mesh will contain Raviart-Thomas finite elements.
Transform to Lagrange P1:feconv -l1 examples/mesh.vtu output.unv |
Transform to Lagrange P2:feconv -l2 examples/mesh.vtu output.vtu |
Transform to Whitney (edge):feconv -nd examples/mesh.vtu output.mfm |
Transform to Raviart-Thomas:feconv -rt examples/mesh.vtu output.mfm |