Commit 1251807f authored by Chris Cantwell's avatar Chris Cantwell
Browse files

Merge branch 'master' into fix/HistoryPts3DH1D

parents c1454e24 c154b66e
......@@ -4,9 +4,19 @@ Changelog
v4.3.2
------
**Library**:
- Add small optimisation for DriverAdaptive (!618)
- Updated FFTW build to use the compiler used for building Nektar++ (!629)
- Fix numbering bug in periodic boundary conditions (!631)
- Print error message for invalid equation also in release version (!634)
- HistoryPoints filter now uses closest plane to requested z-coordinate and
output is produced in physical space (!621).
**FieldConvert**:
- Fix appearence of duplicate messages when running in parallel (!626)
**Packaging**:
- Fixes for DEB package dependencies (!630)
v4.3.1
------
**Library**:
......@@ -24,6 +34,9 @@ v4.3.1
- Fix FieldConvert processing of partitions in serial (!612)
- Fix use of multi-level static condensation in parallel with periodic
boundary conditions (!614)
- Fix NaN detection to work in parallel (!605)
- Add additional constructor to ContField3DHomogeneous1D for FieldConvert
extract module. (!590)
**NekMesh**:
- Fix incorrect link directory on CCMIO library.
......@@ -36,6 +49,9 @@ v4.3.1
- Remove requirement for executable to be specified in .tst file if it is
overridden on the command-line (!595)
**Packaging**:
- Fix dependency resolution on generation of DEB packages. (!616)
v4.3.0
------
**Library:**
......
......@@ -38,7 +38,7 @@ IF (NEKTAR_USE_FFTW)
BINARY_DIR ${TPBUILD}/fftw-3.2.2
TMP_DIR ${TPBUILD}/fftw-3.2.2-tmp
INSTALL_DIR ${TPDIST}
CONFIGURE_COMMAND ${TPSRC}/fftw-3.2.2/configure --prefix=${TPDIST} --quiet --enable-shared --disable-dependency-tracking
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${TPSRC}/fftw-3.2.2/configure --prefix=${TPDIST} --quiet --enable-shared --disable-dependency-tracking
)
SET(FFTW_LIBRARY fftw3 CACHE FILEPATH
......
......@@ -80,7 +80,7 @@ namespace Nektar
{
m_expr_id = -1;
std::string msg(std::string("Equation::Equation() fails on expression [") + m_expr + std::string("]\n"));
ASSERTL1(false, msg);
ASSERTL0(false, msg);
throw e;
return;
}
......@@ -88,7 +88,7 @@ namespace Nektar
{
m_expr_id = -1;
std::string msg(std::string("Equation::Equation() fails on expression [") + m_expr + std::string("]\n"));
ASSERTL1(false, msg);
ASSERTL0(false, msg);
throw e;
return;
}
......
......@@ -180,7 +180,10 @@ namespace Nektar
// and determine the full pathname to the file to write out.
// Any existing file/directory which is in the way is removed.
std::string filename = SetUpOutput(outFile);
SetUpFieldMetaData(outFile, fielddefs, fieldmetadatamap);
if (m_comm->GetSize() > 1)
{
SetUpFieldMetaData(outFile, fielddefs, fieldmetadatamap);
}
// Create the file (partition)
TiXmlDocument doc;
......
......@@ -258,6 +258,19 @@ namespace Nektar
}
}
static bool PoolCreated(std::string whichPool)
{
bool value = false;
typename ValueContainerPool::iterator x;
x = m_ValueContainerPool.find(whichPool);
if (x != m_ValueContainerPool.end())
{
value = true;
}
return value;
}
static void EnableManagement(std::string whichPool = "")
{
typename FlagContainerPool::iterator x;
......
......@@ -498,7 +498,8 @@ namespace Nektar
// we find it, set as Dirichlet with the vertex id gId.
if (pIt->first == meshVertId)
{
graph[0][meshVertId] = gId < 0 ? graphVertId++ : gId;
gId = gId < 0 ? graphVertId++ : gId;
graph[0][meshVertId] = gId;
for (i = 0; i < pIt->second.size(); ++i)
{
......@@ -522,7 +523,8 @@ namespace Nektar
if (found)
{
graph[0][pIt->first] = gId < 0 ? graphVertId++ : gId;
gId = gId < 0 ? graphVertId++ : gId;
graph[0][pIt->first] = gId;
for (i = 0; i < pIt->second.size(); ++i)
{
......
......@@ -64,7 +64,38 @@ namespace Nektar
SetCoeffPhys();
}
ContField3DHomogeneous1D::ContField3DHomogeneous1D(
const ContField3DHomogeneous1D &In,
const SpatialDomains::MeshGraphSharedPtr &graph2D,
const std::string &variable):
DisContField3DHomogeneous1D (In, false)
{
ContField2DSharedPtr zero_plane_old =
boost::dynamic_pointer_cast<ContField2D> (In.m_planes[0]);
ContField2DSharedPtr zero_plane =
MemoryManager<ContField2D>::
AllocateSharedPtr(*zero_plane_old,graph2D,
variable);
for(int n = 0; n < m_planes.num_elements(); ++n)
{
m_planes[n] = MemoryManager<ContField2D>::
AllocateSharedPtr(*zero_plane,graph2D,
variable);
}
SetCoeffPhys();
if(variable.compare("DefaultVar") != 0)
{
SpatialDomains::BoundaryConditions bcs(m_session, graph2D);
SetupBoundaryConditions(m_homogeneousBasis->GetBasisKey(),
m_lhom, bcs,variable);
}
}
ContField3DHomogeneous1D::~ContField3DHomogeneous1D()
{
}
......
......@@ -62,6 +62,11 @@ namespace Nektar
/// Copy constructor.
MULTI_REGIONS_EXPORT ContField3DHomogeneous1D(const ContField3DHomogeneous1D &In);
MULTI_REGIONS_EXPORT ContField3DHomogeneous1D(
const ContField3DHomogeneous1D &In,
const SpatialDomains::MeshGraphSharedPtr &graph2D,
const std::string &variable);
/// Destructor.
MULTI_REGIONS_EXPORT virtual ~ContField3DHomogeneous1D();
......
......@@ -761,20 +761,12 @@ namespace Nektar
int planes_offset = 0;
Array<OneD, NekDouble> coeff_tmp;
std::map<int,int>::iterator it;
int IDoffset = 0;
// introduce a 2 plane offset for single mode case so can
// be post-processed or used in MultiMode expansion.
if(m_homogeneousBasis->GetBasisType() == LibUtilities::eFourierSingleMode)
{
IDoffset = 2;
}
// Build map of plane IDs lying on this processor.
std::map<int,int> homoZids;
for (i = 0; i < m_planes.num_elements(); ++i)
{
homoZids[m_transposition->GetPlaneID(i)+IDoffset] = i;
homoZids[m_transposition->GetPlaneID(i)] = i;
}
if(fielddef->m_numHomogeneousDir)
......
......@@ -293,9 +293,14 @@ void DriverAdaptive::v_Execute(ostream &out)
//
// @todo This could be made better by replacing individual matrices
// within the linear system.
LibUtilities::NekManager<MultiRegions::GlobalLinSysKey,
MultiRegions::GlobalLinSys>::
ClearManager(std::string("GlobalLinSys"));
if (LibUtilities::NekManager<MultiRegions::GlobalLinSysKey,
MultiRegions::GlobalLinSys>::
PoolCreated(std::string("GlobalLinSys")))
{
LibUtilities::NekManager<MultiRegions::GlobalLinSysKey,
MultiRegions::GlobalLinSys>::
ClearManager(std::string("GlobalLinSys"));
}
int chkNumber = m_equ[0]->GetCheckpointNumber();
int chkSteps = m_equ[0]->GetCheckpointSteps();
......
......@@ -2267,8 +2267,6 @@ namespace Nektar
else if (m_multipleModes)
{
AddSummaryItem(s, "ModeType", "Multiple Modes");
AddSummaryItem(s, "Selected Mode",
boost::lexical_cast<string>(m_NumMode));
}
}
else if(m_HomogeneousType == eHomogeneous2D)
......
......@@ -549,8 +549,6 @@ namespace Nektar
int m_HomoDirec; ///< number of homogenous directions
int m_NumMode; ///< Mode to use in case of single mode analysis
/// Initialises EquationSystem class members.
SOLVER_UTILS_EXPORT EquationSystem( const LibUtilities::SessionReaderSharedPtr& pSession);
......
......@@ -330,22 +330,18 @@ namespace Nektar
}
// search for NaN and quit if found
bool nanFound = false;
int nanFound = 0;
for (i = 0; i < nvariables; ++i)
{
if (Vmath::Nnan(fields[i].num_elements(), fields[i], 1) > 0)
{
cout << "NaN found in variable \""
<< m_session->GetVariable(i)
<< "\", terminating" << endl;
nanFound = true;
nanFound = 1;
}
}
if (nanFound)
{
break;
}
m_session->GetComm()->AllReduce(nanFound,
LibUtilities::ReduceMax);
ASSERTL0 (!nanFound,
"NaN found during time integration.");
// Update filters
std::vector<FilterSharedPtr>::iterator x;
......
......@@ -54,6 +54,8 @@ if (NEKTAR_BUILD_UTILITIES)
endif()
if (NEKTAR_BUILD_LIBRARY AND DPKG)
set(NEK_DEP "openmpi-bin")
### DEBIAN PACKAGES ############################################
# Note that the formatting of the DESCRIPTION field is VERY specific. It
# must start with a new line, each line must start with a space, and there
......@@ -65,8 +67,9 @@ if (NEKTAR_BUILD_LIBRARY AND DPKG)
DESCRIPTION "
This library provides core routines including linear algebra and integration
with ThirdParty libraries."
DEPENDS "${NEK_DEP}"
INSTALL_LIBS "${libnektar++-utilities_LIBS}")
set(NEK_DEP "libnektar++-utilities (= ${NEKTAR_VERSION})")
set(NEK_DEP "${NEK_DEP}, libnektar++-utilities (= ${NEKTAR_VERSION})")
add_nektar_package(
NAME libnektar++-stdregions
......@@ -473,6 +476,7 @@ set(CPACK_SOURCE_IGNORE_FILES
"/\\\\.gitmodules"
"/build/"
"/builds/"
"/docs/tutorial"
"/ThirdParty/"
"/Testing/"
"/library/Demos/MultiRegions/ExtraDemos/"
......
......@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 2.6)
project("pkg-@PKG_NAME@")
# Files to go in the package
file(READ "targets/install_libs.txt" INSTALL_LIBS_FILES)
file(READ "targets/install_bins.txt" INSTALL_BINS_FILES)
# Put output in builds dir.
set(CPACK_OUTPUT_FILE_PREFIX "../..")
......@@ -78,10 +82,6 @@ if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${ARCHITECTURE}")
endif()
# Files to go in the package
file(READ "targets/install_libs.txt" INSTALL_LIBS_FILES)
file(READ "targets/install_bins.txt" INSTALL_BINS_FILES)
# Install any libraries in the lib directory: exclude OS X, we will copy/patch
# up libraries as we install executables.
if(INSTALL_LIBS_FILES AND NOT APPLE)
......
......@@ -495,77 +495,59 @@ void AdjointAdvection::v_SetBaseFlow(
* coefficient storage.
* @param infile Filename to read.
*/
void AdjointAdvection::ImportFldBase(std::string pInfile,
Array<OneD, MultiRegions::ExpListSharedPtr>& pFields, int slice)
void AdjointAdvection::ImportFldBase(
std::string pInfile,
Array<OneD, MultiRegions::ExpListSharedPtr> &pFields,
int pSlice)
{
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
std::vector<std::vector<NekDouble> > FieldData;
std::vector<std::vector<NekDouble> > FieldData;
int nqtot = pFields[0]->GetTotPoints();
int nqtot = m_baseflow[0].num_elements();
Array<OneD, NekDouble> tmp_coeff(pFields[0]->GetNcoeffs(), 0.0);
//Get Homogeneous
LibUtilities::FieldIOSharedPtr fld =
MemoryManager<LibUtilities::FieldIO>::AllocateSharedPtr(
m_session->GetComm());
fld->Import(pInfile, FieldDef, FieldData);
int numexp = pFields[0]->GetExpSize();
Array<OneD,int> ElementGIDs(numexp);
int nvar = m_session->GetVariables().size();
int s;
// Define list of global element ids
for(int i = 0; i < numexp; ++i)
{
ElementGIDs[i] = pFields[0]->GetExp(i)->GetGeom()->GetGlobalID();
}
if(m_session->DefinesSolverInfo("HOMOGENEOUS"))
LibUtilities::FieldIOSharedPtr fld =
MemoryManager<LibUtilities::FieldIO>::AllocateSharedPtr(
m_session->GetComm());
fld->Import(pInfile, FieldDef, FieldData,
LibUtilities::NullFieldMetaDataMap,
ElementGIDs);
int nSessionVar = m_session->GetVariables().size();
int nSessionConvVar = nSessionVar - 1;
int nFileVar = FieldDef[0]->m_fields.size();
int nFileConvVar = nFileVar - 1; // Ignore pressure
if (m_HalfMode)
{
std::string HomoStr = m_session->GetSolverInfo("HOMOGENEOUS");
ASSERTL0(nFileVar == 3, "For half mode, expect 2D2C base flow.");
nFileConvVar = 2;
}
// copy FieldData into m_fields
for(int j = 0; j < nvar; ++j)
for(int j = 0; j < nFileConvVar; ++j)
{
for(int i = 0; i < FieldDef.size(); ++i)
{
if ((m_session->DefinesSolverInfo("HOMOGENEOUS") &&
(m_session->GetSolverInfo("HOMOGENEOUS")=="HOMOGENEOUS1D" ||
m_session->GetSolverInfo("HOMOGENEOUS")=="1D" ||
m_session->GetSolverInfo("HOMOGENEOUS")=="Homo1D")) &&
nvar==4)
{
// w-component must be ignored and set to zero.
if (j != nvar - 2)
{
// p component (it is 4th variable of the 3D and corresponds 3nd variable of 2D)
s = (j == nvar - 1) ? 2 : j;
//extraction of the 2D
pFields[j]->ExtractDataToCoeffs(
FieldDef[i],
FieldData[i],
FieldDef[i]->m_fields[s],
tmp_coeff);
}
// Put zero on higher modes
int ncplane = (pFields[0]->GetNcoeffs()) / m_npointsZ;
if (m_npointsZ > 2)
{
Vmath::Zero(ncplane*(m_npointsZ-2),
&tmp_coeff[2*ncplane],1);
}
}
//2D cases and Homogeneous1D Base Flows
else
{
bool flag = FieldDef[i]->m_fields[j] ==
m_session->GetVariable(j);
ASSERTL0(flag, (std::string("Order of ") + pInfile
+ std::string(" data and that defined in "
"m_boundaryconditions differs")).c_str());
pFields[j]->ExtractDataToCoeffs(FieldDef[i], FieldData[i],
FieldDef[i]->m_fields[j],
tmp_coeff);
}
bool flag = FieldDef[i]->m_fields[j] ==
m_session->GetVariable(j);
ASSERTL0(flag, (std::string("Order of ") + pInfile
+ std::string(" data and that defined in "
"the session file differs")).c_str());
pFields[j]->ExtractDataToCoeffs(
FieldDef[i],
FieldData[i],
FieldDef[i]->m_fields[j],
tmp_coeff);
}
if(m_SingleMode || m_HalfMode)
......@@ -574,26 +556,33 @@ void AdjointAdvection::ImportFldBase(std::string pInfile,
if(m_SingleMode)
{
//copy the bwd into the second plane for single Mode Analysis
//copy the bwd trans into the second plane for single
//Mode Analysis
int ncplane=(pFields[0]->GetNpoints())/m_npointsZ;
Vmath::Vcopy(ncplane,&m_baseflow[j][0],1,&m_baseflow[j][ncplane],1);
}
}
else
else // fully 3D base flow - put in physical space.
{
bool oldwavespace = pFields[j]->GetWaveSpace();
pFields[j]->SetWaveSpace(false);
pFields[j]->BwdTrans(tmp_coeff, m_baseflow[j]);
pFields[j]->SetWaveSpace(oldwavespace);
}
}
// Zero unused fields (e.g. w in a 2D2C base flow).
for (int j = nFileConvVar; j < nSessionConvVar; ++j) {
Vmath::Fill(nqtot, 0.0, m_baseflow[j], 1);
}
// If time-periodic, put loaded data into the slice storage.
if(m_session->DefinesParameter("N_slices"))
{
int n = pFields.num_elements()-1;
for(int i=0; i<n;++i)
for(int i = 0; i < nSessionConvVar; ++i)
{
Vmath::Vcopy(nqtot, &m_baseflow[i][0], 1, &m_interp[i][slice*nqtot], 1);
Vmath::Vcopy(nqtot, &m_baseflow[i][0], 1, &m_interp[i][pSlice*nqtot], 1);
}
}
}
......
......@@ -355,32 +355,31 @@ void LinearisedAdvection::v_Advect(
fields[0]->PhysDeriv(m_baseflow[1],
grad_base_v0, grad_base_v1);
}
else if(m_singleMode) // single mode where d/dz = 0
{
fields[0]->PhysDeriv(m_baseflow[0], grad_base_u0,
grad_base_u1);
fields[0]->PhysDeriv(m_baseflow[1], grad_base_v0,
grad_base_v1);
fields[0]->PhysDeriv(m_baseflow[2], grad_base_w0,
grad_base_w1);
}
else if(m_multipleModes)
{
// Differentiate base flow in physical space
bool oldwavespace = fields[0]->GetWaveSpace();
fields[0]->SetWaveSpace(false);
fields[0]->PhysDeriv(m_baseflow[0], grad_base_u0,
grad_base_u1, grad_base_u2);
fields[0]->PhysDeriv(m_baseflow[1], grad_base_v0,
grad_base_v1, grad_base_v2);
fields[0]->PhysDeriv(m_baseflow[2], grad_base_w0,
grad_base_w1, grad_base_w2);
fields[0]->SetWaveSpace(oldwavespace);
}
else
{
if(m_multipleModes)
{
// Differentiate base flow in physical space
bool oldwavespace = fields[0]->GetWaveSpace();
fields[0]->SetWaveSpace(false);
fields[0]->PhysDeriv(m_baseflow[0], grad_base_u0,
grad_base_u1, grad_base_u2);
fields[0]->PhysDeriv(m_baseflow[1], grad_base_v0,
grad_base_v1, grad_base_v2);
fields[0]->PhysDeriv(m_baseflow[2], grad_base_w0,
grad_base_w1, grad_base_w2);
fields[0]->SetWaveSpace(oldwavespace);
}
else // has to be single mode where d/dz = 0
{
fields[0]->PhysDeriv(m_baseflow[0], grad_base_u0,
grad_base_u1);
fields[0]->PhysDeriv(m_baseflow[1], grad_base_v0,
grad_base_v1);
fields[0]->PhysDeriv(m_baseflow[2], grad_base_w0,
grad_base_w1);
}
ASSERTL0(false, "ERROR: Must be one of half, single or multiple modes");
}
//x-equation
......@@ -390,7 +389,7 @@ void LinearisedAdvection::v_Advect(
if(m_multipleModes)
{
fields[0]->PhysDeriv(inarray[0], grad0, grad1, grad2);
// transform gradients into physical fouier space
// transform gradients into physical Fourier space
fields[0]->HomogeneousBwdTrans(grad0, grad0);
fields[0]->HomogeneousBwdTrans(grad1, grad1);
fields[0]->HomogeneousBwdTrans(grad2, grad2);
......@@ -406,6 +405,7 @@ void LinearisedAdvection::v_Advect(
fields[0]->PhysDeriv(inarray[0], grad0, grad1, grad2);
}
}
//Evaluate: U du'/dx
Vmath::Vmul (nPointsTot, grad0, 1, m_baseflow[0], 1,
outarray[0], 1);
......@@ -514,7 +514,7 @@ void LinearisedAdvection::v_Advect(
Vmath::Vvtvp(nPointsTot, grad1, 1, m_baseflow[1], 1,
outarray[2], 1, outarray[2], 1);
if(!m_halfMode)// if halfmode W = 0
if(!m_halfMode) // since if halfmode W = 0
{
//Evaluate u' dW/dx
Vmath::Vvtvp(nPointsTot,grad_base_w0,1,advVel[0],1,
......@@ -572,17 +572,18 @@ void LinearisedAdvection::v_SetBaseFlow(
* Import field from infile and load into \a m_fields. This routine will
* also perform a \a BwdTrans to ensure data is in both the physical and
* coefficient storage.
* @param infile Filename to read.
* @param pInFile Filename to read.
* @param pFields Array of expansion lists
*/
void LinearisedAdvection::ImportFldBase(std::string pInfile,
Array<OneD, MultiRegions::ExpListSharedPtr>& pFields, int slice)
void LinearisedAdvection::ImportFldBase(
std::string pInfile,
Array<OneD, MultiRegions::ExpListSharedPtr> &pFields,
int pSlice)
{
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
std::vector<std::vector<NekDouble> > FieldData;
std::vector<std::vector<NekDouble> > FieldData;
int nqtot = m_baseflow[0].num_elements();
int nvar = m_session->GetVariables().size();
int s;
Array<OneD, NekDouble> tmp_coeff(pFields[0]->GetNcoeffs(), 0.0);
int numexp = pFields[0]->GetExpSize();
......@@ -594,7 +595,6 @@ void LinearisedAdvection::ImportFldBase(std::string pInfile,
ElementGIDs[i] = pFields[0]->GetExp(i)->GetGeom()->GetGlobalID();
}
//Get Homogeneous
LibUtilities::FieldIOSharedPtr fld =
MemoryManager<LibUtilities::FieldIO>::AllocateSharedPtr(
m_session->GetComm());
......@@ -602,72 +602,36 @@ void LinearisedAdvection::ImportFldBase(std::string pInfile,
LibUtilities::NullFieldMetaDataMap,
ElementGIDs);