Description
Refine is a 3D mixed-element grid adaptation framework implemented in the C language.
Quick Start
If you checked out the repository with git, [requires automake >= 1.7 and autoconf >= 2.53]
./bootstrap
mkdir -p build
cd build
../configure --prefix=`pwd`
make
make install
See the INSTALL file for further build instructions. Here are some examples: with MPI and Zoltan,
../configure --with-zoltan=/zoltan/path CC=mpicc FC=mpif90 CFLAGS='-DHAVE_MPI'
with EGADS and OpenCASCADE,
../configure --with-EGADS=/egads/path --with-OpenCASCADE=/opencascade/path
with EGADSlite,
../configure --with-EGADS=/egads/path --enable-lite
These can be combined, e.g., MPI+Zoltan+EGADSlite.
Multiscale Metric for Control of Interpolation Error in Lp-norm
In conjunction with the Unstructured Grid Adaptation Working Group, an implementation of the multiscale metric is provided.
./build/src/ref_metric_test --lp project.meshb project-mach.solb 2 1.5 3.0e4 project-metric.solb [--kexact] [--hmax max_edge_length]
Where,
project.meshbis the grid in libMeshb formatproject-mach.solbis a scalar field (Mach number) in libMeshb format2is the norm order1.5is the gradation limit3.e4is the complexity (C), where the new mesh will have approximately 2C vertices and 12C tetrahedraproject-metric.solbis the output metric in libMeshb format- use (sequential only) k-exact Hessian reconstruction with
--kexact, otherwise default to L2-projection Hessian reconstruction max_edge_lengthis an optional limit on maximum edge length with an attempt to hold complexity
See LoicMarechal/libMeshb for details on the libMeshb format.
Metric Conformity Evaluation
In conjunction with the Unstructured Grid Adaptation Working Group, an implementation of descriptive statistics for edge lengths and mean ratio is provided.
./build/src/ref_histogram_test project.meshb project-metric.solb
Where,
project.meshbis the grid in libMeshb formatproject-metric.solbis the metric in libMeshb format
See LoicMarechal/libMeshb
for details on the libMeshb format.
Histograms are written as ref_histogram_quality.tec and
ref_histogram_ratio.tec, where each of the two the columns are
mean ratio/edge length and normalized count.
Scalar Field for Interpolation Error Verification
To create an initial unit cube domain
./build/src/ref_acceptance 1 initial.meshb
To compute the scalar on a domain,
./build/src/ref_acceptance -u tanh3 project.meshb project-scalar.solb
Where,
tanh3can besinfun3,sinatan3, ortanh3project.meshbis the grid in libMeshb formatproject-scalar.solbis a scalar field in libMeshb format
Interpolation Error Evaluation
The norm of interpolation error of a scalar function on a "candidate" grid can be computed based on a scalar function on "truth" grid. The candidate solution is interpolated to the truth grid, assuming the solution is linear in each element, and a norm of the difference of the interpolated candidate solution and the truth solution is integrated on the truth grid.
./build/src/ref_interp_test --error truth.meshb truth-scalar.solb candidate.meshb candidate-scalar.solb 2
Where,
truth.meshbis the truth grid in libMeshb formattruth-scalar.solbis truth scalar field in libMeshb formatcandidate.meshbis the candidate grid in libMeshb formatcandidate-scalar.solbis candidate scalar field in libMeshb format2is the power of the norm
The output is two numbers: the characteristic edge length (number of vertices raised to the -1/3 power) and the interpolation error norm.
Field Interpolation
The fields in a .solb file paired with a donor mesh can be interpolated to a receptor mesh. This utility can be executed in serial or parallel.
./build/src/ref_interp_test --field donor-mesh.ext donor-field.solb receptor-mesh.ext receptor-field.solb
Where,
donor-mesh.meshbis the donor mesh in binary AFLR (.lb8.ugrid,.b8.ugrid) or libMeshb (.meshb) formatdonor-field.solbis the donor field(s) in libMeshb formatreceptor-mesh.extis the receptor mesh in binary AFLR (.lb8.ugrid,.b8.ugrid) or libMeshb (.meshb) formatreceptor-field.solbis the receptor field(s) in libMeshb format
The output is receptor-field.solb.
Grid Adaptation
./build/src/ref_driver -i project.meshb -m project-metric.solb [-g project.egads] -x output.meshb
Where,
-i project.meshbis the grid in libMeshb format-m project-metric.solbis the metric in libMeshb format-g project.egadsis optional geometry (when compiled with EGADS)-x output.meshbis the output grid name