47 "Dummy Equation System that only sends/receives fields");
68 if (
m_session->DefinesElement(
"Nektar/Coupling"))
70 TiXmlElement *vCoupling =
m_session->GetElement(
"Nektar/Coupling");
72 ASSERTL0(vCoupling->Attribute(
"TYPE"),
73 "Missing TYPE attribute in Coupling");
74 string vType = vCoupling->Attribute(
"TYPE");
76 "TYPE attribute must be non-empty in Coupling");
81 for (
auto const &sendVar :
m_coupling->GetSendFieldNames())
83 auto match =
find(sV.begin(), sV.end(), sendVar);
84 if (match != sV.end())
86 int id = distance(sV.begin(), match);
107 int numForceFields = 0;
110 numForceFields += x->GetForces().size();
112 vector<string> varNames;
115 for (
int i = 0; i <
m_fields.size(); ++i)
117 varNames.push_back(
m_session->GetVariable(i));
118 phys[i] =
m_fields[i]->UpdatePhys();
124 for (
int i = 0; i < x->GetForces().size(); ++i)
126 phys[
m_fields.size() + f + i] = x->GetForces()[i];
127 varNames.push_back(
"F_" + boost::lexical_cast<string>(f) +
"_" +
151 for (
auto const &sendVar :
m_coupling->GetSendFieldNames())
153 auto match =
find(sV.begin(), sV.end(), sendVar);
154 if (match != sV.end())
156 int id = distance(sV.begin(), match);
163 if (
m_session->DefinesCmdLineArgument(
"verbose"))
165 cout <<
"Field evaluation time: " << timer1.
TimePerTest(1) << endl;
169 for (
int i = 0; i <
m_session->GetVariables().size(); ++i)
192 for (
int i = 0; i < x->GetForces().size(); ++i)
198 for (
int j = 0; j < npts; ++j)
200 l2err += x->GetForces()[i][j] * x->GetForces()[i][j];
201 linferr = max(linferr, fabs(x->GetForces()[i][j]));
211 if (
m_comm->TreatAsRankZero())
213 cout <<
"L 2 error (variable "
214 <<
"F_" + boost::lexical_cast<string>(f) +
"_" +
216 <<
") : " << l2err << endl;
218 cout <<
"L inf error (variable "
219 <<
"F_" + boost::lexical_cast<string>(f) +
"_" +
221 <<
") : " << linferr << endl;
235 int nVariables = inarray.size();
238 for (
int i = 0; i < nVariables; ++i)
253 int nvariables = inarray.size();
257 if (inarray != outarray)
259 for (
int i = 0; i < nvariables; ++i)
#define ASSERTL0(condition, msg)
bool v_PreIntegrate(int step) override
v_PreIntegrate
SolverUtils::CouplingSharedPtr m_coupling
static EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
~Dummy() override
Destructor.
bool v_PostIntegrate(int step) override
v_PostIntegrate
std::vector< SolverUtils::ForcingSharedPtr > m_forcing
Dummy(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Initialises UnsteadySystem class members.
static std::string className
Name of class.
void DoOdeProjection(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the projection and call the method for imposing the boundary conditions in case of discontinu...
void DoOdeRhs(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time)
Compute the right-hand side.
void v_InitObject(bool DeclareFields=true) override
Initialization object for the Dummy class.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
void DefineProjection(FuncPointerT func, ObjectPointerT obj)
void DefineOdeRhs(FuncPointerT func, ObjectPointerT obj)
NekDouble TimePerTest(unsigned int n)
Returns amount of seconds per iteration in a test with n iterations.
LibUtilities::CommSharedPtr m_comm
Communicator.
NekDouble m_time
Current time of simulation.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
LibUtilities::SessionReaderSharedPtr m_session
The session reader.
SOLVER_UTILS_EXPORT SessionFunctionSharedPtr GetFunction(std::string name, const MultiRegions::ExpListSharedPtr &field=MultiRegions::NullExpListSharedPtr, bool cache=false)
Get a SessionFunction by name.
SOLVER_UTILS_EXPORT int GetTotPoints()
virtual SOLVER_UTILS_EXPORT void v_Output(void)
static SOLVER_UTILS_EXPORT std::vector< ForcingSharedPtr > Load(const LibUtilities::SessionReaderSharedPtr &pSession, const std::weak_ptr< EquationSystem > &pEquation, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields=0)
Base class for unsteady solvers.
LibUtilities::TimeIntegrationSchemeOperators m_ode
The time integration scheme operators to use.
virtual SOLVER_UTILS_EXPORT bool v_PostIntegrate(int step)
virtual SOLVER_UTILS_EXPORT bool v_PreIntegrate(int step)
std::vector< int > m_intVariables
SOLVER_UTILS_EXPORT void v_InitObject(bool DeclareField=true) override
Init object for UnsteadySystem class.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
CouplingFactory & GetCouplingFactory()
Declaration of the Coupling factory singleton.
EquationSystemFactory & GetEquationSystemFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
void Zero(int n, T *x, const int incx)
Zero vector.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
scalarT< T > sqrt(scalarT< T > in)