Commit a565a5dc authored by Chris Cantwell's avatar Chris Cantwell

Addressed comments from review.

parent 0d77f09f
Pipeline #1043 passed with stages
......@@ -52,6 +52,8 @@ project. It's a pretty simple process:
- Did you add regression tests (for fixes) or unit tests and/or normal tests for
new features?
- Have you run your branch through buildbot and do all the tests pass?
- Have you fixed any compiler warnings your code has introduced into the
compilation step on any of the Linux buildbots?
- Is there documentation in the user guide and/or developer guide?
- Have you added a CHANGELOG entry, including the MR number?
- Are there any massive files you might have added in the commit history? We try
......@@ -110,15 +112,23 @@ You should also test your branch on the
the code against a number of Linux, Mac and Windows operating systems, both 32-
and 64-bit. If your tests don't pass, we can't merge the code into master.
Testing is presently manually executed. You should:
1. Go to the buildbot site and navigate to the *Builders* page.
2. Scroll to the bottom of the page in the section *Force all builds*
3. Enter your details. If you're working on a fork, then the *Suffix to repo
url* box should be changed to `username/nektar`.
4. Hit the *Force build* button.
5. Check the output in the *Grid* page -- hopefully everything should be green!
Tests can take up to two hours to run.
When you submit a merge request testing on buildbot will happen automatically,
unless you have marked the merge request as a work-in-progress (WIP: prefix).
Each time you push commits to a non-WIP merge request branch, it will also
trigger a build.
For WIP merge request branches, you can force a build on individual builders
using the buildbot web interface:
1. Go to the buildbot site and log in using the drop-down menu (top right).
2. Go to the console display and select the builder from the column headings on
which you would like to force test.
3. Select 'Force' from the top-right of the page.
4. Enter the details as required. If you're working on a fork, then the *Fork*
box should be changed to `username/nektar`.
5. Hit the *Start build* button.
6. Return to the *console* display to see progress. You can click on the
flashing indicator for your active build to see progress and output.
## Documentation
Nektar++ has a fairly comprehensive user guide and a developer guide that is
......
......@@ -29,7 +29,7 @@ IF (THIRDPARTY_BUILD_CCMIO)
FIND_PROGRAM(PATCH patch)
IF(NOT PATCH)
MESSAGE(FATAL_ERROR
"'patch' tool for modifying files not found. Cannot build CCN.")
"'patch' tool for modifying files not found. Cannot build CCM.")
ENDIF()
MARK_AS_ADVANCED(PATCH)
......
......@@ -211,16 +211,6 @@ ThreadStartupManager::ThreadStartupManager() : m_type("Threading starting up")
}
/**
* @brief ThreadDefaultManager copy constructor
*/
ThreadStartupManager::ThreadStartupManager(const ThreadStartupManager& src)
: m_type(src.m_type)
{
// empty
}
/**
*
*/
......
......@@ -382,7 +382,7 @@ class ThreadStartupManager: public ThreadManager
{
public:
ThreadStartupManager();
ThreadStartupManager(const ThreadStartupManager& src);
ThreadStartupManager(const ThreadStartupManager& src) = default;
virtual ~ThreadStartupManager();
virtual void QueueJobs(std::vector<ThreadJob*>& joblist);
virtual void QueueJob(ThreadJob* job);
......
......@@ -36,19 +36,20 @@
namespace Nektar
{
namespace LibUtilities
{
PointsManagerT &PointsManager(void)
{
static PointsManagerT instance;
return instance;
}
namespace LibUtilities
{
PointsManagerT &PointsManager(void)
{
static PointsManagerT instance;
return instance;
}
BasisManagerT &BasisManager(void)
{
static BasisManagerT instance;
return instance;
}
BasisManagerT &BasisManager(void)
{
static BasisManagerT instance;
return instance;
}
} // end of namespace LibUtilities
} // end of namespace LibUtilities
} // end of namespace Nektar
......@@ -160,9 +160,7 @@ public:
template<typename... Args>
static std::shared_ptr<DataType> AllocateSharedPtr(const Args &...args)
{
return AllocateSharedPtrD([](DataType * ptr){
boost::ignore_unused(ptr);
}, args...);
return AllocateSharedPtrD( [](DataType *){}, args...);
}
template<typename DeallocatorType, typename... Args>
......
......@@ -63,7 +63,7 @@ namespace Nektar
const SpatialDomains::HexGeomSharedPtr &geom):
StdExpansion (Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(),3,Ba,Bb,Bc),
StdExpansion3D(Ba.GetNumModes()*Bb.GetNumModes()*Bc.GetNumModes(),Ba,Bb,Bc),
StdRegions::StdHexExp(Ba,Bb,Bc),
StdHexExp(Ba,Bb,Bc),
Expansion (geom),
Expansion3D (geom),
m_matrixManager(
......@@ -84,7 +84,7 @@ namespace Nektar
HexExp::HexExp(const HexExp &T):
StdExpansion(T),
StdExpansion3D(T),
StdRegions::StdHexExp(T),
StdHexExp(T),
Expansion(T),
Expansion3D(T),
m_matrixManager(T.m_matrixManager),
......
......@@ -71,7 +71,7 @@ namespace Nektar
PrismExp::PrismExp(const PrismExp &T):
StdExpansion(T),
StdExpansion3D(T),
StdRegions::StdPrismExp(T),
StdPrismExp(T),
Expansion(T),
Expansion3D(T),
m_matrixManager(T.m_matrixManager),
......
......@@ -71,7 +71,7 @@ namespace Nektar
LibUtilities::StdTetData::getNumberOfCoefficients(
Ba.GetNumModes(), Bb.GetNumModes(), Bc.GetNumModes()),
Ba, Bb, Bc),
StdRegions::StdTetExp(Ba,Bb,Bc),
StdTetExp(Ba,Bb,Bc),
Expansion (geom),
Expansion3D (geom),
m_matrixManager(
......@@ -88,8 +88,8 @@ namespace Nektar
* \brief Copy Constructor
*/
TetExp::TetExp(const TetExp &T):
StdExpansion(T),
StdExpansion3D(T),
StdRegions::StdExpansion(T),
StdRegions::StdExpansion3D(T),
StdRegions::StdTetExp(T),
Expansion(T),
Expansion3D(T),
......
......@@ -50,11 +50,11 @@ class OptiObj
OptiObj()
{
};
}
virtual ~OptiObj()
{
};
}
virtual NekDouble F(Array<OneD, NekDouble> xitst)
{
......@@ -62,7 +62,7 @@ class OptiObj
NEKERROR(ErrorUtil::efatal,
"F() should be implemented in inheriting class");
return 0.0;
};
}
virtual DNekMat dF(Array<OneD, NekDouble> xitst)
{
......@@ -70,35 +70,35 @@ class OptiObj
NEKERROR(ErrorUtil::efatal,
"dF() should be implemented in inheriting class");
return DNekMat(1,1,0.0);
};
}
virtual Array<OneD, NekDouble> Getxi()
{
NEKERROR(ErrorUtil::efatal,
"Getxi() should be implemented in inheriting class");
return Array<OneD,NekDouble>();
};
}
virtual Array<OneD, NekDouble> Getli()
{
NEKERROR(ErrorUtil::efatal,
"Getli() should be implemented in inheriting class");
return Array<OneD,NekDouble>();
};
}
virtual Array<OneD, NekDouble> Getui()
{
NEKERROR(ErrorUtil::efatal,
"Getui() should be implemented in inheriting class");
return Array<OneD,NekDouble>();
};
}
virtual void Update(Array<OneD, NekDouble> xinew)
{
boost::ignore_unused(xinew);
NEKERROR(ErrorUtil::efatal,
"Update() should be implemented in inheriting class");
};
}
};
typedef std::shared_ptr<OptiObj> OptiObjSharedPtr;
......
......@@ -61,15 +61,6 @@ namespace Nektar
}
/* StdHexExp::StdHexExp(const LibUtilities::BasisKey &Ba,
const LibUtilities::BasisKey &Bb,
const LibUtilities::BasisKey &Bc,
NekDouble *coeffs,
NekDouble *phys)
{
}
*/
StdHexExp::StdHexExp(const StdHexExp &T):
StdExpansion(T),
StdExpansion3D(T)
......
......@@ -53,12 +53,6 @@ namespace Nektar
const LibUtilities::BasisKey &Ba,
const LibUtilities::BasisKey &Bb,
const LibUtilities::BasisKey &Bc);
/* STD_REGIONS_EXPORT StdHexExp(
const LibUtilities::BasisKey &Ba,
const LibUtilities::BasisKey &Bb,
const LibUtilities::BasisKey &Bc,
NekDouble *coeffs,
NekDouble *phys);*/
STD_REGIONS_EXPORT StdHexExp(const StdHexExp &T);
STD_REGIONS_EXPORT ~StdHexExp();
......
......@@ -66,9 +66,9 @@ namespace Nektar
* @param hvf Computed Riemann flux for y-momentum component
*/
void AverageSolver::v_PointSolve(
double hL, double huL, double hvL,
double hR, double huR, double hvR,
double &hf, double &huf, double &hvf)
NekDouble hL, NekDouble huL, NekDouble hvL,
NekDouble hR, NekDouble huR, NekDouble hvR,
NekDouble &hf, NekDouble &huf, NekDouble &hvf)
{
static NekDouble g = m_params["gravity"]();
......
......@@ -57,9 +57,9 @@ namespace Nektar
AverageSolver(const LibUtilities::SessionReaderSharedPtr& pSession);
virtual void v_PointSolve(
double hL, double huL, double hvL,
double hR, double huR, double hvR,
double &hf, double &huf, double &hvf);
NekDouble hL, NekDouble huL, NekDouble hvL,
NekDouble hR, NekDouble huR, NekDouble hvR,
NekDouble &hf, NekDouble &huf, NekDouble &hvf);
};
}
......
......@@ -62,83 +62,85 @@ namespace Nektar
* @param hvf Computed Riemann flux for y-momentum component
*/
void HLLCSolver::v_PointSolve(
double hL, double huL, double hvL,
double hR, double huR, double hvR,
double &hf, double &huf, double &hvf)
NekDouble hL, NekDouble huL, NekDouble hvL,
NekDouble hR, NekDouble huR, NekDouble hvR,
NekDouble &hf, NekDouble &huf, NekDouble &hvf)
{
static NekDouble g = m_params["gravity"]();
// Left and Right velocities
NekDouble uL = huL / hL;
NekDouble vL = hvL / hL;
NekDouble uR = huR / hR;
NekDouble uR = huR / hR;
NekDouble vR = hvR / hR;
// Left and right wave speeds
NekDouble cL = sqrt(g * hL);
NekDouble cR = sqrt(g * hR);
NekDouble cL = sqrt(g * hL);
NekDouble cR = sqrt(g * hR);
// the two-rarefaction wave assumption
NekDouble hC,huC,hvC,SL,SR,hstar,ustar,Sstar;
hstar = 0.5*(cL + cR) + 0.25*(uL - uR);
hstar *= hstar;
hstar *= (1.0/g);
ustar = 0.5*(uL + uR) + cL - cR;
// the two-rarefaction wave assumption
NekDouble hC,huC,hvC,SL,SR,hstar,ustar,Sstar;
hstar = 0.5*(cL + cR) + 0.25*(uL - uR);
hstar *= hstar;
hstar *= (1.0/g);
ustar = 0.5*(uL + uR) + cL - cR;
// Compute SL
if (hstar > hL)
SL = uL - cL * sqrt(0.5*((hstar*hstar + hstar*hL)/(hL*hL)));
else
SL = uL - cL;
// Compute SL
if (hstar > hL)
SL = uL - cL * sqrt(0.5*((hstar*hstar + hstar*hL)/(hL*hL)));
else
SL = uL - cL;
// Compute SR
if (hstar > hR)
SR = uR + cR * sqrt(0.5*((hstar*hstar + hstar*hR)/(hR*hR)));
else
SR = uR + cR;
// Compute SR
if (hstar > hR)
SR = uR + cR * sqrt(0.5*((hstar*hstar + hstar*hR)/(hR*hR)));
else
SR = uR + cR;
if (fabs(hR*(uR-SR)-hL*(uL-SL)) <= 1.0e-10)
Sstar = ustar;
else
Sstar = (SL*hR*(uR-SR)-SR*hL*(uL-SL))/(hR*(uR-SR)-hL*(uL-SL));
if (fabs(hR*(uR-SR)-hL*(uL-SL)) <= 1.0e-10)
Sstar = ustar;
else
Sstar = (SL*hR*(uR-SR)-SR*hL*(uL-SL))/(hR*(uR-SR)-hL*(uL-SL));
if (SL >= 0)
{
hf = hL * uL;
huf = uL * uL * hL + 0.5 * g * hL * hL;
hvf = hL * uL * vL;
}
else if (SR <= 0)
{
hf = hR * uR;
huf = uR * uR * hR + 0.5 * g * hR * hR;
hvf = hR * uR *vR;
}
else if ((SL < 0) && (Sstar >= 0))
{
hC = hL * ((SL - uL) / (SL - Sstar));
huC = hC * Sstar;
hvC = hC * vL;
hf = hL*uL + SL * (hC - hL);
huf = (uL*uL*hL+0.5*g*hL*hL) + SL * (huC - hL*uL);
hvf = (uL*vL*hL) + SL * (hvC - hL*vL);
}
else if ((SR > 0) && (Sstar <= 0))
{
hC = hR * ((SR - uR) / (SR - Sstar));
huC = hC * Sstar;
hvC = hC * vR;
hf = hR*uR + SR * (hC - hR);
huf = (uR*uR*hR+0.5*g*hR*hR) + SR * (huC - hR*uR);
hvf = (uR*vR*hR) + SR * (hvC - hR*vR);
}
else
{
ASSERTL0(false,"Error in HLLC solver -- non physical combination of SR, SL and Sstar");
}
if (SL >= 0)
{
hf = hL * uL;
huf = uL * uL * hL + 0.5 * g * hL * hL;
hvf = hL * uL * vL;
}
else if (SR <= 0)
{
hf = hR * uR;
huf = uR * uR * hR + 0.5 * g * hR * hR;
hvf = hR * uR *vR;
}
else if ((SL < 0) && (Sstar >= 0))
{
hC = hL * ((SL - uL) / (SL - Sstar));
huC = hC * Sstar;
hvC = hC * vL;
hf = hL*uL + SL * (hC - hL);
huf = (uL*uL*hL+0.5*g*hL*hL) + SL * (huC - hL*uL);
hvf = (uL*vL*hL) + SL * (hvC - hL*vL);
}
else if ((SR > 0) && (Sstar <= 0))
{
hC = hR * ((SR - uR) / (SR - Sstar));
huC = hC * Sstar;
hvC = hC * vR;
hf = hR*uR + SR * (hC - hR);
huf = (uR*uR*hR+0.5*g*hR*hR) + SR * (huC - hR*uR);
hvf = (uR*vR*hR) + SR * (hvC - hR*vR);
}
else
{
NEKERROR(ErrorUtil::efatal,
"Error in HLLC solver -- non physical combination of "
"SR, SL and Sstar");
}
}
}
......@@ -55,9 +55,9 @@ namespace Nektar
HLLCSolver(const LibUtilities::SessionReaderSharedPtr& pSession);
virtual void v_PointSolve(
double hL, double huL, double hvL,
double hR, double huR, double hvR,
double &hf, double &huf, double &hvf);
NekDouble hL, NekDouble huL, NekDouble hvL,
NekDouble hR, NekDouble huR, NekDouble hvR,
NekDouble &hf, NekDouble &huf, NekDouble &hvf);
};
}
......
......@@ -63,68 +63,68 @@ namespace Nektar
* @param hvf Computed Riemann flux for y-momentum component
*/
void HLLSolver::v_PointSolve(
double hL, double huL, double hvL,
double hR, double huR, double hvR,
double &hf, double &huf, double &hvf)
NekDouble hL, NekDouble huL, NekDouble hvL,
NekDouble hR, NekDouble huR, NekDouble hvR,
NekDouble &hf, NekDouble &huf, NekDouble &hvf)
{
static NekDouble g = m_params["gravity"]();
// Left and Right velocities
NekDouble uL = huL / hL;
NekDouble vL = hvL / hL;
NekDouble uR = huR / hR;
NekDouble uR = huR / hR;
NekDouble vR = hvR / hR;
// Left and right wave speeds
NekDouble cL = sqrt(g * hL);
NekDouble cR = sqrt(g * hR);
NekDouble cL = sqrt(g * hL);
NekDouble cR = sqrt(g * hR);
// the two-rarefaction wave assumption
NekDouble hstar,fL,fR;
hstar = 0.5 * (cL + cR) + 0.25 * (uL - uR);
hstar *= hstar;
hstar *= (1.0/g);
// the two-rarefaction wave assumption
NekDouble hstar,fL,fR;
hstar = 0.5 * (cL + cR) + 0.25 * (uL - uR);
hstar *= hstar;
hstar *= (1.0/g);
// Compute SL
NekDouble SL;
if (hstar > hL)
SL = uL - cL * sqrt(0.5*((hstar*hstar + hstar*hL)/(hL*hL)));
else
SL = uL - cL;
// Compute SL
NekDouble SL;
if (hstar > hL)
SL = uL - cL * sqrt(0.5*((hstar*hstar + hstar*hL)/(hL*hL)));
else
SL = uL - cL;
// Compute SR
NekDouble SR;
if (hstar > hR)
SR = uR + cR * sqrt(0.5*((hstar*hstar + hstar*hR)/(hR*hR)));
else
SR = uR + cR;
// Compute SR
NekDouble SR;
if (hstar > hR)
SR = uR + cR * sqrt(0.5*((hstar*hstar + hstar*hR)/(hR*hR)));
else
SR = uR + cR;
if (SL >= 0)
{
hf = hL * uL;
huf = uL * uL * hL + 0.5 * g * hL * hL;
hvf = hL * uL * vL;
}
else if (SR <= 0)
{
hf = hR * uR;
huf = uR * uR * hR + 0.5 * g * hR * hR;
hvf = hR * uR *vR;
}
else
{
hf = (SR * hL * uL - SL * hR * uR +
SL * SR * (hR - hL)) / (SR - SL);
fL = uL * uL * hL + 0.5 * g * hL * hL;
fR = uR * uR * hR + 0.5 * g * hR * hR;
huf =(SR * fL - SL * fR +
SL * SR * (hR * uR - hL * uL)) / (SR - SL);
fL = uL * vL * hL;
fR = uR * vR * hR;
hvf =(SR * fL - SL * fR +
SL * SR * (hR * vR - hL * vL)) / (SR - SL);
}
if (SL >= 0)
{
hf = hL * uL;
huf = uL * uL * hL + 0.5 * g * hL * hL;
hvf = hL * uL * vL;
}
else if (SR <= 0)
{
hf = hR * uR;
huf = uR * uR * hR + 0.5 * g * hR * hR;
hvf = hR * uR *vR;
}
else
{
hf = (SR * hL * uL - SL * hR * uR +
SL * SR * (hR - hL)) / (SR - SL);
fL = uL * uL * hL + 0.5 * g * hL * hL;
fR = uR * uR * hR + 0.5 * g * hR * hR;
huf =(SR * fL - SL * fR +
SL * SR * (hR * uR - hL * uL)) / (SR - SL);
fL = uL * vL * hL;
fR = uR * vR * hR;
hvf =(SR * fL - SL * fR +
SL * SR * (hR * vR - hL * vL)) / (SR - SL);
}
}
}
......@@ -55,9 +55,9 @@ namespace Nektar
HLLSolver(const LibUtilities::SessionReaderSharedPtr& pSession);
virtual void v_PointSolve(
double hL, double huL, double hvL,
double hR, double huR, double hvR,
double &hf, double &huf, double &hvf);
NekDouble hL, NekDouble huL, NekDouble hvL,
NekDouble hR, NekDouble huR, NekDouble hvR,
NekDouble &hf, NekDouble &huf, NekDouble &hvf);
};
}
......
......@@ -63,21 +63,21 @@ namespace Nektar
* @param hvf Computed Riemann flux for y-momentum component
*/
void LaxFriedrichsSolver::v_PointSolve(
double hL, double huL, double hvL,
double hR, double huR, double hvR,
double &hf, double &huf, double &hvf)
NekDouble hL, NekDouble huL, NekDouble hvL,
NekDouble hR, NekDouble huR, NekDouble hvR,
NekDouble &hf, NekDouble &huf, NekDouble &hvf)
{
static NekDouble g = m_params["gravity"]();
// Left and right velocities
NekDouble uL = huL / hL;
NekDouble vL = hvL / hL;
NekDouble uR = huR / hR;
NekDouble uR = huR / hR;
NekDouble vR = hvR / hR;
// Left and right wave speeds
NekDouble cL = sqrt(g * hL);
NekDouble cR = sqrt(g * hR);
// Left and right wave speeds
NekDouble cL = sqrt(g * hL);
NekDouble cR = sqrt(g * hR);
// Square root of hL and hR.
NekDouble srL = sqrt(hL);
......@@ -86,7 +86,7 @@ namespace Nektar
// Velocity Roe averages
NekDouble uRoe = (srL * uL + srR * uR) / srLR;
NekDouble cRoe = sqrt(0.5 * (cL * cL + cR * cR));
NekDouble cRoe = sqrt(0.5 * (cL * cL + cR * cR));
// Minimum and maximum wave speeds
NekDouble S = std::max(uRoe+cRoe, std::max(uR+cR, -(uL-cL)));
......@@ -102,7 +102,7 @@ namespace Nektar
// Lax-Friedrichs Riemann hu flux
huf = 0.5 * ((hL * uL * uL + 0.5 * g * hL * hL +
hR * uR * uR + 0.5 * g * hR * hR) -