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
virtual SOLVER_UTILS_EXPORT ~Forcing ()
 
SOLVER_UTILS_EXPORT void InitObject (const Array< OneD, MultiRegions::ExpListSharedPtr > &pFields, const unsigned int &pNumForcingFields, const TiXmlElement *pForce)
 Initialise the forcing object. More...
 
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. More...
 

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. More...
 
- 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. More...
 

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. More...
 
SOLVER_UTILS_EXPORT 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))
 
SOLVER_UTILS_EXPORT void EvaluateTimeFunction (LibUtilities::SessionReaderSharedPtr pSession, std::string pFieldName, Array< OneD, NekDouble > &pArray, const std::string &pFunctionName, NekDouble pTime=NekDouble(0))
 
SOLVER_UTILS_EXPORT void EvaluateTimeFunction (const NekDouble pTime, const LibUtilities::EquationSharedPtr &pEqn, Array< OneD, NekDouble > &pArray)
 

Private Member Functions

 ForcingProgrammatic (const LibUtilities::SessionReaderSharedPtr &pSession)
 
virtual ~ForcingProgrammatic (void)
 

Friends

class MemoryManager< ForcingProgrammatic >
 

Additional Inherited Members

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

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.

50  : Forcing(pSession)
51  {
52  }
SOLVER_UTILS_EXPORT Forcing(const LibUtilities::SessionReaderSharedPtr &)
Constructor.
Definition: Forcing.cpp:51
virtual Nektar::SolverUtils::ForcingProgrammatic::~ForcingProgrammatic ( void  )
inlineprivatevirtual

Definition at line 96 of file ForcingProgrammatic.h.

96 {};

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::MemoryManager< DataType >::AllocateSharedPtr(), and Nektar::SolverUtils::ForcingSharedPtr.

69  {
71  AllocateSharedPtr(pSession);
72  p->InitObject(pFields, pNumForcingFields, pForce);
73  return p;
74  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
SOLVER_UTILS_EXPORT typedef boost::shared_ptr< Forcing > ForcingSharedPtr
A shared pointer to an EquationSystem object.
Definition: Forcing.h:51
Array< OneD, Array< OneD, NekDouble > > & Nektar::SolverUtils::ForcingProgrammatic::UpdateForces ( )

Definition at line 54 of file ForcingProgrammatic.cpp.

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

55  {
56  return m_Forcing;
57  }
Array< OneD, Array< OneD, NekDouble > > m_Forcing
Evaluated forcing function.
Definition: Forcing.h:97
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().

79  {
80  for (int i = 0; i < m_NumVariable; i++)
81  {
82  Vmath::Vadd(outarray[i].num_elements(), outarray[i], 1,
83  m_Forcing[i], 1, outarray[i], 1);
84  }
85  }
Array< OneD, Array< OneD, NekDouble > > m_Forcing
Evaluated forcing function.
Definition: Forcing.h:97
int m_NumVariable
Number of variables.
Definition: Forcing.h:99
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:285
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.

63  {
64  m_NumVariable = pNumForcingFields;
65  int nq = pFields[0]->GetTotPoints();
66 
68  for (int i = 0; i < m_NumVariable; ++i)
69  {
70  m_Forcing[i] = Array<OneD, NekDouble> (nq, 0.0);
71  }
72  }
Array< OneD, Array< OneD, NekDouble > > m_Forcing
Evaluated forcing function.
Definition: Forcing.h:97
int m_NumVariable
Number of variables.
Definition: Forcing.h:99

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.