Refine is a 3D mixed-element grid adaptation framework implemented in the C language.
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.
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.meshb
is the grid in libMeshb formatproject-mach.solb
is a scalar field (Mach number) in libMeshb format2
is the norm order1.5
is the gradation limit3.e4
is the complexity (C), where the new mesh will have approximately 2C vertices and 12C tetrahedraproject-metric.solb
is the output metric in libMeshb format- use (sequential only) k-exact Hessian reconstruction with
--kexact
, otherwise default to L2-projection Hessian reconstruction max_edge_length
is an optional limit on maximum edge length with an attempt to hold complexity
See LoicMarechal/libMeshb for details on the libMeshb format.
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.meshb
is the grid in libMeshb formatproject-metric.solb
is 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.
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,
tanh3
can besinfun3
,sinatan3
, ortanh3
project.meshb
is the grid in libMeshb formatproject-scalar.solb
is a scalar field in libMeshb format
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.meshb
is the truth grid in libMeshb formattruth-scalar.solb
is truth scalar field in libMeshb formatcandidate.meshb
is the candidate grid in libMeshb formatcandidate-scalar.solb
is candidate scalar field in libMeshb format2
is 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.
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.meshb
is the donor mesh in binary AFLR (.lb8.ugrid,.b8.ugrid) or libMeshb (.meshb) formatdonor-field.solb
is the donor field(s) in libMeshb formatreceptor-mesh.ext
is the receptor mesh in binary AFLR (.lb8.ugrid,.b8.ugrid) or libMeshb (.meshb) formatreceptor-field.solb
is the receptor field(s) in libMeshb format
The output is receptor-field.solb
.
./build/src/ref_driver -i project.meshb -m project-metric.solb [-g project.egads] -x output.meshb
Where,
-i project.meshb
is the grid in libMeshb format-m project-metric.solb
is the metric in libMeshb format-g project.egads
is optional geometry (when compiled with EGADS)-x output.meshb
is the output grid name