Nektar++
CouplingFile.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: CouplingFile.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2017 Kilian Lackhove
10//
11// Permission is hereby granted, free of charge, to any person obtaining a
12// copy of this software and associated documentation files (the "Software"),
13// to deal in the Software without restriction, including without limitation
14// the rights to use, copy, modify, merge, publish, distribute, sublicense,
15// and/or sell copies of the Software, and to permit persons to whom the
16// Software is furnished to do so, subject to the following conditions:
17//
18// The above copyright notice and this permission notice shall be included
19// in all copies or substantial portions of the Software.
20//
21// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27// DEALINGS IN THE SOFTWARE.
28//
29// Description: File based Coupling class. Rather pointless, only for
30// demonstration.
31//
32///////////////////////////////////////////////////////////////////////////////
33
34#ifndef NEKTAR_COUPLINGFILE
35#define NEKTAR_COUPLINGFILE
36
39
40namespace Nektar
41{
42namespace SolverUtils
43{
44
45class CouplingFile;
46
47class CouplingFile : public Coupling
48{
49
50public:
51 static std::string className;
52
53 /// Creates an instance of this class
56 {
59 p->Init();
60 return p;
61 }
62
64
66
67protected:
68 SOLVER_UTILS_EXPORT virtual void v_Init() override;
69
70 SOLVER_UTILS_EXPORT virtual void v_Send(
71 const int step, const NekDouble time,
72 const Array<OneD, const Array<OneD, NekDouble>> &field,
73 std::vector<std::string> &varNames) override;
74
75 SOLVER_UTILS_EXPORT virtual void v_Receive(
76 const int step, const NekDouble time,
78 std::vector<std::string> &varNames) override;
79
80private:
83
85};
86} // namespace SolverUtils
87} // namespace Nektar
88
89#endif
#define SOLVER_UTILS_EXPORT
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
SessionFunctionSharedPtr m_inputFunction
Definition: CouplingFile.h:84
virtual SOLVER_UTILS_EXPORT void v_Send(const int step, const NekDouble time, const Array< OneD, const Array< OneD, NekDouble > > &field, std::vector< std::string > &varNames) override
virtual SOLVER_UTILS_EXPORT void v_Init() override
virtual SOLVER_UTILS_EXPORT ~CouplingFile()
virtual SOLVER_UTILS_EXPORT void v_Receive(const int step, const NekDouble time, Array< OneD, Array< OneD, NekDouble > > &field, std::vector< std::string > &varNames) override
SOLVER_UTILS_EXPORT CouplingFile(MultiRegions::ExpListSharedPtr field)
static SOLVER_UTILS_EXPORT CouplingSharedPtr create(MultiRegions::ExpListSharedPtr field)
Creates an instance of this class.
Definition: CouplingFile.h:54
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
SOLVER_UTILS_EXPORT typedef std::shared_ptr< Coupling > CouplingSharedPtr
Definition: Coupling.h:47
std::shared_ptr< SessionFunction > SessionFunctionSharedPtr
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2
double NekDouble