Commit 11ca4edd authored by Spencer Sherwin's avatar Spencer Sherwin
Browse files

Merge branch 'master' into feature/MeshConvertFullStarInput

parents d0fe0698 69f2992c
......@@ -8,27 +8,28 @@
#If the user has not set BOOST_ROOT, look in a couple common places first.
MESSAGE(STATUS "Searching for Boost:")
SET(MIN_VER "1.52.0")
SET(NEEDED_BOOST_LIBS thread iostreams date_time filesystem system
program_options regex timer)
SET(Boost_DEBUG 0)
SET(Boost_NO_BOOST_CMAKE ON)
IF( BOOST_ROOT )
SET(Boost_NO_SYSTEM_PATHS ON)
FIND_PACKAGE( Boost COMPONENTS ${NEEDED_BOOST_LIBS})
FIND_PACKAGE( Boost ${MIN_VER} COMPONENTS ${NEEDED_BOOST_LIBS})
ELSE ()
SET(TEST_ENV1 $ENV{BOOST_HOME})
SET(TEST_ENV2 $ENV{BOOST_DIR})
IF (DEFINED TEST_ENV1)
SET(BOOST_ROOT $ENV{BOOST_HOME})
SET(Boost_NO_SYSTEM_PATHS ON)
FIND_PACKAGE( Boost QUIET COMPONENTS ${NEEDED_BOOST_LIBS} )
FIND_PACKAGE( Boost ${MIN_VER} QUIET COMPONENTS ${NEEDED_BOOST_LIBS} )
ELSEIF (DEFINED TEST_ENV2)
SET(BOOST_ROOT $ENV{BOOST_DIR})
SET(Boost_NO_SYSTEM_PATHS ON)
FIND_PACKAGE( Boost QUIET COMPONENTS ${NEEDED_BOOST_LIBS} )
FIND_PACKAGE( Boost ${MIN_VER} QUIET COMPONENTS ${NEEDED_BOOST_LIBS} )
ELSE ()
SET(BOOST_ROOT ${TPDIST})
FIND_PACKAGE( Boost QUIET COMPONENTS ${NEEDED_BOOST_LIBS} )
FIND_PACKAGE( Boost ${MIN_VER} QUIET COMPONENTS ${NEEDED_BOOST_LIBS} )
ENDIF()
ENDIF()
......@@ -148,7 +149,7 @@ IF (THIRDPARTY_BUILD_BOOST)
IF (APPLE)
EXTERNALPROJECT_ADD_STEP(boost patch-install-path
COMMAND sed -i ".bak" "s|-install_name \"|&${TPDIST}/lib/|" ${TPBUILD}/boost/tools/build/v2/tools/darwin.jam
COMMAND sed -i ".bak" "s|-install_name \"|&${TPDIST}/lib/|" ${TPBUILD}/boost/tools/build/src/tools/darwin.jam
DEPENDERS build
DEPENDEES download)
ENDIF (APPLE)
......
......@@ -62,7 +62,7 @@ BLAS & \cmark & \cmark & \cmark & & Or MKL,
ACML, OpenBLAS
\\
LAPACK & \cmark & \cmark & \cmark & & \\
Boost $>1.49$ & \cmark & \cmark & \cmark & \cmark & Compile
Boost $>=1.52$ & \cmark & \cmark & \cmark & \cmark & Compile
with iostreams
\\
ModMETIS & \cmark & & & \cmark & \\
......@@ -218,7 +218,7 @@ BLAS & \cmark & & & & Part of
Xcode \\
LAPACK & \cmark & & & & Part of
Xcode \\
Boost $>1.49$ & \cmark & \texttt{boost} & \cmark & \cmark & Compile
Boost $>=1.52$ & \cmark & \texttt{boost} & \cmark & \cmark & Compile
with iostreams \\
TinyXML & \cmark & \texttt{tinyxml} & \cmark & \cmark & \\
ModMETIS & \cmark & & & \cmark & \\
......
......@@ -1327,12 +1327,7 @@ namespace Nektar
for (i = 0; i < m_bndCondExpansions.num_elements(); ++i)
{
if (time == 0.0 || m_bndConditions[i]->GetUserDefined() ==
SpatialDomains::eTimeDependent ||
m_bndConditions[i]->GetUserDefined() ==
SpatialDomains::eQinflow ||
m_bndConditions[i]->GetUserDefined() ==
SpatialDomains::eRCRterminal )
if (time == 0.0 || m_bndConditions[i]->IsTimeDependent())
{
m_bndCondExpansions[i]->GetCoords(x0, x1, x2);
......
......@@ -643,23 +643,25 @@ namespace Nektar
locExpList = MemoryManager<MultiRegions::ExpList1D>
::AllocateSharedPtr(m_session, *(it->second), graph2D,
DeclareCoeffPhysArrays, variable);
// Set up normals on non-Dirichlet boundary conditions
if(bc->GetBoundaryConditionType() !=
SpatialDomains::eDirichlet)
{
SetUpPhysNormals();
}
m_bndCondExpansions[cnt] = locExpList;
m_bndConditions[cnt] = bc;
SpatialDomains::BndUserDefinedType type =
m_bndConditions[cnt++]->GetUserDefined();
if (type == SpatialDomains::eI ||
type == SpatialDomains::eCalcBC)
std::string type = m_bndConditions[cnt]->GetUserDefined();
// Set up normals on non-Dirichlet boundary
// conditions. Second two conditions ideally
// should be in local solver setup (when made into factory)
if((bc->GetBoundaryConditionType() !=
SpatialDomains::eDirichlet)||
boost::iequals(type,"I") ||
boost::iequals(type,"CalcBC"))
{
SetUpPhysNormals();
}
cnt++;
}
}
}
......@@ -2140,8 +2142,7 @@ namespace Nektar
for (i = 0; i < nbnd; ++i)
{
if (time == 0.0 ||
m_bndConditions[i]->GetUserDefined() ==
SpatialDomains::eTimeDependent)
m_bndConditions[i]->IsTimeDependent())
{
locExpList = m_bndCondExpansions[i];
npoints = locExpList->GetNpoints();
......@@ -2253,8 +2254,8 @@ namespace Nektar
ASSERTL0(false, "This type of BC not implemented yet");
}
}
else if (m_bndConditions[i]->GetUserDefined()
== SpatialDomains::eMovingBody)
else if (boost::iequals(m_bndConditions[i]->GetUserDefined(),
"MovingBody"))
{
locExpList = m_bndCondExpansions[i];
if (m_bndConditions[i]->GetBoundaryConditionType()
......
......@@ -2438,8 +2438,7 @@
for (i = 0; i < nbnd; ++i)
{
if (time == 0.0 || m_bndConditions[i]->GetUserDefined() ==
SpatialDomains::eTimeDependent)
if (time == 0.0 || m_bndConditions[i]->IsTimeDependent())
{
locExpList = m_bndCondExpansions[i];
npoints = locExpList->GetNpoints();
......
......@@ -249,11 +249,9 @@ namespace Nektar
for (n = 0; n < m_bndCondExpansions.num_elements(); ++n)
{
if (time == 0.0 ||
m_bndConditions[n]->GetUserDefined()
== SpatialDomains::eTimeDependent ||
m_bndConditions[n]->GetUserDefined()
== SpatialDomains::eMovingBody)
m_bndConditions[n]->IsTimeDependent() ||
boost::iequals(m_bndConditions[n]->GetUserDefined(),
"MovingBody"))
{
m_bndCondExpansions[n]->HomogeneousFwdTrans(
m_bndCondExpansions[n]->GetCoeffs(),
......
......@@ -196,8 +196,7 @@ namespace Nektar
// Fourier transform coefficient space boundary values
for (n = 0; n < m_bndCondExpansions.num_elements(); ++n)
{
if (time == 0.0 || m_bndConditions[n]->GetUserDefined() ==
SpatialDomains::eTimeDependent)
if (time == 0.0 || m_bndConditions[n]->IsTimeDependent())
{
m_bndCondExpansions[n]->HomogeneousFwdTrans(
m_bndCondExpansions[n]->GetCoeffs(),
......
......@@ -1024,13 +1024,13 @@ namespace Nektar
//HalfMode
if(m_homogeneousBasis->GetBasisType() == LibUtilities::eFourierHalfModeRe)
{
beta = 2*M_PI*(m_transposition->GetK(0))/m_lhom;
beta = 2*sign*M_PI*(m_transposition->GetK(0))/m_lhom;
Vmath::Smul(nP_pts,beta,temparray,1,outarray,1);
}
else if(m_homogeneousBasis->GetBasisType() == LibUtilities::eFourierHalfModeIm)
{
beta = -2*M_PI*(m_transposition->GetK(0))/m_lhom;
beta = -2*sign*M_PI*(m_transposition->GetK(0))/m_lhom;
Vmath::Smul(nP_pts,beta,temparray,1,outarray,1);
}
......
......@@ -326,9 +326,8 @@ namespace Nektar
GetBndCondTraceToGlobalTraceMap(cnt++));
// Reinforcing bcs for velocity in case of Wall bcs
if (fields[i]->GetBndConditions()[j]->
GetUserDefined() ==
SpatialDomains::eWallViscous)
if (boost::iequals(fields[i]->GetBndConditions()[j]->
GetUserDefined(),"WallViscous"))
{
Vmath::Zero(nBndEdgePts,
&scalarVariables[i][id2], 1);
......@@ -406,9 +405,8 @@ namespace Nektar
GetBndCondTraceToGlobalTraceMap(cnt++));
// Imposing Temperature Twall at the wall
if (fields[i]->GetBndConditions()[j]->
GetUserDefined() ==
SpatialDomains::eWallViscous)
if (boost::iequals(fields[i]->GetBndConditions()[j]->
GetUserDefined(),"WallViscous"))
{
Vmath::Vcopy(nBndEdgePts,
&Tw[0], 1,
......
......@@ -1342,9 +1342,8 @@ namespace Nektar
GetBndCondTraceToGlobalTraceMap(cnt++));
// Reinforcing bcs for velocity in case of Wall bcs
if (fields[i]->GetBndConditions()[j]->
GetUserDefined() ==
SpatialDomains::eWallViscous)
if (boost::iequals(fields[i]->GetBndConditions()[j]->
GetUserDefined(),"WallViscous"))
{
Vmath::Zero(nBndEdgePts,
&scalarVariables[i][id2], 1);
......@@ -1424,9 +1423,8 @@ namespace Nektar
GetBndCondTraceToGlobalTraceMap(cnt++));
// Imposing Temperature Twall at the wall
if (fields[i]->GetBndConditions()[j]->
GetUserDefined() ==
SpatialDomains::eWallViscous)
if (boost::iequals(fields[i]->GetBndConditions()[j]->
GetUserDefined(),"WallViscous"))
{
Vmath::Vcopy(nBndEdgePts,
&Tw[0], 1,
......
......@@ -374,16 +374,17 @@ namespace Nektar
m_session->GetVariable(i),
m_checkIfSystemSingular[i]);
}
m_fields[i] = MemoryManager<MultiRegions
::ContField3DHomogeneous1D>
::AllocateSharedPtr(
m_session, BkeyZR, m_LhomZ,
m_useFFT, m_homogen_dealiasing,
m_graph,
m_session->GetVariable(i),
m_checkIfSystemSingular[i]);
else
{
m_fields[i] = MemoryManager<MultiRegions
::ContField3DHomogeneous1D>
::AllocateSharedPtr(
m_session, BkeyZR, m_LhomZ,
m_useFFT, m_homogen_dealiasing,
m_graph,
m_session->GetVariable(i),
m_checkIfSystemSingular[i]);
}
}
......
......@@ -188,10 +188,11 @@ namespace Nektar
// Check type.
std::string conditionType = conditionElement->Value();
std::string attrData;
bool isTimeDependent = false;
// All have var specified, or else all variables are zero.
TiXmlAttribute *attr = conditionElement->FirstAttribute();
std::vector<std::string>::iterator iter;
std::string attrName;
......@@ -200,9 +201,11 @@ namespace Nektar
if (!attrData.empty())
{
iter = std::find(vars.begin(), vars.end(), attrData);
ASSERTL0(iter != vars.end(), (std::string("Cannot find variable: ") + attrData).c_str());
ASSERTL0(iter != vars.end(),
(std::string("Cannot find variable: ")
+ attrData).c_str());
}
if (conditionType == "N")
{
if (attrData.empty())
......@@ -211,7 +214,7 @@ namespace Nektar
for (std::vector<std::string>::iterator varIter = vars.begin();
varIter != vars.end(); ++varIter)
{
BoundaryConditionShPtr neumannCondition(MemoryManager<NeumannBoundaryCondition>::AllocateSharedPtr(m_session,"00.0"));
BoundaryConditionShPtr neumannCondition(MemoryManager<NeumannBoundaryCondition>::AllocateSharedPtr(m_session,"0.0"));
(*boundaryConditions)[*varIter] = neumannCondition;
}
}
......@@ -231,22 +234,21 @@ namespace Nektar
if (attrName=="USERDEFINEDTYPE")
{
// Do stuff for the user defined attribute
attrData = attr->Value();
ASSERTL0(!attrData.empty(), "USERDEFINEDTYPE attribute must have associated value.");
ASSERTL0(!attrData.empty(),
"USERDEFINEDTYPE attribute must have associated value.");
// Suppose to go here?
m_session->SubstituteExpressions(attrData);
userDefined = attrData;
}
isTimeDependent = boost::iequals(attrData,"TimeDependent");
}
else if(attrName=="VALUE")
{
ASSERTL0(attrName == "VALUE", (std::string("Unknown attribute: ") + attrName).c_str());
attrData = attr->Value();
ASSERTL0(!attrData.empty(), "VALUE attribute must be specified.");
ASSERTL0(!attrData.empty(),
"VALUE attribute must be specified.");
m_session->SubstituteExpressions(attrData);
......@@ -254,24 +256,29 @@ namespace Nektar
}
else if(attrName=="FILE")
{
ASSERTL0(attrName == "FILE", (std::string("Unknown attribute: ") + attrName).c_str());
attrData = attr->Value();
ASSERTL0(!attrData.empty(), "FILE attribute must be specified.");
m_session->SubstituteExpressions(attrData);
filename = attrData;
}
attr = attr->Next();
}
else
{
ASSERTL0(false,
(std::string("Unknown boundary condition attribute: ") + attrName).c_str());
}
attr = attr->Next();
}
BoundaryConditionShPtr neumannCondition(MemoryManager<NeumannBoundaryCondition>::AllocateSharedPtr(m_session, equation, userDefined, filename));
neumannCondition->SetIsTimeDependent(isTimeDependent);
(*boundaryConditions)[*iter] = neumannCondition;
}
else
{
// This variable's condition is zero.
BoundaryConditionShPtr neumannCondition(MemoryManager<NeumannBoundaryCondition>::AllocateSharedPtr(m_session, "0"));
BoundaryConditionShPtr neumannCondition(MemoryManager<NeumannBoundaryCondition>::AllocateSharedPtr(m_session, "0.0"));
(*boundaryConditions)[*iter] = neumannCondition;
}
}
......@@ -297,46 +304,49 @@ namespace Nektar
{
std::string equation, userDefined, filename;
while(attr) {
while(attr)
{
attrName = attr->Name();
if (attrName=="USERDEFINEDTYPE") {
// Do stuff for the user defined attribute
attrData = attr->Value();
ASSERTL0(!attrData.empty(), "USERDEFINEDTYPE attribute must have associated value.");
m_session->SubstituteExpressions(attrData);
userDefined = attrData;
}
else if(attrName=="VALUE")
{
ASSERTL0(attrName == "VALUE", (std::string("Unknown attribute: ") + attrName).c_str());
attrData = attr->Value();
ASSERTL0(!attrData.empty(), "VALUE attribute must have associated value.");
m_session->SubstituteExpressions(attrData);
equation = attrData;
}
else if(attrName=="FILE")
{
ASSERTL0(attrName == "FILE", (std::string("Unknown attribute: ") + attrName).c_str());
if (attrName=="USERDEFINEDTYPE") {
// Do stuff for the user defined attribute
attrData = attr->Value();
ASSERTL0(!attrData.empty(), "USERDEFINEDTYPE attribute must have associated value.");
m_session->SubstituteExpressions(attrData);
userDefined = attrData;
isTimeDependent = boost::iequals(attrData,"TimeDependent");
}
else if(attrName=="VALUE")
{
attrData = attr->Value();
ASSERTL0(!attrData.empty(), "VALUE attribute must have associated value.");
m_session->SubstituteExpressions(attrData);
equation = attrData;
}
else if(attrName=="FILE")
{
attrData = attr->Value();
ASSERTL0(!attrData.empty(), "FILE attribute must be specified.");
m_session->SubstituteExpressions(attrData);
filename = attrData;
}
}
else
{
ASSERTL0(false,
(std::string("Unknown boundary condition attribute: ") + attrName).c_str());
}
attr = attr->Next();
}
BoundaryConditionShPtr dirichletCondition(MemoryManager<DirichletBoundaryCondition>::AllocateSharedPtr(m_session, equation, userDefined, filename));
dirichletCondition->SetIsTimeDependent(isTimeDependent);
(*boundaryConditions)[*iter] = dirichletCondition;
}
else
......@@ -372,62 +382,61 @@ namespace Nektar
std::string attrData1;
std::string equation1, equation2, userDefined;
std::string filename;
while(attr){
attrName1 = attr->Name();
if (attrName1=="USERDEFINEDTYPE") {
// Do stuff for the user defined attribute
attrData1 = attr->Value();
ASSERTL0(!attrData1.empty(), "USERDEFINEDTYPE attribute must have associated value.");
m_session->SubstituteExpressions(attrData1);
userDefined = attrData1;
}
else if(attrName1 == "VALUE"){
ASSERTL0(attrName1 == "VALUE", (std::string("Unknown attribute: ") + attrName1).c_str());
attrData1 = attr->Value();
ASSERTL0(!attrData1.empty(), "VALUE attributes must have associated values.");
m_session->SubstituteExpressions(attrData1);
equation1 = attrData1;
attr = attr->Next();
ASSERTL0(attr, "Unable to read PRIMCOEFF attribute.");
attrName1= attr->Name();
ASSERTL0(attrName1 == "PRIMCOEFF", (std::string("Unknown attribute: ") + attrName1).c_str());
attrData1 = attr->Value();
ASSERTL0(!attrData1.empty(), "PRIMCOEFF attributes must have associated values.");
m_session->SubstituteExpressions(attrData1);
equation2 = attrData1;
}
else if(attrName1=="FILE")
{
ASSERTL0(attrName1 == "FILE", (std::string("Unknown attribute: ") + attrName1).c_str());
attrData1 = attr->Value();
ASSERTL0(!attrData1.empty(), "FILE attribute must be specified.");
m_session->SubstituteExpressions(attrData1);
filename = attrData1;
}
attr = attr->Next();
attrName1 = attr->Name();
if (attrName1=="USERDEFINEDTYPE") {
// Do stuff for the user defined attribute
attrData1 = attr->Value();
ASSERTL0(!attrData1.empty(), "USERDEFINEDTYPE attribute must have associated value.");
m_session->SubstituteExpressions(attrData1);
userDefined = attrData1;
isTimeDependent = boost::iequals(attrData,"TimeDependent");
}
else if(attrName1 == "VALUE"){
attrData1 = attr->Value();
ASSERTL0(!attrData1.empty(), "VALUE attributes must have associated values.");
m_session->SubstituteExpressions(attrData1);
equation1 = attrData1;
attr = attr->Next();
ASSERTL0(attr, "Unable to read PRIMCOEFF attribute.");
attrName1= attr->Name();
ASSERTL0(attrName1 == "PRIMCOEFF", (std::string("Unknown attribute: ") + attrName1).c_str());
attrData1 = attr->Value();
ASSERTL0(!attrData1.empty(), "PRIMCOEFF attributes must have associated values.");
m_session->SubstituteExpressions(attrData1);
equation2 = attrData1;
}
else if(attrName1=="FILE")
{
attrData1 = attr->Value();
ASSERTL0(!attrData1.empty(), "FILE attribute must be specified.");
m_session->SubstituteExpressions(attrData1);
filename = attrData1;
}
else
{
ASSERTL0(false, (std::string("Unknown boundary condition attribute: ") + attrName1).c_str());
}
attr = attr->Next();
}
BoundaryConditionShPtr robinCondition(MemoryManager<RobinBoundaryCondition>::AllocateSharedPtr(m_session, equation1, equation2, userDefined, filename));
(*boundaryConditions)[*iter] = robinCondition;
}
......@@ -435,6 +444,7 @@ namespace Nektar
{
// This variable's condition is zero.
BoundaryConditionShPtr robinCondition(MemoryManager<RobinBoundaryCondition>::AllocateSharedPtr(m_session, "0", "0"));
robinCondition->SetIsTimeDependent(isTimeDependent);
(*boundaryConditions)[*iter] = robinCondition;
}
}
......
......@@ -59,115 +59,16 @@ namespace Nektar
eNotDefined
};
enum BndUserDefinedType
{
eI,
eMG,
eHigh,
eHighOutflow,
eWall_Forces,
eWall,
eWallViscous,
eArtificialViscosity,
eSymmetry,
eRinglebFlow,
eTimeDependent,
eMovingBody,
eRadiation,
eIsentropicVortex,
eCalcBC,