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);
124 (nConvectiveFields - 1);
135 for (
int i = 0; i < m_numPlanes; ++i)
137 m_planePos[i] = i * m_numPointsPlane;
147 for (
int i = 0; i < nConvectiveFields; ++i)
152 for (
int i = 0; i < m_numPlanes; ++i)
156 for (
int j = 0; j < nConvectiveFields; ++j)
160 m_homoDerivStore[j] + m_planePos[i]);
170 void Diffusion3DHomogeneous1D::v_Diffuse(
171 const int nConvectiveFields,
181 const int nPointsTot = fields[0]->GetNpoints();
189 for (i = 0; i < nConvectiveFields - 1; ++i)
191 fields[0]->PhysDeriv(2, inarray[i], m_homoDerivStore[i]);
197 for (i = 0; i < m_numPlanes; ++i)
201 for (
int j = 0; j < inarray.num_elements(); ++j)
204 m_numPointsPlane, tmp2 = inarray [j] + m_planePos[i]);
207 for (
int j = 0; j < nConvectiveFields; ++j)
209 m_fieldsPlane [j] = fields[j]->GetPlane(i);
211 m_numPointsPlane, tmp2 = outarray[j] + m_planePos[i]);
217 m_planeDiff->SetHomoDerivs(m_homoDerivPlane[i]);
222 m_planeDiff->Diffuse(nConvectiveFields,
232 for (
int j = 0; j < nConvectiveFields - 1; ++j)
235 viscTensor[2][j+1], 1,
236 tmp2 = viscHComp[j] + m_planePos[i], 1);
245 for (j = 0; j < nConvectiveFields - 1; ++j)
247 fields[j+1]->PhysDeriv(2, viscHComp[j], tmp);
248 Vmath::Vadd(nPointsTot, outarray[j+1], 1, tmp, 1, outarray[j+1], 1);
253 for (j = 0; j < nConvectiveFields; ++j)
255 fields[j]->HomogeneousFwdTrans(inarray[j], tmp);
257 for (i = 0; i < m_numPlanes; ++i)
259 beta = 2*M_PI*m_trans->GetK(i)/m_homoLen;
264 &tmp[0] + i*m_numPointsPlane, 1,
265 &tmp[0] + i*m_numPointsPlane, 1);
268 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.
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.
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.