Commit 7c38a5ff authored by Douglas Serson's avatar Douglas Serson
Browse files

Merge branch 'master' into feature/FC-refactor

parents e420fdbe e598a95c
......@@ -6,6 +6,7 @@ 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
......@@ -27,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)
......@@ -41,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**:
......
......@@ -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
......
......@@ -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)
......@@ -55,9 +56,18 @@ IF (NEKTAR_USE_FFTW)
MESSAGE(STATUS "Found FFTW: ${FFTW_LIBRARY}")
SET(FFTW_CONFIG_INCLUDE_DIR ${FFTW_INCLUDE_DIR})
ENDIF()
# 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)
ENDIF( NEKTAR_USE_FFTW )
INCLUDE_DIRECTORIES(SYSTEM ${FFTW_INCLUDE_DIR})
MARK_AS_ADVANCED(FFTW_LIBRARY)
MARK_AS_ADVANCED(FFTW_INCLUDE_DIR)
......@@ -34,10 +34,14 @@
//
////////////////////////////////////////////////////////////////////////////////
#include <boost/geometry.hpp>
#include <FieldUtils/Interpolator.h>
using namespace std;
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
namespace Nektar
{
namespace FieldUtils
......
......@@ -38,15 +38,15 @@
#define FIELDUTILS_INTERPOLATOR_H
#include <vector>
#include <iostream>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <MultiRegions/ExpList.h>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp>
......@@ -56,9 +56,6 @@
#include "FieldUtilsDeclspec.h"
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
namespace Nektar
{
namespace FieldUtils
......@@ -182,9 +179,9 @@ private:
/// dimension of this interpolator. Hardcoded to 3
static const int m_dim = 3;
typedef bg::model::point<NekDouble, m_dim, bg::cs::cartesian> BPoint;
typedef boost::geometry::model::point<NekDouble, m_dim, boost::geometry::cs::cartesian> BPoint;
typedef std::pair<BPoint, unsigned int> PtsPointPair;
typedef bgi::rtree<PtsPointPair, bgi::rstar<16> > PtsRtree;
typedef boost::geometry::index::rtree<PtsPointPair, boost::geometry::index::rstar<16> > PtsRtree;
/// input field
LibUtilities::PtsFieldSharedPtr m_ptsInField;
......
......@@ -612,14 +612,14 @@ void ProcessEquiSpacedOutput::SetHomogeneousConnectivity(void)
}
// Interior numbering
int mode = np+1;
edge2 = 0;
for (int n = 1; n < np-1; n++)
{
edge2 += np+1-n;
for (int m = 1; m < np-n-1; m++)
{
vId[cnt1+mode] = 4*nel + maxN*4*nel + cnt2;
vId[cnt1+edge2+m] = 4*nel + maxN*4*nel + cnt2;
cnt2++;
mode++;
}
}
cnt1+= newpoints;
......
......@@ -36,6 +36,7 @@
#include <string>
using namespace std;
#include <boost/geometry.hpp>
#include "ProcessInterpField.h"
#include <FieldUtils/Interpolator.h>
......@@ -43,6 +44,10 @@ using namespace std;
#include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
namespace Nektar
{
namespace FieldUtils
......
......@@ -38,6 +38,7 @@
using namespace std;
#include <boost/geometry.hpp>
#include "ProcessInterpPointDataToFld.h"
#include <FieldUtils/Interpolator.h>
......@@ -45,6 +46,10 @@ using namespace std;
#include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
namespace Nektar
{
namespace FieldUtils
......
......@@ -37,15 +37,20 @@
#include <string>
using namespace std;
#include <boost/geometry.hpp>
#include "ProcessInterpPoints.h"
#include <FieldUtils/Interpolator.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
namespace Nektar
{
namespace FieldUtils
......
......@@ -35,6 +35,11 @@
#include <string>
#include <iostream>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
#include "ProcessIsoContour.h"
#include <LibUtilities/BasicUtils/SharedArray.hpp>
......@@ -42,11 +47,6 @@
#include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
......
......@@ -39,15 +39,6 @@
#include "../Module.h"
#include "ProcessEquiSpacedOutput.h"
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/box.hpp>
#include <boost/geometry/index/rtree.hpp>
namespace bg = boost::geometry;
namespace bgi = boost::geometry::index;
namespace Nektar
{
namespace FieldUtils
......
......@@ -864,6 +864,7 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
// Set properties for parallel file access (if we're in parallel)
H5::PListSharedPtr parallelProps = H5::PList::Default();
H5::PListSharedPtr readPL = H5::PList::Default();
H5::PListSharedPtr readPLInd = H5::PList::Default();
if (nRanks > 1)
{
......@@ -873,6 +874,8 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
// Use collective IO
readPL = H5::PList::DatasetXfer();
readPL->SetDxMpioCollective();
readPLInd = H5::PList::DatasetXfer();
readPLInd->SetDxMpioIndependent();
}
DataSourceSharedPtr dataSource = H5DataSource::create(
......@@ -1012,8 +1015,9 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
map<uint64_t, set<uint64_t> >::iterator gIt;
for (gIt = groupsToDecomps.begin(); gIt != groupsToDecomps.end(); ++gIt)
{
// Select region from dataset for this decomposition.
set<uint64_t>::iterator sIt;
// Select region from dataset for this decomposition.
for (sIt = gIt->second.begin(); sIt != gIt->second.end(); ++sIt)
{
std::stringstream fieldNameStream;
......@@ -1021,7 +1025,7 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
FieldDefinitionsSharedPtr fielddef =
MemoryManager<FieldDefinitions>::AllocateSharedPtr();
ImportFieldDef(readPL, root, decomps, *sIt, decompsToOffsets[*sIt],
ImportFieldDef(readPLInd, root, decomps, *sIt, decompsToOffsets[*sIt],
fieldNameStream.str(), fielddef);
fielddef->m_elementIDs = groupsToElmts[*sIt];
......@@ -1031,7 +1035,7 @@ void FieldIOHdf5::v_Import(const std::string &infilename,
{
std::vector<NekDouble> decompFieldData;
ImportFieldData(
readPL, data_dset, data_fspace,
readPLInd, data_dset, data_fspace,
decompsToOffsets[*sIt].data, decomps, *sIt, fielddef,
decompFieldData);
fielddata.push_back(decompFieldData);
......@@ -1276,7 +1280,6 @@ void FieldIOHdf5::ImportFieldData(
data_fspace->SelectRange(data_i, nFieldVals);
data_dset->Read(fielddata, data_fspace, readPL);
int datasize = CheckFieldDefinition(fielddef);
ASSERTL0(
fielddata.size() == datasize * fielddef->m_fields.size(),
......
......@@ -76,6 +76,7 @@ namespace H5
0); \
}
class Error : public std::exception
{
};
......@@ -474,12 +475,9 @@ public:
DataTypeSharedPtr mem_t = DataTypeTraits<T>::GetType();
DataSpaceSharedPtr memspace = DataSpace::OneD(data.size());
H5Dwrite(m_Id,
mem_t->GetId(),
memspace->GetId(),
filespace->GetId(),
dxpl->GetId(),
&data[0]);
H5_CALL(H5Dwrite,
(m_Id, mem_t->GetId(), memspace->GetId(), filespace->GetId(),
dxpl->GetId(), &data[0]) );
}
template <class T> void Read(std::vector<T> &data)
{
......@@ -508,12 +506,8 @@ public:
data.resize(len);
DataSpaceSharedPtr memspace = DataSpace::OneD(len);
H5Dread(m_Id,
mem_t->GetId(),
memspace->GetId(),
filespace->GetId(),
dxpl->GetId(),
&data[0]);
H5_CALL(H5Dread, (m_Id, mem_t->GetId(), memspace->GetId(),
filespace->GetId(), dxpl->GetId(), &data[0]));
}
private:
......
......@@ -719,7 +719,7 @@ namespace Nektar
ParameterMap::const_iterator paramIter = m_parameters.find(vName);
ASSERTL0(paramIter != m_parameters.end(), "Required parameter '" +
pName + "' not specified in session.");
pVar = (int)floor(paramIter->second);
pVar = (int)round(paramIter->second);
}
......@@ -733,7 +733,7 @@ namespace Nektar
ParameterMap::const_iterator paramIter = m_parameters.find(vName);
if(paramIter != m_parameters.end())
{
pVar = (int)floor(paramIter->second);
pVar = (int)round(paramIter->second);
}
else
{
......
......@@ -82,27 +82,59 @@ int CommDataTypeGetSize(CommDataType dt)
#endif
}
/// Type trait mapping an int to MPI_INT
template <> CommDataType CommDataTypeTraits<int>::type = MPI_INT;
/// Type trait mapping an unsigned int to MPI_UNSIGNED
template <> CommDataType CommDataTypeTraits<unsigned>::type = MPI_UNSIGNED;
/// Type trait mapping a long int to MPI_LONG
template <> CommDataType CommDataTypeTraits<long>::type = MPI_LONG;
/// Type trait mapping an unsigned long int to MPI_UNSIGNED_LONG
template <>
CommDataType CommDataTypeTraits<unsigned long>::type = MPI_UNSIGNED_LONG;
/// Type trait mapping a long long int to MPI_LONG_LONG
template <> CommDataType CommDataTypeTraits<long long>::type = MPI_LONG_LONG;
/// Type trait mapping an unsigned long long int to MPI_UNSIGNED_LONG_LONG
template <>
CommDataType CommDataTypeTraits<unsigned long long>::type =
MPI_UNSIGNED_LONG_LONG;
/// Type trait mapping a float to MPI_FLOAT
template <> CommDataType CommDataTypeTraits<float>::type = MPI_FLOAT;
/// Type trait mapping a double to MPI_DOUBLE
template <> CommDataType CommDataTypeTraits<double>::type = MPI_DOUBLE;
/// Type trait mapping a long double to MPI_LONG_DOUBLE
template <>
CommDataType CommDataTypeTraits<long double>::type = MPI_LONG_DOUBLE;
template<> CommDataType &CommDataTypeTraits<int>::GetDataType()
{
static CommDataType type = MPI_INT;
return type;
}
template<> CommDataType &CommDataTypeTraits<unsigned>::GetDataType()
{
static CommDataType type = MPI_UNSIGNED;
return type;
}
template<> CommDataType &CommDataTypeTraits<long>::GetDataType()
{
static CommDataType type = MPI_LONG;
return type;
}
template<> CommDataType &CommDataTypeTraits<unsigned long>::GetDataType()
{
static CommDataType type = MPI_UNSIGNED_LONG;
return type;
}
template<> CommDataType &CommDataTypeTraits<long long>::GetDataType()
{
static CommDataType type = MPI_LONG_LONG;
return type;
}
template<> CommDataType &CommDataTypeTraits<unsigned long long>::GetDataType()
{
static CommDataType type = MPI_UNSIGNED_LONG_LONG;
return type;
}
template<> CommDataType &CommDataTypeTraits<float>::GetDataType()
{
static CommDataType type = MPI_FLOAT;
return type;
}
template<> CommDataType &CommDataTypeTraits<double>::GetDataType()
{
static CommDataType type = MPI_DOUBLE;
return type;
}
template<> CommDataType &CommDataTypeTraits<long double>::GetDataType()
{
static CommDataType type = MPI_LONG_DOUBLE;
return type;
}
}
}
......@@ -82,13 +82,9 @@ int CommDataTypeGetSize(CommDataType);
template <class T> class CommDataTypeTraits
{
LIB_UTILITIES_EXPORT static CommDataType type;
public:
static CommDataType &GetDataType()
{
return type;
}
LIB_UTILITIES_EXPORT static CommDataType &GetDataType();
static void *GetPointer(T &val)
{
return &val;
......
......@@ -101,9 +101,10 @@ namespace Nektar
"NodalPrismElec",
"NodalTriSPI",
"NodalTetSPI",
"NodalPrismSPI"
"NodalPrismSPI",
"NodalQuadElec",
"NodalHexElec"
};
} // end of namespace
} // end of namespace
......
......@@ -72,6 +72,10 @@ Generator2D::~Generator2D()
void Generator2D::Process()
{
// Check that cad is 2D
Array<OneD, NekDouble> bndBox = m_mesh->m_cad->GetBoundingBox();
ASSERTL0(fabs(bndBox[5] - bndBox[4]) < 1.0e-7, "CAD isn't 2D");
if (m_mesh->m_verbose)
{
cout << endl << "2D meshing" << endl;
......@@ -83,6 +87,12 @@ void Generator2D::Process()
ParseUtils::GenerateSeqVector(m_config["blcurves"].as<string>().c_str(),
m_blCurves);
// find the ends of the BL curves
if (m_config["blcurves"].beenSet)
{
FindBLEnds();
}
// linear mesh all curves
for (int i = 1; i <= m_mesh->m_cad->GetNumCurve(); i++)
{
......@@ -97,6 +107,34 @@ void Generator2D::Process()
{
m_curvemeshes[i] =
MemoryManager<CurveMesh>::AllocateSharedPtr(i, m_mesh);
// Fheck if this curve is at an end of the BL
// If so, define an offset for the second node, corresponding to the
// BL thickness
if (m_blends.count(i))
{
vector<CADVertSharedPtr> vertices =
m_mesh->m_cad->GetCurve(i)->GetVertex();
Array<OneD, NekDouble> loc;
NekDouble t;
// offset needed at first node (or both)
if (m_blends[i]