46 std::string Diffusion3DHomogeneous1D::type[] = {
48 "LDG3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
50 "LFRDG3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
52 "LFRSD3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
54 "LFRHU3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
56 "LFRcmin3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
58 "LFRcinf3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
60 "LDGNS3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
62 "LFRDGNS3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
64 "LFRSDNS3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
66 "LFRHUNS3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
68 "LFRcminNS3DHomogeneous1D", Diffusion3DHomogeneous1D::create),
70 "LFRcinfNS3DHomogeneous1D", Diffusion3DHomogeneous1D::create)
78 Diffusion3DHomogeneous1D::Diffusion3DHomogeneous1D(std::string diffType)
82 string name = diffType.substr(0, diffType.length()-15);
93 void Diffusion3DHomogeneous1D::v_InitObject(
97 int nConvectiveFields = pFields.num_elements();
103 for (
int i = 0; i < nConvectiveFields; ++i)
105 pFields_plane0[i] = pFields[i]->GetPlane(0);
107 m_planeDiff->InitObject(pSession, pFields_plane0);
109 m_numPoints = pFields[0]->GetTotPoints();
110 m_planes = pFields[0]->GetZIDs();
111 m_numPlanes = m_planes.num_elements();
112 m_numPointsPlane = m_numPoints/m_numPlanes;
113 m_homoLen = pFields[0]->GetHomoLen();
114 m_trans = pFields[0]->GetTransposition();
116 m_planeDiff->SetFluxVectorNS(m_fluxVectorNS);
121 m_planeDiff->SetRiemannSolver(m_riemann);
125 map<string, RSScalarFuncType> scalars = m_riemann->GetScalars();
127 for (it1 = scalars.begin(); it1 != scalars.end(); ++it1)
129 boost::shared_ptr<HomoRSScalar> tmp =
132 m_riemann->SetScalar(it1->first, &HomoRSScalar::Exec, tmp);
143 (nConvectiveFields - 1);
154 for (
int i = 0; i < m_numPlanes; ++i)
156 m_planePos[i] = i * m_numPointsPlane;
166 for (
int i = 0; i < nConvectiveFields; ++i)
171 for (
int i = 0; i < m_numPlanes; ++i)
175 for (
int j = 0; j < nConvectiveFields; ++j)
179 m_homoDerivStore[j] + m_planePos[i]);
189 void Diffusion3DHomogeneous1D::v_Diffuse(
190 const int nConvectiveFields,
198 const int nPointsTot = fields[0]->GetNpoints();
206 for (i = 0; i < nConvectiveFields - 1; ++i)
208 fields[0]->PhysDeriv(2, inarray[i], m_homoDerivStore[i]);
214 for (i = 0; i < m_numPlanes; ++i)
218 for (
int j = 0; j < inarray.num_elements(); ++j)
221 m_numPointsPlane, tmp2 = inarray [j] + m_planePos[i]);
224 for (
int j = 0; j < nConvectiveFields; ++j)
226 m_fieldsPlane [j] = fields[j]->GetPlane(i);
228 m_numPointsPlane, tmp2 = outarray[j] + m_planePos[i]);
234 m_planeDiff->SetHomoDerivs(m_homoDerivPlane[i]);
239 m_planeDiff->Diffuse(nConvectiveFields,
249 for (
int j = 0; j < nConvectiveFields - 1; ++j)
252 viscTensor[2][j+1], 1,
253 tmp2 = viscHComp[j] + m_planePos[i], 1);
262 for (j = 0; j < nConvectiveFields - 1; ++j)
264 fields[j+1]->PhysDeriv(2, viscHComp[j], tmp);
265 Vmath::Vadd(nPointsTot, outarray[j+1], 1, tmp, 1, outarray[j+1], 1);
270 for (j = 0; j < nConvectiveFields; ++j)
272 fields[j]->HomogeneousFwdTrans(inarray[j], tmp);
274 for (i = 0; i < m_numPlanes; ++i)
276 beta = 2*M_PI*m_trans->GetK(i)/m_homoLen;
281 &tmp[0] + i*m_numPointsPlane, 1,
282 &tmp[0] + i*m_numPointsPlane, 1);
285 fields[0]->HomogeneousBwdTrans(tmp, tmp);
tBaseSharedPtr CreateInstance(tKey idKey BOOST_PP_COMMA_IF(MAX_PARAM) BOOST_PP_ENUM_BINARY_PARAMS(MAX_PARAM, tParam, x))
Create an instance of the class referred to by idKey.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
DiffusionFactory & GetDiffusionFactory()
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
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.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.