Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Friends | List of all members
Nektar::SolverUtils::ForcingProgrammatic Class Reference

#include <ForcingProgrammatic.h>

Inheritance diagram for Nektar::SolverUtils::ForcingProgrammatic:
Inheritance graph
[legend]
Collaboration diagram for Nektar::SolverUtils::ForcingProgrammatic:
Collaboration graph
[legend]

Public Member Functions

SOLVER_UTILS_EXPORT Array
< OneD, Array< OneD, NekDouble > > & 
UpdateForces ()
- Public Member Functions inherited from Nektar::SolverUtils::Forcing
SOLVER_UTILS_EXPORT void InitObject (const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
 Initialise the forcing object.
SOLVER_UTILS_EXPORT void Apply (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time)
 Apply the forcing.

Static Public Member Functions

static SOLVER_UTILS_EXPORT
ForcingSharedPtr 
create (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
 Creates an instance of this class.
- Static Public Member Functions inherited from Nektar::SolverUtils::Forcing
static SOLVER_UTILS_EXPORT
std::vector< ForcingSharedPtr
Load (const LibUtilities::SessionReaderSharedPtr &pSession, const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields=0)

Static Public Attributes

static std::string className
 Name of the class.

Protected Member Functions

virtual SOLVER_UTILS_EXPORT void v_InitObject (const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
virtual SOLVER_UTILS_EXPORT void v_Apply (const Array< OneD, MultiRegions::ExpListSharedPtr > &fields, const Array< OneD, Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble &time)
- Protected Member Functions inherited from Nektar::SolverUtils::Forcing
SOLVER_UTILS_EXPORT Forcing (const LibUtilities::SessionReaderSharedPtr &)
 Constructor.
void EvaluateFunction (Array< OneD, MultiRegions::ExpListSharedPtr > pFields, LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))
void EvaluateTimeFunction (LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))

Private Member Functions

 ForcingProgrammatic (const LibUtilities::SessionReaderSharedPtr &pSession)

Friends

class MemoryManager< ForcingProgrammatic >

Additional Inherited Members

- Protected Attributes inherited from Nektar::SolverUtils::Forcing
LibUtilities::SessionReaderSharedPtr m_session
 Session reader.
Array< OneD, Array< OneD,
NekDouble > > 
m_Forcing
 Evaluated forcing function.
int m_NumVariable
 Number of variables.

Detailed Description

Definition at line 57 of file ForcingProgrammatic.h.

Constructor & Destructor Documentation

Nektar::SolverUtils::ForcingProgrammatic::ForcingProgrammatic ( const LibUtilities::SessionReaderSharedPtr pSession)
private

Definition at line 48 of file ForcingProgrammatic.cpp.

: Forcing(pSession)
{
}

Member Function Documentation

static SOLVER_UTILS_EXPORT ForcingSharedPtr Nektar::SolverUtils::ForcingProgrammatic::create ( const LibUtilities::SessionReaderSharedPtr pSession,
const Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const unsigned int &  pNumForcingFields,
const TiXmlElement *  pForce 
)
inlinestatic

Creates an instance of this class.

Definition at line 64 of file ForcingProgrammatic.h.

References Nektar::SolverUtils::ForcingSharedPtr.

{
p->InitObject(pFields, pNumForcingFields, pForce);
return p;
}
Array< OneD, Array< OneD, NekDouble > > & Nektar::SolverUtils::ForcingProgrammatic::UpdateForces ( )

Definition at line 54 of file ForcingProgrammatic.cpp.

References Nektar::SolverUtils::Forcing::m_Forcing.

{
return m_Forcing;
}
void Nektar::SolverUtils::ForcingProgrammatic::v_Apply ( const Array< OneD, MultiRegions::ExpListSharedPtr > &  fields,
const Array< OneD, Array< OneD, NekDouble > > &  inarray,
Array< OneD, Array< OneD, NekDouble > > &  outarray,
const NekDouble time 
)
protectedvirtual

Implements Nektar::SolverUtils::Forcing.

Definition at line 74 of file ForcingProgrammatic.cpp.

References Nektar::SolverUtils::Forcing::m_Forcing, Nektar::SolverUtils::Forcing::m_NumVariable, and Vmath::Vadd().

{
for (int i = 0; i < m_NumVariable; i++)
{
Vmath::Vadd(outarray[i].num_elements(), outarray[i], 1,
m_Forcing[i], 1, outarray[i], 1);
}
}
void Nektar::SolverUtils::ForcingProgrammatic::v_InitObject ( const Array< OneD, MultiRegions::ExpListSharedPtr > &  pFields,
const unsigned int &  pNumForcingFields,
const TiXmlElement *  pForce 
)
protectedvirtual

Implements Nektar::SolverUtils::Forcing.

Definition at line 59 of file ForcingProgrammatic.cpp.

References Nektar::SolverUtils::Forcing::m_Forcing, and Nektar::SolverUtils::Forcing::m_NumVariable.

{
m_NumVariable = pNumForcingFields;
int nq = pFields[0]->GetTotPoints();
m_Forcing = Array<OneD, Array<OneD, NekDouble> > (m_NumVariable);
for (int i = 0; i < m_NumVariable; ++i)
{
m_Forcing[i] = Array<OneD, NekDouble> (nq, 0.0);
}
}

Friends And Related Function Documentation

friend class MemoryManager< ForcingProgrammatic >
friend

Definition at line 61 of file ForcingProgrammatic.h.

Member Data Documentation

std::string Nektar::SolverUtils::ForcingProgrammatic::className
static
Initial value:
RegisterCreatorFunction("Programmatic",
"Programmatic Forcing")

Name of the class.

Definition at line 77 of file ForcingProgrammatic.h.