Commit 1eb27025 authored by Dave Moxey's avatar Dave Moxey

Merge remote-tracking branch 'upstream/master' into feature/cmake-cleanup

Conflicts:
	cmake/ThirdPartyFFTW.cmake
	cmake/ThirdPartyLoki.cmake
	cmake/ThirdPartyMPI.cmake
parents c83eabd8 7702eef3
......@@ -11,6 +11,6 @@ AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
IndentCaseLabels: true
Standard: Cpp03
Standard: Cpp11
AccessModifierOffset: -4
BinPackParameters: true
......@@ -6,11 +6,15 @@ v4.5.0
**NekMesh**:
- Add periodic boundary condition meshing in 2D (!733)
- Adjust boundary layer thickness in corners in 2D (!739)
- Add non-O BL meshing in 2D (!757)
**Library**
- Added in sum factorisation version for pyramid expansions and orthogonal
expansion in pyramids (!750)
**FieldConvert**:
- Add input module for Semtex field files (!777)
**Documentation**:
- Added the developer-guide repository as a submodule (!751)
......@@ -24,13 +28,19 @@ v4.4.1
- Fix interpolation issue with Lagrange basis functions (!768)
- Fix issue with average fields not working with different polynomial order
fields (!776)
- Fix rounding of integer parameters (!774)
- Fix Hdf5 output in FilterFieldConvert (!781)
- Fixed extreme memory consumption of Interpolator when interpolating from pts
to fld or between different meshes (!783)
- Fix deadlock with HDF5 input (!786)
- Fix missing entriess in LibUtilities::kPointsTypeStr (!792)
- Fix compiler warnings with CommDataType (!793)
**FieldConvert:**
- Fix issue with field ordering in the interppointdatatofld module (!754)
- Fix issue with FieldConvert when range flag used (!761)
- Fix issue when using output-points combined with noequispaced (!775)
- Fix equispacedoutput for 3DH1D with triangles (!787)
**NekMesh**:
- Fix memory consumption issue with Gmsh output (!747, !762)
......@@ -38,10 +48,15 @@ v4.4.1
when some part of the system fails (!756)
- Add manifold meshing option (!756)
- Fix issue with older rea input files (!765)
- Fix memory leak in variational optimiser, add small optimisations (!785)
- Check the dimensionality of the CAD system before running the 2D generator (!780)
**IncNavierStokesSolver**
- Fix an initialisation issue when using an additional advective field (!779)
**Packaging**
- Added missing package for FieldUtils library (!755)
v4.4.0
------
**Library**:
......
......@@ -5,14 +5,34 @@ RelWithDebInfo MinSizeRel.")
PROJECT(Nektar++ C CXX)
# Nektar++ requires C++11. Try to infer this for older CMake versions (less than
# 3.1.0)
IF ("${CMAKE_VERSION}" VERSION_LESS "3.1")
IF (NOT MSVC)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
IF (COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSE()
MESSAGE(FATAL_ERROR "Nektar++ requires a compiler with C++11 support.")
ENDIF()
ELSEIF(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
MESSAGE(FATAL_ERROR "Nektar++ requires full C++11 support: please upgrade to Visual Studio 2013 or later")
ENDIF()
ELSE()
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_CXX_EXTENSIONS OFF)
ENDIF()
INCLUDE(CheckLanguage)
CHECK_LANGUAGE(Fortran)
IF(CMAKE_Fortran_COMPILER)
ENABLE_LANGUAGE(Fortran)
ENABLE_LANGUAGE(Fortran)
ELSE()
MESSAGE(STATUS "No Fortran support")
MESSAGE(STATUS "No Fortran support")
ENDIF()
# Helps organize projects in IDEs.
......@@ -218,7 +238,6 @@ ENDIF ()
# Find ThirdParty libraries and headers.
INCLUDE (ThirdPartyTinyxml)
INCLUDE (ThirdPartyLoki)
INCLUDE (ThirdPartyMetis)
INCLUDE (ThirdPartyHDF5)
INCLUDE (ThirdPartyScotch)
......
......@@ -44,7 +44,9 @@ project. It's a pretty simple process:
diff and are not quite ready to merge, use the `[WIP]` tag in the title to
prevent your code from being accidentally merged.
5. Put a comment in the MR saying that it's ready to be merged.
6. Respond to any comments in the code review.
6. If your branch is a minor fix that could appear in the next patch release,
then add the `Proposed patch` label to the merge request.
7. Respond to any comments in the code review.
## Submission checklist
- Did you add regression tests (for fixes) or unit tests and/or normal tests for
......@@ -155,6 +157,78 @@ stick to the following process:
- Once feedback received from the branch author (if necessary) and reviewers are
happy, the branch will be merged.
## Release branches
Nektar++ releases are versioned in the standard form `x.y.z` where `x` is a
major release, `y` a minor release and `z` a patch release:
- major releases are extremely infrequent (on the order of every 2-3 years) and
denote major changes in functionality and the API;
- minor releases occur around twice per year and contain new features with minor
API changes;
- patch releases are targeted on roughly a monthly basis and are intended to
fix minor issues in the code.
The repository contains a number of _release branches_ named `release/x.y` for
each minor release, which are intended to contain **fixes and very minor
changes** from `master` and which form the next patch release. This allows us to
use `master` for the next minor release, whilst still having key fixes in patch
releases.
### Cherry-picking process
Any branches that are marked with the `Proposed patch` label should follow the
following additional steps to cherry pick commits into the `release/x.y` branch.
1. If the branch is on a remote other than `nektar/nektar`, make sure that's
added to your local repository.
2. On a local terminal, run `git fetch --all` to pull the latest changes. It's
important for the commands below that you do this _before_ you merge the
branch into `master`.
3. Merge the branch into master as usual using GitLab.
4. Switch to the appropriate branch with `git checkout release/x.y` and update
with `git pull`.
5. Now check the list of commits to cherry-pick.
```bash
git log --oneline --no-merges --reverse origin/master..REMOTE/fix/BRANCHNAME
```
where `REMOTE` is the remote on which the branch lives and `BRANCHNAME` is
the fix branch. If the list is empty, you probably did a `git fetch` after
you merged the branch into `master`; in this case use `origin/master^`.
6. If you're happy with the list (compare to the MR list on the GitLab MR if
necessary), cherry-pick the commits with the command:
```bash
git cherry-pick -x $(git rev-list --no-merges --reverse origin/master..REMOTE/fix/BRANCHNAME)
```
7. It's likely you'll encounter some conflicts, particularly with the
`CHANGELOG`. To fix these:
- `git status` to see what's broken
- Fix appropriately
- `git commit -a` to commit your fix
- `git cherry-pick --continue`
8. If everything becomes horribly broken, `git cherry-pick --abort`.
9. Once you're happy, `git push` to send your changes back to GitLab.
Steps 5 and 6 can be simplified by creating a script
```bash
#!/bin/bash
src=$1
logopts="--oneline --no-merges --reverse"
commits=`git log $logopts master..$1 | cut -f 1 -d " " | xargs`
echo "Will cherry-pick the following commits: $commits"
echo "Press ENTER to continue..."
read
cherryopts="-x --allow-empty --allow-empty-message"
git cherry-pick $cherryopts $commits
```
which accepts the name of the source branch as the sole argument.
## Formatting guidelines
Nektar++ uses C++, a language notorious for being easy to make obtuse and
difficult to follow code. To hopefully alleviate this problem, there are a
......
......@@ -50,10 +50,6 @@ SET(Boost_LIBRARY_DIRS "@Boost_CONFIG_LIBRARY_DIR@")
SET(NEKTAR++_TP_LIBRARIES
${NEKTAR++_TP_LIBRARIES} ${Boost_LIBRARIES})
SET(LOKI_INCLUDE_DIRS "@LOKI_CONFIG_INCLUDE_DIR@")
SET(NEKTAR++_TP_INCLUDE_DIRS
${NEKTAR++_TP_INCLUDE_DIRS} ${LOKI_INCLUDE_DIRS})
SET(TINYXML_INCLUDE_DIRS "@TINYXML_CONFIG_INCLUDE_DIR@")
SET(NEKTAR++_TP_INCLUDE_DIRS
${NEKTAR++_TP_INCLUDE_DIRS} ${TINYXML_INCLUDE_DIRS})
......
......@@ -10,13 +10,14 @@ OPTION(NEKTAR_USE_FFTW
"Use FFTW routines for performing the Fast Fourier Transform." OFF)
IF (NEKTAR_USE_FFTW)
# Set some common FFTW search paths.
# Set some common FFTW search paths for the library.
SET(FFTW_SEARCH_PATHS $ENV{LD_LIBRARY_PATH} $ENV{FFTW_HOME}/lib)
FIND_LIBRARY(FFTW_LIBRARY NAMES fftw3 fftw3f PATHS ${FFTW_SEARCH_PATHS})
IF (FFTW_LIBRARY)
GET_FILENAME_COMPONENT(FFTW_PATH ${FFTW_LIBRARY} PATH)
SET(FFTW_INCLUDE_DIR ${FFTW_PATH}/../include CACHE FILEPATH "FFTW include directory.")
FIND_PATH(FFTW_INCLUDE_DIR NAMES fftw3.h CACHE FILEPATH
"FFTW include directory.")
IF (FFTW_LIBRARY AND FFTW_INCLUDE_DIR)
SET(BUILD_FFTW OFF)
ELSE()
SET(BUILD_FFTW ON)
......@@ -53,9 +54,16 @@ IF (NEKTAR_USE_FFTW)
MESSAGE(STATUS "Found FFTW: ${FFTW_LIBRARY}")
SET(FFTW_CONFIG_INCLUDE_DIR ${FFTW_INCLUDE_DIR})
ENDIF()
ENDIF( NEKTAR_USE_FFTW )
INCLUDE_DIRECTORIES(${FFTW_INCLUDE_DIR})
# Test if FFTW path is a system path. Only add to include path if not an
# implicitly defined CXX include path (due to GCC 6.x now providing its own
# version of some C header files and -isystem reorders include paths).
GET_FILENAME_COMPONENT(X ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES} ABSOLUTE)
GET_FILENAME_COMPONENT(Y ${FFTW_INCLUDE_DIR} ABSOLUTE)
IF (NOT Y MATCHES ".*${X}.*")
INCLUDE_DIRECTORIES(SYSTEM ${FFTW_INCLUDE_DIR})
ENDIF()
MARK_AS_ADVANCED(FFTW_LIBRARY)
MARK_AS_ADVANCED(FFTW_INCLUDE_DIR)
MARK_AS_ADVANCED(FFTW_LIBRARY)
MARK_AS_ADVANCED(FFTW_INCLUDE_DIR)
ENDIF( NEKTAR_USE_FFTW )
########################################################################
#
# ThirdParty configuration for Nektar++
#
# Loki headers library
#
########################################################################
# Try to find system Loki headers. Hint /opt/local/include for MacPorts
# (although there is no Portfile for Loki currently).
FIND_PATH(LOKI_INCLUDE_DIR loki/Singleton.h PATHS /opt/local/include)
IF (LOKI_INCLUDE_DIR)
SET(BUILD_LOKI OFF)
ELSE()
SET(BUILD_LOKI ON)
ENDIF()
OPTION(THIRDPARTY_BUILD_LOKI
"Download and extract Loki library to ThirdParty." ${BUILD_LOKI})
IF (THIRDPARTY_BUILD_LOKI)
# Download Loki if it doesn't already exist.
IF (NOT EXISTS ${TPSRC}/loki-0.1.3.tar.bz2)
FILE(DOWNLOAD ${TPURL}/loki-0.1.3.tar.bz2 ${TPSRC}/loki-0.1.3.tar.bz2)
ENDIF()
# TODO: Check hashes.
# Extract.
EXECUTE_PROCESS(
COMMAND ${CMAKE_COMMAND} -E tar jxf ${TPSRC}/loki-0.1.3.tar.bz2
WORKING_DIRECTORY ${TPSRC}
)
# Set LOKI_INCLUDE_DIR.
FILE(COPY ${TPSRC}/loki-0.1.3/include/loki/ DESTINATION ${TPDIST}/include/loki/)
SET(LOKI_INCLUDE_DIR ${TPDIST}/include CACHE PATH "" FORCE)
MESSAGE(STATUS "Build Loki: ${LOKI_INCLUDE_DIR}")
SET(LOKI_CONFIG_INCLUDE_DIR ${TPINC})
ELSE()
MESSAGE(STATUS "Found Loki: ${LOKI_INCLUDE_DIR}")
SET(LOKI_CONFIG_INCLUDE_DIR ${LOKI_INCLUDE_DIR})
ENDIF()
INCLUDE_DIRECTORIES(${LOKI_INCLUDE_DIR})
MARK_AS_ADVANCED(LOKI_INCLUDE_DIR)
......@@ -29,7 +29,6 @@ IF( NEKTAR_USE_MPI )
IF (NOT THIRDPARTY_BUILD_MPI)
FIND_PACKAGE(MPI)
INCLUDE (FindMPI)
IF (NOT MPI_CXX_FOUND)
# No MPI at all: we have to build it
SET(BUILD_MPI ON)
......
......@@ -36,6 +36,9 @@ IF( NEKTAR_USE_VTK )
FIND_PACKAGE(VTK)
IF (VTK_FOUND)
MESSAGE(STATUS "Found VTK: ${VTK_USE_FILE}")
IF (VTK_MAJOR_VERSION EQUAL 6 AND VTK_MINOR_VERSION EQUAL 0 AND VTK_BUILD_VERSION EQUAL 0)
ADD_DEFINITIONS(-DNEKTAR_HAS_VTK_6_0_0)
ENDIF()
ELSE (VTK_FOUND)
MESSAGE(FATAL_ERROR "VTK not found")
ENDIF (VTK_FOUND)
......
......@@ -640,10 +640,6 @@ automatically built during the \nekpp build process. Below are the choices of X:
(MPI-only) Parallel communication library.
\item \inlsh{LOKI}
An implementation of a singleton.
\item \inlsh{METIS}
A graph partitioning library used for substructuring of matrices and mesh
......
\chapter{FieldConvert}
\label{s:utilities:fieldconvert}
FieldConvert is a utility embedded in \nekpp with the primary aim of
allowing the user to convert the \nekpp output binary files (.chk and
.fld) into a format which can be read by two common visualisation
softwares: Paraview/VisIt (.vtu format) or Tecplot/VisIt (.dat or .plt
formats). FieldConvert also allows the user to manipulate the \nekpp
output binary files by using some additional modules which can be
called with the option \inltt{-m} which stands for
\inltt{m}odule. Note that another flag, \inltt{-r} (which stand for
\inltt{r}ange) allows the user to specify a sub-range of the domain on
which the conversion or manipulation of the \nekpp output binary files
will be performed.
FieldConvert is a utility embedded in \nekpp with the primary aim of allowing
the user to convert the \nekpp output binary files (\inltt{.chk} and
\inltt{.fld}) into formats which can be read by common visualisation and
post-processing software, primarily Paraview/VisIt (in unstructured VTK
\inltt{.vtu} format) or Tecplot/VisIt (in ASCII \inltt{.dat} or binary
\inltt{.plt} formats). FieldConvert also allows the user to manipulate the
\nekpp output binary files by using some additional modules which can be called
with the option \inltt{-m} which stands for \inltt{m}odule. Note that another
flag, \inltt{-r} (which stand for \inltt{r}ange) allows the user to specify a
sub-range of the domain on which the conversion or manipulation of the \nekpp
output binary files will be performed.
Almost all of the FieldConvert functionalities can be run in parallel if \nekpp
is compiled using MPI (see the installation documentation for additional info on
......@@ -19,6 +19,49 @@ how to implement \nekpp using MPI). \footnote{Modules that do not have parallel
%
%
%
\section{Basic usage}
FieldConvert expects at least one input specification (such as a session file
and its corresponding field file) and one output specification. These are
specified on the command line as
%
\begin{lstlisting}[style=BashInputStyle]
FieldConvert in1.xml in2.fld out.dat
\end{lstlisting}
%
These can be combined with a processing module by adding the \inltt{-m} command
line option. There can be more than one module specified, and they can appear
anywhere in the command line arguments, although the order of execution is
inferred from their order in the command line. For example, the command
%
\begin{lstlisting}[style=BashInputStyle]
FieldConvert in1.xml -m module1 in2.fld -m module2 out.dat
\end{lstlisting}
%
causes \inltt{in1.xml} and \inltt{in2.fld} to be read, followed by the
\inltt{module1} processing module, the \inltt{module2} processing module, and
finally output to the \inltt{out.dat} Tecplot file.
\subsection{Input formats}
FieldConvert supports XML and FLD-format files as produced by \nekpp. It also
supports the reading of data files from two external spectral element codes:
\emph{Semtex}\footnote{http://users.monash.edu.au/~bburn/semtex.html} and
\emph{Nek5000}\footnote{https://nek5000.mcs.anl.gov}. These files can be
directly converted to \nekpp format files by using the command
%
\begin{lstlisting}[style=BashInputStyle]
FieldConvert input.fld output.fld
\end{lstlisting}
%
Note that even though the \inltt{.fld} extension is typically associated with
\nekpp files, FieldConvert can automatically identify \emph{Semtex} and
\emph{Nek5000} input field files.
To use these files in a simulation, or to post-process the results of a
simulation, an appropriate mesh must also be defined in the \nekpp XML format.
\nm can be used to convert these input files to XML, as outlined in
section~\ref{s:utilities:nekmesh}.
\section{Convert .fld / .chk files into Paraview, VisIt or Tecplot format}
\label{s:utilities:fieldconvert:sub:convert}
To convert the \nekpp output binary files (.chk and .fld) into a
......
......@@ -33,7 +33,6 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <loki/Singleton.h>
#include <Collections/Operator.h>
#include <Collections/Collection.h>
......
......@@ -33,7 +33,6 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <loki/Singleton.h>
#include <Collections/Operator.h>
#include <Collections/Collection.h>
#include <Collections/IProduct.h>
......
......@@ -33,7 +33,6 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <loki/Singleton.h>
#include <Collections/Operator.h>
#include <Collections/Collection.h>
#include <Collections/IProduct.h>
......
......@@ -33,7 +33,6 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <loki/Singleton.h>
#include <Collections/Operator.h>
#include <Collections/Collection.h>
......@@ -109,11 +108,8 @@ Operator::~Operator()
*/
OperatorFactory& GetOperatorFactory()
{
typedef Loki::SingletonHolder<OperatorFactory,
Loki::CreateUsingNew,
Loki::NoDestroy,
Loki::SingleThreaded> Type;
return Type::Instance();
static OperatorFactory instance;
return instance;
}
......
......@@ -33,7 +33,6 @@
//
///////////////////////////////////////////////////////////////////////////////
#include <loki/Singleton.h>
#include <Collections/Operator.h>
#include <Collections/Collection.h>
......
......@@ -7,6 +7,7 @@ SET(FieldUtilsHeaders
InputModules/InputXml.h
InputModules/InputPts.h
InputModules/InputNek5000.h
InputModules/InputSemtex.h
OutputModules/OutputInfo.h
OutputModules/OutputTecplot.h
OutputModules/OutputVtk.h
......@@ -55,6 +56,7 @@ SET(FieldUtilsSources
InputModules/InputXml.cpp
InputModules/InputPts.cpp
InputModules/InputNek5000.cpp
InputModules/InputSemtex.cpp
OutputModules/OutputInfo.cpp
OutputModules/OutputTecplot.cpp
OutputModules/OutputVtk.cpp
......
......@@ -43,6 +43,4 @@
#define FIELD_UTILS_EXPORT
#endif
#define LOKI_CLASS_LEVEL_THREADING
#endif // NEKTAR_FIELD_UTILS_DECLSPEC_H
......@@ -54,28 +54,6 @@ ModuleKey InputNek5000::m_className[1] = {
"Reads Nek5000 field file.")
};
/**
* @brief Swap endian ordering of the input variable.
*/
template <typename T>
void swap_endian(T &u)
{
union
{
T u;
unsigned char u8[sizeof(T)];
} source, dest;
source.u = u;
for (size_t k = 0; k < sizeof(T); k++)
{
dest.u8[k] = source.u8[sizeof(T) - k - 1];
}
u = dest.u;
}
/**
* @brief Set up InputNek5000 object.
*
......
////////////////////////////////////////////////////////////////////////////////
//
// File: InputSemtex.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: Reads a Semtex checkpoint file.
//
////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
using namespace std;
#include <LibUtilities/BasicUtils/CompressData.h>
#include <boost/algorithm/string.hpp>
#include "InputSemtex.h"
namespace Nektar
{
namespace FieldUtils
{
ModuleKey InputSemtex::m_className[1] = {
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eInputModule, "fldsem"), InputSemtex::create,
"Reads Semtex field file.")
};
/**
* @brief Set up InputSemtex object.
*
*/
InputSemtex::InputSemtex(FieldSharedPtr f) : InputModule(f)
{
m_allowedFiles.insert("fldsem");
}
/**
*
*/
InputSemtex::~InputSemtex()
{
}
/**
* @brief Process Semtex input file.
*
* This routine reads a binary-format Semtex field file, loads the data into
* memory and populates the field definitions to match the data format. Semtex
* is a classic nodal-Lagrangian spectral element code at a single polynomial
* order, meaning that the field data are set up according to this structure.
*/
void InputSemtex::Process(po::variables_map &vm)
{