Commit 5710404a authored by Douglas Serson's avatar Douglas Serson
Browse files

Merge branch 'master' into feature/FieldConvertHomogeneousPlane

Conflicts:
	utilities/FieldConvert/CMakeLists.txt
parents d56fff89 60f42ec0
Changelog
=========
v4.3.0
------
**Library:**
- Changed default XML format to compress mesh data (!533)
- Various fixes for 3D homogeneous post-processing (!531, !529, !528, !526, !521)
- Fix range with variable p option (!522)
- Fix bug with hexahedra of heterogeneous order (!520) and reading files (!522)
- Fix history point output formatting (!518)
- Fix for OS X 10.11 (!512)
- Fix `HexGeom::v_GetDir` to support heterogeneous basis functions (!520)
- Fix initialisation bug in ExpList2DH1D and ExpListHomogeneous2D (!528, !529)
- Fix bug in ExpList1D which may lead to invalid .vtu files (!531)
- Make `GetBoundaryToElmtMap` consistent for 3DH1D (!526)
**APESolver:**
- Fix restarting from checkpoint file (!517)
**FieldConvert:**
- Extended surface distance module to support hexahedra and quads (!524)
- Small fixes in interpolation routine (!515)
- Add support for surface extraction in 3DH1D case (!521)
- Add support for isocontour extraction for 3DH1D (!525)
- Add module to enable mean mode of 3DH1D to be extracted (!530)
- Fix bug in C^0 projection (!541))
- Add command line option to set number of homogeneous planes (!540)
**MeshConvert:**
- Enable face curvature inside core MeshConvert objects (!511)
- Add linearise processing module to remove all curvature from high order
elements (!509)
v4.2.0
------
**Library:**
- Add Runge-Kutta SSP schemes for 2nd/3rd order using keys `RungeKutta2_SSP` and
`RungeKutta3_SSP`. `ClassicalRungeKutta4` is now called `RungeKutta4`. (!481)
- Add rudimentary support for 3D CAD models using OpenCascade - work in progress
(!486)
- Allow filters to evaluate expressions in their parameter definitions (!489)
- Fix block preconditioner to work with periodic boundary conditions (!420)
- Dump a backtrace when crash occurs and Nektar++ is compiled in FullDebug mode
(!495)
- Stop the execution of a time-dependent solver if NaN is detected in the
solution field (!496)
- Fixes to improve robustness of interpolation routines (!499)
- Allow solvers to use multi-level static condensation with Xxt, most useful
when running a 3DH1D simulation (!502)
**IncNavierStokesSolver:**
- A range of fixes for the coupled stability solver, which now works in parallel
(!508)
**MeshConvert:**
- Add module to extract prismatic boundary layer elements from mixed prism-tet
mesh (!493).
**FieldConvert:**
- Add a processing module to calculate height of an element connected to a
surface, allowing for calculation of y plus values (!488)
- Fixes for equispaced output (!510)
v4.1.0
------
**Library:**
- Add support for interpolating point data from .pts files (!433)
- Fixes for curvilinear element normals (!443)
- Fix consistency issues between FFT and MVM approaches for homogeneous
expansions (!444)
- Fix a bug in Tecplot output (!445)
- Fix a bug with PETSc and MPI_Finalize (!456)
- Fix bugs with mesh partitioning (!449, !480)
- Fix a bug with non-symmetric SVV parameters for curvilinear elements (!451)
- Fix detection of Intel MKL 2013/2015 (453)
- Fix linearised stability solver in parallel (!454)
- Add a filter for 1D energy spectra (!457)
- Add an incomplete developer guide containing most information from the wiki
(!459)
- Change user defined boundary conditions to remove dependency on enumerator
inside SpatialDomains (!460)
- Add a new collections library for optimised evaluation of operators (!461)
- Change minimum version of boost to 1.52.
- Add initial multithreading support (!463)
- Fix third-party boost compilation on OS X (!467)
- Disable some regression tests on 32-bit systems (!468)
- Fix memory issues inside collections (!473)
- Fix collections autotuning (!476)
- Fix VtkToPng utility (!477)
- Add PulseWaveSolver to packaging (!478)
- Fix bug in iterative static condensation solver (!483)
- Fix zlib install path on OS X (!484)
- Fix documentation HTML styling for user and developer guide (!485)
- Add fixes to support native Nektar++ extension in VisIt visulisation software
(!490)
- Fix warnings on OS X (!491)
**CardiacEPSolver:**
- Fixes for stimuli (!442, !446), conductivity (!441), cell restarts (!458)
- Add a new filter for outputting cell states at specific points over time (!465)
**Linear elastic solver (new):**
- Add solver for linear elasticity equations (!400)
**IncNavierStokesSolver:**
- Add support for moving bodies (!344, !448)
- Fixes for modal energy filter (!427)
- Fix import of mesh file in the Adaptive SFD driver (!440) and other general
fixes (!452)
- Documentation for high order pressure and outflow boundary conditions (!447)
- Update examples to use correct forcing terms (!470)
- Fixes for half-mode stability (!471)
- Fix static initialisation problem in extrapolation classes (!492)
**CompressibleFlowSolver:**
- Add support for sponge region (!396)
- Add support for adiabiatic walls (!430)
- Add utility to generate boundary layer from similarity solution (!438)
**ShallowWaterSolver:**
- Added a DG solver for the Boussinesq equations of Peregrine (!431)
**APESolver:**
- Add support for variable speed of sound (!438)
**MeshConvert:**
- Fix Star file input for highly stretched elements (!455)
- Add Star input from binary format (!474)
- Tidy up files to align with FieldConvert (!479)
**FieldConvert:**
- Major re-organisation of modules, most post-processing utilities now available
within FieldConvert (!475)
v4.0.1
------
**Library:**
- Change hybrid parallelisation to use command line options (!368)
- Add support for multi-variable functions in expression evaluator: new
functions include rad and ang for polar coordinates (!375)
- Add more documentation (!376, !383)
- Various OS X (!377, !378, !382, !425), compiler warning (!432), documentation
(!434) Windows 7 (!391, !407), CMake (!392, !415), packaging (!435, !436) and
Intel compiler (!414, !416) fixes
- Refactor of CG and DG assembly maps (!380)
- Fixes for PETSc running in serial (!381, !420)
- Fixes for running Arnoldi solver in parallel (!384)
- Enable MPI tests on Cray machines such as ARCHER (!386)
- Fix issues with extracting face physical values (!393)
- Fix threshold filter (!395)
- HDG can now use block preconditioner (!397)
- Fix issue with singular vertices in parallel (!398)
- Timing executables now use `Timer` class from LibUtilities (!402)
- Fix manifold history points again (!410)
- Fix time output inside energy filter (!412)
- Fix GetExpIndex function (!417)
- Fixes to external project compilation (!419)
- Fixes from CPC paper review (!422)
- Fixes for scotch partitioner tests (!423)
- Fixes for ACML BLAS libraries (!424)
- Allow prepartitioned meshes to be used (!426)
- Enable variable names to be remapped inside files to different names in XML
functions (!428)
**APESolver:**
- Fixes for tests (!404)
- Add support for advection classes (!408)
**CardiacEPSolver:**
- Add benchmark (!411)
- Fix cardiac exmplaes (!418)
**CompressibleFlowSolver:**
- Add filter for kinetic energy/enstrophy calculation (!388)
**FieldConvert:**
- Support equi-spaced output for simplex elements to reduce storage (!421)
**IncNavierStokesSolver:**
- Unify advection classes with those in `SolverUtils` (!403, !408)
**MeshConvert:**
- Boundary layer refinement now supports hexahedra (!390)
- Improve support for Gmsh high order elements (!401)
- Many fixes for face-interior curvature (!401)
- Add rudimentary test suite (!401)
- New module for imposing curvature based on a scalar function (!401)
v4.0.0
------
**Library:**
- Update boost to 1.55 (!289)
- Fix parallel history points on manifold (!298)
- Add support for scotch partitioner (!311)
- Fixes for thirdparty builds (!319, !330, !353)
- Fix CMake >= 3.0.0 warnings (!320)
- Add support for PETSc library and tidy up global system classes (!322)
- Fixes for 1D Helmholtz solver (!326)
- Fixes for history points (!327) and solver output (!331)
- Fix issue with mesh IDs that do not start from zero (!354)
**CardiacEPSolver:**
- Simplify support for global conductiity (!295)
**FieldConvert:**
- Fixes for parallel operation and interpolation of points (!351)
**IncNavierStokesSolver:**
- Fixes for sponge layer (!272)
- Fix setting of initial conditions (!298)
v3.4.0
------
**Library:**
- New parallel output format. Parallel files are now stored in directories which
contain partition information. (!100, !102, !236, !242, !249, !256).
- gzip-compressed XML mesh files are now supported with extension .xml.gz (!116,
!140, !186).
- HDG solvers now run in parallel and have post-processing utilities (!188,
!230).
- Partitioning can be done only on root process if shared filesystem is
present with use of `--shared-filesystem` command line option (!220, !250).
- A variety of preconditioners are now supported, including linear space and
low-energy preconditioning (!148).
- Many changes to geometric factors storage and interpolation (!99, !197).
- Improvements to identification of invalid elements (!208, !227).
- Removed elemental storage to reduce memory consumption by 30-50% for large
problems (!240).
- Various performance and design improvements for discontinuous formulation (!134).
- Periodic boundary conditions are supported in 3D for both continuous and
discontinuous formulations (!139, !150, !152, !155, !196).
- Utilities added to mesh converter to help identify pairs of periodic faces
(!214).
- Preconditioner support for periodic boundary conditions (!231, !239).
- New radiation boundary condition type (!74).
- Some solvers (compressible flow solver, advection-diffusion-reaction solver)
now support dealiasing options (!78, !146, !167).
- BLAS and vectorisation performance improvements for static-condensed iterative
solver (!86, !109).
- New driver to improve steady state convergence and add parallel support (!91,
!235).
- Updated to METIS v5.1.0 (!97, !142, !189).
- Iterative solvers now use previous timestep (when available) to improve
convergence speed (!106).
- Added CPU timing for timestep loop (!156).
- Added provenance information (date, time, code version, git revision, etc) to
field file output (!179).
- Disabled long-running regression tests by default (!183).
- Support for command line arguments without parameters (!187).
- Added support for reading boundary conditions from files, and appropriate
utilities in MeshConvert to extract surfaces (!226).
- Updated XXt and Gs libraries to latest version (!232).
- Fix singularity check for Poisson equations (!74, !154).
- Fixes for 2D Gauss points (!73, !149, !157).
- Fixes to parallel I/O (!77, !218, !264).
- Fixes for parallel implementation (!93, !107, !121, !169, !217, !245, !246).
- Fixes for normal calculation (!94, !135).
- Improved compilation techniques, particularly when compiler includes MPI
automatically (!80, !82, !84, !85, !113, !114, !131, !141, !166, !210, !241).
- Updated zlib to v1.2.7 (!115).
- Fix for boost 1.5.3 compilation (!120).
- Most compiler warnings silenced with clang/gcc (!81, !92, !103, !123, !201,
!243).
- Attempts to improve mesh partitioning/load balancing (!160, !170, !175).
- Fixes for Newton iteration to interpolate inside deformed elements (!216,
!251).
- Fixed curved tetrahedron and hexahedron issue (!219, !248).
- Fixed reading of field files for tetrahedron (!228).
- Fixed uninitialised variable inside SessionrReader (!233).
- Various improvements to support use of Nektar++ externally (!111, !260, !261).
- Fixed base flow reading (!112).
**CardiacEPSolver:**
- Cardiac electrophysiology solver improvements (!87, !95, !96, !108, !119,
!165, !173, !174, !199, !222).
**CompressibleFlowSolver:**
- Compressible Navier-Stokes equations are now available for both DG and FR
discretisations (!110, !125, !128).
- Meshes with spatially varying p in both 2D and 3D are now supported (!158).
- Homogeneous Fourier extension is now supported (!180).
- Various fixes (!90, !98, !147, !172).
**DiffusionSolver (new):**
- Added small solver to demonstrate usage of higher library levels outside of
EquationSystem (!225).
**IncNavierStokesSolver:**
- Major refactoring of time-integration classes (!181, !184).
- Summary information now generated via callbacks (!182).
- Implemented new generic forcing function classes (!194).
- Current time now written out in field files (!198).
- Major refactoring of incompressible Navier-Stokes solver to improve
readability and performance (212, !213).
- Spectral vanishing viscosity for stabilisation (!101, !104, !211, !263).
- Added filter to compute aerodynamic forces on surfaces (!168, !203, !204).
- Added filter to compute kinetic energy and enstrophy (!207, !257).
**ShallowWaterSolver:**
- Various improvements/modernisations to shallow water solver (!190).
**Utilities:**
- VTK to PNG converter (!122)
- Added scalar gradient utility (!129, !252).
- Added utility to calculate Q-criterion field (!153).
- Added support to XmlToVtk to write Jacobian field (!223).
- Added utility to calculate wall shear stress (!224).
- Fixed vorticity calculator (!138).
**MeshConvert:**
- Added face-interior quadrature and 2D/3D manifold support to spherigon code
(!130).
- Fixes for boundary layer refinement and prism-to-tetrahedron splitting (!137,
!202, !206, !244).
**FieldConvert (new):**
- Added new FieldConvert utility which will eventually encompass most existing
utilities (!255).
......@@ -16,6 +16,16 @@ There is also some limited support for other output formats. We begin by running
through a basic example to show how a mesh can be converted from the widely-used
mesh-generator \gmsh to the XML file format.
\begin{notebox}
The default since Jan 2016 is to output the .xml files in a
compressed form where the VERTEX, EDGES, FACES, ELEMENTS and CURVED
information is compressed into binary format which is then
converted into base64. This is identified for each section by the attribute
\inltt{COMPRESSED="B64Z-LittleEndian''}. To output
in ascii format add the module option ``:xml:uncompress'' to the .xml file,
i.e. \\ \inltt{ MeshConvert file.msh newfile.xml:xml:uncompress}
\end{notebox}
\section{Exporting a mesh from \gmsh}
To demonstrate how \mc works, we will define a simple channel-like 3D geometry.
......@@ -266,6 +276,14 @@ Note that for both \gmsh and \texttt{VTK}, it is highly likely that you will
need to experiment with the source code in order to successfully generate
meshes since robustness is not guaranteed.
The default for \texttt{xml} is into binary data which has been
converted into base64. If you wish to see an ascii output you need to
specify the output module option \inltt{uncompress} by executing:
\begin{lstlisting}[style=BashInputStyle]
MeshConvert Mesh.msh output.xml:xml:uncompress
\end{lstlisting}
In the rest of these subsections, we discuss the various processing modules
available within \mc.
......
......@@ -5,15 +5,16 @@ the elemental decomposition of the domain. It also defines a list of composites
which are used in the Expansions and Conditions sections of the file to describe
the polynomial expansions and impose boundary conditions.
The GEOMETRY section is structured as \begin{lstlisting}[style=XMLStyle]
The GEOMETRY section is structured as
\begin{lstlisting}[style=XMLStyle]
<GEOMETRY DIM="2" SPACE="2">
<VERTEX> ...
</VERTEX> <EDGE> ...
</EDGE> <FACE> ...
</FACE> <ELEMENT> ...
</ELEMENT> <CURVED> ...
</CURVED> <COMPOSITE> ...
</COMPOSITE> <DOMAIN> ... </DOMAIN>
<VERTEX> ... </VERTEX>
<EDGE> ... </EDGE>
<FACE> ... </FACE>
<ELEMENT> ... </ELEMENT>
<CURVED> ... </CURVED>
<COMPOSITE> ... </COMPOSITE>
<DOMAIN> ... </DOMAIN>
</GEOMETRY>
\end{lstlisting}
It has two (required) attributes:
......@@ -23,34 +24,49 @@ It has two (required) attributes:
elements exist.
\end{itemize}
These attributes allow, for example, a two-dimensional surface to be embedded in
a three-dimensional space.
a three-dimensional space.
\begin{notebox}
The attribute \inltt{PARAMETER} may also appear in a partitioned mesh.
The attribute \inltt{PARTITION} may also appear in a partitioned mesh.
However, this attribute should not be explicitly specified by the user.
\end{notebox}
Each of the \inltt{VERTEX}, \inltt{EDGE}, \inltt{FACE}, \inltt{ELEMENT}
and \inltt{CURVED} sections may optionally be compressed and stored in
base64-encoded gzipped binary form, using either little-endian or big-endian
ordering, as specified by the \inltt{COMPRESSED} attribute to these sections.
Currently supported values are:
\begin{itemize}
\item \inltt{B64Z-LittleEndian}: Base64 Gzip compressed using little-endian
ordering.
\item \inltt{B64Z-BigEndian}: Base64 Gzip compressed using big-endian
ordering.
\end{itemize}
\begin{notebox}
The description below explains how the \inltt{GEOMETRY} section is laid out in
uncompressed ascii format. From Jan 2016 the distribution uses the compressed
format for each of the above sections. To convert a compressed xml file into
ascii format use \\
\inltt{ MeshConvert file.msh newfile.xml:xml:uncompress}
\end{notebox}
\subsection{Vertices}
Vertices have three coordinates. Each has a unique vertex ID. They are defined
in the file within \inltt{VERTEX} subsection as follows:
Vertices have three coordinates. Each has a unique vertex ID. In
uncompressed form, they are defined within \inltt{VERTEX} subsection as follows:
\begin{lstlisting}[style=XMLStyle] <VERTEX>
<V ID="0"> 0.0 0.0 0.0 </V> ...
\end{lstlisting}
The \inltt{VERTEX} subsection has optional attributes which can be used to
apply a transformation to the mesh:
\begin{itemize}
\item \inltt{XSCALE}
\item \inltt{YSCALE}
\item \inltt{ZSCALE}
\item \inltt{XMOVE}
\item \inltt{YMOVE}
\item \inltt{ZMOVE}
\end{itemize}
apply a transformation to the mesh:\\
\inltt{XSCALE}, \inltt{YSCALE}, \inltt{ZSCALE},
\inltt{XMOVE}, \inltt{YMOVE}, \inltt{ZMOVE}
They specify scaling factors (centred at the origin) and translations to the
vertex coordinates. For example, the following snippet
\begin{lstlisting}[style=XMLStyle]
\begin{lstlisting}[style=XMLStyle]
<VERTEX XSCALE="5">
<V ID="0"> 0.0 0.0 0.0 </V>
<V ID="1"> 1.0 2.0 0.0 </V>
......@@ -64,6 +80,7 @@ mathematical operations/functions of the latter. If omitted, default scaling
factors 1.0, and translations of 0.0, are assumed.
\subsection{Edges}
\begin{tipbox}
The \inltt{EDGES} section is only necessary when \inltt{DIM=2} or
......@@ -71,8 +88,8 @@ factors 1.0, and translations of 0.0, are assumed.
one-dimensional meshes.
\end{tipbox}
Edges are defined by two vertices. Each edge has a unique edge ID. They are
defined in the file with a line of the form
Edges are defined by two vertices. Each edge has a unique edge ID. In
uncompressed form, they are defined in the file with a line of the form
\begin{lstlisting}[style=XMLStyle]
<E ID="0"> 0 1 </E>
\end{lstlisting}
......@@ -125,6 +142,11 @@ For mesh elements with curved edges and/or curved faces, a separate entry is use
</E>
\end{lstlisting}
\begin{notebox}
In the compressed form, this section contains different sub-elements to
efficiently encode the high-order curvature data. This is not described
further in this document.
\end{notebox}
\subsection{Composites}
Composites define collections of elements, faces or edges. Each has a unique composite ID associated with it. All components of a composite entry must be of the same type. The syntax allows components to be listed individually or using ranges. Examples include
......
......@@ -37,11 +37,16 @@
#define NEKTARUNIVTYPEDEF_HPP
#include <map>
#include <boost/cstdint.hpp>
namespace Nektar
{
typedef double NekDouble;
typedef boost::int32_t NekInt;
typedef boost::int32_t NekInt32;
typedef boost::int64_t NekInt64;
struct OneD
{
static const unsigned int Value = 1;
......
////////////////////////////////////////////////////////////////////////////////
//
// File: CompressData.cpp
//
// For more information, please see: http://www.nektar.info/
//
// The MIT License
//
// Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
// Department of Aeronautics, Imperial College London (UK), and Scientific
// Computing and Imaging Institute, University of Utah (USA).
//
// License for the specific language governing rights and limitations under
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Routines for compressing and inflating data
//
////////////////////////////////////////////////////////////////////////////////
#define NOMINMAX
#include <LibUtilities/BasicUtils/CompressData.h>
#include <LibUtilities/BasicUtils/MeshEntities.hpp>
#include <LibUtilities/BasicConst/GitRevision.h>
#include <set>
#ifdef NEKTAR_USE_MPI
#include <mpi.h>
#endif
#ifndef NEKTAR_VERSION
#define NEKTAR_VERSION "Unknown"
#endif
namespace Nektar
{
namespace LibUtilities
{
/**
* run time determination of endianness, returning an EndianType
*/
EndianType Endianness(void)
{
union
{
boost::uint32_t value;
boost::uint8_t data[sizeof(boost::uint32_t)];
} number;
number.data[0] = 0x00;
number.data[1] = 0x01;
number.data[2] = 0x02;
number.data[3] = 0x03;
switch (number.value)
{
case UINT32_C(0x00010203): return eEndianBig;
case UINT32_C(0x03020100): return eEndianLittle;
case UINT32_C(0x02030001): return eEndianBigWord;
case UINT32_C(0x01000302): return eEndianLittleWord;
default: return eEndianUnknown;
}
}
namespace CompressData
{
/**
* Return a string describing this compression and endianness
*/
std::string GetCompressString(void)
{
return "B64Z-"+ EndianTypeMap[Endianness()];
}
std::string GetBitSizeStr(void)
{
return boost::lexical_cast<std::string>(sizeof(void*)*8);
}
/**
* Convert a binary string to Base 64 string
*/
void BinaryStrToBase64Str(std::string &compressedDataString,
std::string &base64string)
{
// If the string length is not divisible by 3,
// pad it. There is a bug in transform_width
// that will make it reference past the end
// and crash.
switch (compressedDataString.length() % 3)
{
case 1:
compressedDataString += '\0';
case 2:
compressedDataString += '\0';
break;
}
// Convert from binary to base64.
typedef boost::archive::iterators::base64_from_binary<
boost::archive::iterators::transform_width<
std::string::const_iterator, 6, 8> > base64_t;
base64string = std::string(base64_t(compressedDataString.begin()),
base64_t(compressedDataString.end()));
}
/**
* Convert a Base 64 string into a binary string
*/
void Base64StrToBinaryStr(std::string &base64string,
std::string &compressedDataString)
{
// Convert from base64 to binary.
typedef boost::archive::iterators::transform_width<