Commit 56d14b50 authored by Sergey Yakovlev's avatar Sergey Yakovlev

Changed TimingCGHelmSolve2D

Also added SetSolveInfo to SessionReader
Need to change HDG timing in 2D and adjust scripts accordingly
parent c00066a1
...@@ -57,9 +57,11 @@ int main(int argc, char *argv[]) ...@@ -57,9 +57,11 @@ int main(int argc, char *argv[])
if (vComm->GetRank() == 0) if (vComm->GetRank() == 0)
{ {
cout << "Solving 2D Helmholtz:" << endl; cout << "Solving 2D Helmholtz: " << endl;
cout << " Lambda : " << factors[StdRegions::eFactorLambda] << endl; cout << " Communication: " << vSession->GetComm()->GetType() << endl;
cout << " No. modes : " << bkey0.GetNumModes() << endl; cout << " Solver type : " << vSession->GetSolverInfo("GlobalSysSoln") << endl;
cout << " Lambda : " << factors[StdRegions::eFactorLambda] << endl;
cout << " No. modes : " << bkey0.GetNumModes() << endl;
cout << endl; cout << endl;
} }
......
...@@ -57,10 +57,18 @@ int main(int argc, char *argv[]) ...@@ -57,10 +57,18 @@ int main(int argc, char *argv[])
if (vComm->GetRank() == 0) if (vComm->GetRank() == 0)
{ {
cout << "Solving 3D Helmholtz:" << endl; cout << "Solving 3D Helmholtz:" << endl;
cout << " Lambda : " << factors[StdRegions::eFactorLambda] << endl; cout << " - Communication: "
cout << " No. modes : " << bkey0.GetNumModes() << endl; << vSession->GetComm()->GetType() << " ("
cout << endl; << vSession->GetComm()->GetSize()
<< " processes)" << endl;
cout << " - Solver type : "
<< vSession->GetSolverInfo("GlobalSysSoln") << endl;
cout << " - Lambda : "
<< factors[StdRegions::eFactorLambda] << endl;
cout << " - No. modes : "
<< bkey0.GetNumModes() << endl;
cout << endl;
} }
//---------------------------------------------- //----------------------------------------------
......
...@@ -669,6 +669,20 @@ namespace Nektar ...@@ -669,6 +669,20 @@ namespace Nektar
return iter->second; return iter->second;
} }
/**
*
*/
void SessionReader::SetSolverInfo(
const std::string &pProperty, const std::string &pValue)
{
std::string vProperty = boost::to_upper_copy(pProperty);
SolverInfoMap::iterator iter = m_solverInfo.find(vProperty);
ASSERTL1(iter != m_solverInfo.end(),
"Unable to find requested property: " + pProperty);
iter->second = pValue;
}
/** /**
* *
......
...@@ -227,6 +227,9 @@ namespace Nektar ...@@ -227,6 +227,9 @@ namespace Nektar
/// Returns the value of the specified solver info property. /// Returns the value of the specified solver info property.
LIB_UTILITIES_EXPORT const std::string& GetSolverInfo( LIB_UTILITIES_EXPORT const std::string& GetSolverInfo(
const std::string &pProperty) const; const std::string &pProperty) const;
/// Sets the value of the specified solver info property.
LIB_UTILITIES_EXPORT void SetSolverInfo(
const std::string &pProperty, const std::string &pValue);
/// Returns the value of the specified solver info property as enum /// Returns the value of the specified solver info property as enum
template<typename T> template<typename T>
inline const T GetSolverInfoAsEnum(const std::string &pName) const; inline const T GetSolverInfoAsEnum(const std::string &pName) const;
......
...@@ -86,7 +86,7 @@ namespace Nektar ...@@ -86,7 +86,7 @@ namespace Nektar
const std::string &variable, const std::string &variable,
const bool SetUpJustDG, const bool SetUpJustDG,
const bool DeclareCoeffPhysArrays) const bool DeclareCoeffPhysArrays)
: ExpList2D(pSession, graph2D, DeclareCoeffPhysArrays), : ExpList2D(pSession,graph2D,DeclareCoeffPhysArrays,variable),
m_bndCondExpansions(), m_bndCondExpansions(),
m_bndConditions(), m_bndConditions(),
m_trace(NullExpListSharedPtr), m_trace(NullExpListSharedPtr),
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<CONDITIONS> <CONDITIONS>
<PARAMETERS> <PARAMETERS>
<P> w = 3 </P>
<P> Lambda = 1 </P> <P> Lambda = 1 </P>
</PARAMETERS> </PARAMETERS>
...@@ -12,15 +13,22 @@ ...@@ -12,15 +13,22 @@
<!--These composites must be defined in the geometry file.--> <!--These composites must be defined in the geometry file.-->
<BOUNDARYREGIONS> <BOUNDARYREGIONS>
<B ID="0"> C[1-4] </B>
<!--
<B ID="0"> C[1] </B> <B ID="0"> C[1] </B>
<B ID="1"> C[2] </B> <B ID="1"> C[2] </B>
<B ID="2"> C[3] </B> <B ID="2"> C[3] </B>
<B ID="3"> C[4] </B> <B ID="3"> C[4] </B>
-->
</BOUNDARYREGIONS> </BOUNDARYREGIONS>
<!--The region numbers below correspond to the regions specified in the <!--The region numbers below correspond to the regions specified in the
BoundaryRegion definition above.--> BoundaryRegion definition above.-->
<BOUNDARYCONDITIONS> <BOUNDARYCONDITIONS>
<REGION REF="0">
<D VAR="u" VALUE="sin(w*PI*x)*sin(w*PI*y)" />
</REGION>
<!--
<REGION REF="0"> <REGION REF="0">
<D VAR="u" VALUE="sin(PI*x)*sin(PI*y)" /> <D VAR="u" VALUE="sin(PI*x)*sin(PI*y)" />
</REGION> </REGION>
...@@ -33,14 +41,15 @@ ...@@ -33,14 +41,15 @@
<REGION REF="3"> <REGION REF="3">
<D VAR="u" VALUE="sin(PI*x)*sin(PI*y)" /> <D VAR="u" VALUE="sin(PI*x)*sin(PI*y)" />
</REGION> </REGION>
-->
</BOUNDARYCONDITIONS> </BOUNDARYCONDITIONS>
<FUNCTION NAME="Forcing"> <FUNCTION NAME="Forcing">
<E VAR="u" VALUE="-(Lambda + 2*PI*PI)*sin(PI*x)*sin(PI*y)" /> <E VAR="u" VALUE="-(Lambda + 2*w*w*PI*PI)*sin(PI*x)*sin(PI*y)" />
</FUNCTION> </FUNCTION>
<FUNCTION NAME="ExactSolution"> <FUNCTION NAME="ExactSolution">
<E VAR="u" VALUE="sin(PI*x)*sin(PI*y)" /> <E VAR="u" VALUE="sin(w*PI*x)*sin(w*PI*y)" />
</FUNCTION> </FUNCTION>
......
This diff is collapsed.
...@@ -201,10 +201,7 @@ int main(int argc, char *argv[]) ...@@ -201,10 +201,7 @@ int main(int argc, char *argv[])
// Define forcing function for first variable defined in file // Define forcing function for first variable defined in file
fce = Array<OneD,NekDouble>(nq); fce = Array<OneD,NekDouble>(nq);
LibUtilities::EquationSharedPtr ffunc = vSession->GetFunction("Forcing",0); LibUtilities::EquationSharedPtr ffunc = vSession->GetFunction("Forcing",0);
for(i = 0; i < nq; ++i) ffunc->Evaluate(xc0,xc1,xc2,fce);
{
fce[i] = ffunc->Evaluate(xc0[i],xc1[i],xc2[i]);
}
//---------------------------------------------- //----------------------------------------------
//---------------------------------------------- //----------------------------------------------
...@@ -236,20 +233,15 @@ int main(int argc, char *argv[]) ...@@ -236,20 +233,15 @@ int main(int argc, char *argv[])
//---------------------------------------------- //----------------------------------------------
// evaluate exact solution // evaluate exact solution
sol = Array<OneD,NekDouble>(nq); sol = Array<OneD,NekDouble>(nq);
for(i = 0; i < nq; ++i) ex_sol->Evaluate(xc0,xc1,xc2,sol);
{
sol[i] = ex_sol->Evaluate(xc0[i],xc1[i],xc2[i]);
}
//---------------------------------------------- //----------------------------------------------
//-------------------------------------------- //--------------------------------------------
// Calculate L_inf error // Calculate L_inf error
Sol = MemoryManager<MultiRegions::ContField3D>::AllocateSharedPtr(*Exp); Sol = MemoryManager<MultiRegions::ContField3D>::AllocateSharedPtr(*Exp);
Sol->SetPhys(sol);
Sol->SetPhysState(true);
NekDouble L2Error = Exp->L2 (Sol->GetPhys()); NekDouble L2Error = Exp->L2 (sol);
NekDouble LinfError = Exp->Linf(Sol->GetPhys()); NekDouble LinfError = Exp->Linf(sol);
//-------------------------------------------- //--------------------------------------------
// alternative error calculation // alternative error calculation
const LibUtilities::PointsKey PkeyT1(30,LibUtilities::eGaussLobattoLegendre); const LibUtilities::PointsKey PkeyT1(30,LibUtilities::eGaussLobattoLegendre);
...@@ -292,10 +284,7 @@ int main(int argc, char *argv[]) ...@@ -292,10 +284,7 @@ int main(int argc, char *argv[])
// evaluate exact solution // evaluate exact solution
Array<OneD,NekDouble> ErrorSol(ErrorNq); Array<OneD,NekDouble> ErrorSol(ErrorNq);
for(i = 0; i < ErrorNq; ++i) ex_sol->Evaluate(ErrorXc0,ErrorXc1,ErrorXc2,ErrorSol);
{
ErrorSol[i] = ex_sol->Evaluate(ErrorXc0[i],ErrorXc1[i],ErrorXc2[i]);
}
// calcualte spectral/hp approximation on the quad points of this new // calcualte spectral/hp approximation on the quad points of this new
// expansion basis // expansion basis
......
...@@ -205,10 +205,7 @@ int main(int argc, char *argv[]) ...@@ -205,10 +205,7 @@ int main(int argc, char *argv[])
// Define forcing function for first variable defined in file // Define forcing function for first variable defined in file
fce = Array<OneD,NekDouble>(nq); fce = Array<OneD,NekDouble>(nq);
LibUtilities::EquationSharedPtr ffunc = vSession->GetFunction("Forcing",0); LibUtilities::EquationSharedPtr ffunc = vSession->GetFunction("Forcing",0);
for(i = 0; i < nq; ++i) ffunc->Evaluate(xc0,xc1,xc2,fce);
{
fce[i] = ffunc->Evaluate(xc0[i],xc1[i],xc2[i]);
}
//---------------------------------------------- //----------------------------------------------
//---------------------------------------------- //----------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment