Definition at line 48 of file DiffusionSolverTimeInt.cpp.
◆ Diffusion()
Diffusion::Diffusion |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 82 of file DiffusionSolverTimeInt.cpp.
83{
84
85 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
86
87
89
90
91 fld = LibUtilities::FieldIO::CreateDefault(
session);
92
93
95
96
97 if (
session->DefinesTimeIntScheme())
98 {
100 }
101 else
102 {
104 }
105
110
111
114
117
118
119 unsigned int nq =
field->GetNpoints();
121 field->GetCoords(x0, x1, x2);
122
123
125 session->GetFunction(
"InitialConditions",
"u");
126 icond->Evaluate(x0, x1, x2, 0.0,
field->UpdatePhys());
127}
LibUtilities::TimeIntScheme timeInt
MultiRegions::ContFieldSharedPtr field
SpatialDomains::MeshGraphSharedPtr graph
LibUtilities::FieldIOSharedPtr fld
LibUtilities::SessionReaderSharedPtr session
Array< OneD, Array< OneD, NekDouble > > fields
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
std::shared_ptr< Equation > EquationSharedPtr
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::FieldIO::CreateDefault(), Nektar::LibUtilities::SessionReader::CreateInstance(), FilterPython_Function::field, and Nektar::SpatialDomains::MeshGraphIO::Read().
◆ ~Diffusion()
Diffusion::~Diffusion |
( |
| ) |
|
◆ DoImplicitSolve()
Definition at line 158 of file DiffusionSolverTimeInt.cpp.
162{
165
166 for (int i = 0; i < inarray.size(); ++i)
167 {
168
170 inarray[i], 1, outarray[i], 1);
171
172
174
175
176 field->BwdTrans(
field->GetCoeffs(), outarray[i]);
177 }
178}
std::map< ConstFactorType, NekDouble > ConstFactorMap
StdRegions::ConstFactorMap factors
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
References Nektar::StdRegions::eFactorLambda, Nektar::VarcoeffHashingTest::factors, FilterPython_Function::field, and Vmath::Smul().
Referenced by TimeIntegrate().
◆ ExactSolution()
void Diffusion::ExactSolution |
( |
| ) |
|
|
private |
◆ TimeIntegrate()
void Diffusion::TimeIntegrate |
( |
| ) |
|
Definition at line 134 of file DiffusionSolverTimeInt.cpp.
135{
138
140
141
143
144
146
147 for (
int n = 0; n <
nSteps; ++n)
148 {
150 }
151
153
156}
LibUtilities::TimeIntegrationSchemeOperators ode
void DoImplicitSolve(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, Array< OneD, NekDouble > > &outarray, const NekDouble time, const NekDouble lambda)
LibUtilities::TimeIntegrationSchemeSharedPtr intScheme
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void DefineImplicitSolve(FuncPointerT func, ObjectPointerT obj)
TimeIntegrationSchemeFactory & GetTimeIntegrationSchemeFactory()
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)
std::vector< NekDouble > freeParams
References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), DoImplicitSolve(), FilterPython_Function::field, Nektar::LibUtilities::GetTimeIntegrationSchemeFactory(), Vmath::Vcopy(), and Vmath::Zero().
◆ WriteSolution()
void Diffusion::WriteSolution |
( |
| ) |
|
|
private |
Definition at line 180 of file DiffusionSolverTimeInt.cpp.
181{
182
183 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef =
184 field->GetFieldDefinitions();
185 std::vector<std::vector<NekDouble>> FieldData(FieldDef.size());
186 for (int i = 0; i < FieldDef.size(); ++i)
187 {
188 FieldDef[i]->m_fields.push_back("u");
189 field->AppendFieldData(FieldDef[i], FieldData[i]);
190 }
191 fld->Write(
session->GetSessionName() +
".fld", FieldDef, FieldData);
192}
References FilterPython_Function::field.
◆ delta_t
◆ epsilon
◆ field
◆ fields
◆ fld
◆ graph
◆ intScheme
◆ lambda
◆ nSteps
unsigned int Diffusion::nSteps |
|
private |
◆ ode
◆ session
◆ sessionName
string Diffusion::sessionName |
|
private |
◆ timeInt