42 namespace MultiRegions
56 const bool dealiasing,
63 "Size of basis number of points and number"
64 "of planes are not the same");
69 planes.num_elements() * planes[0]->GetExpSize());
71 for(cnt = n = 0; n < planes.num_elements(); ++n)
74 for (i = 0; i < planes[n]->GetExpSize(); ++i)
76 (*m_exp)[cnt++] = planes[n]->GetExp(i);
94 const bool dealiasing,
109 for (j = 0; j < nel; ++j)
114 for (n = 1; n <
m_planes.num_elements(); ++n)
118 for(j = 0; j < nel; ++j)
120 (*m_exp).push_back((*
m_exp)[j]);
143 for (
int n = 0; n <
m_planes.num_elements(); ++n)
162 int ncoeffs_per_plane =
m_planes[0]->GetNcoeffs();
163 int npoints_per_plane =
m_planes[0]->GetTotPoints();
165 int nzplanes =
m_planes.num_elements();
174 int nel =
m_planes[0]->GetExpSize();
180 for (cnt = n = 0; n < nzplanes; ++n)
183 tmparray=
m_coeffs + ncoeffs_per_plane*n);
185 tmparray = m_phys + npoints_per_plane*n);
187 for(i = 0; i < nel; ++i)
190 + n*ncoeffs_per_plane;
191 m_phys_offset[cnt] =
m_planes[n]->GetPhys_Offset(i)
192 + n*npoints_per_plane;
193 m_offset_elmt_id[cnt++] =
m_planes[n]->GetOffset_Elmt_Id(i)
207 int nyplanes =
m_planes.num_elements();
214 (*m_exp)[eid]->GetCoords(xc0);
220 "output coord_1 is not defined");
222 (*m_exp)[eid]->GetCoords(xc0,xc1);
227 ASSERTL0(
false,
"Cannot have coordim being three dimensions"
228 "in a homogeneous field");
238 for(n = 0; n <
m_planes.num_elements(); n++)
246 for (n = 0; n < nyplanes; ++n)
248 Vmath::Fill(npoints,z[n],tmp_xc = xhom + npoints*n,1);
285 int nyplanes =
m_planes.num_elements();
286 int npoints =
m_planes[0]->GetTotPoints();
304 for(n = 0; n <
m_planes.num_elements(); n++)
312 for(n = 0; n < nyplanes; ++n)
314 Vmath::Fill(npoints,z[n],tmp_xc = xhom + npoints*n,1);
333 std::ostream &outfile,
338 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
339 int nquad1 =
m_planes.num_elements();
344 coords[1] = coords[0] + nquad0*nquad1;
345 coords[2] = coords[1] + nquad0*nquad1;
347 GetCoords(expansion,coords[0],coords[1],coords[2]);
349 outfile <<
"Zone, I=" << nquad0 <<
", J=" << nquad1
350 <<
", F=Block" << std::endl;
354 for(i = 0; i < nquad0*nquad1; ++i)
356 outfile << coords[j][i] <<
" ";
358 outfile << std::endl;
364 std::ostream &outfile,
369 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
370 int nquad1 =
m_planes.num_elements();
371 int ntot = nquad0*nquad1;
372 int ntotminus = (nquad0-1)*(nquad1-1);
378 GetCoords(expansion,coords[0],coords[1],coords[2]);
380 outfile <<
" <Piece NumberOfPoints=\""
381 << ntot <<
"\" NumberOfCells=\""
382 << ntotminus <<
"\">" << endl;
383 outfile <<
" <Points>" << endl;
384 outfile <<
" <DataArray type=\"Float64\" "
385 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
387 for (i = 0; i < ntot; ++i)
389 for (j = 0; j < 3; ++j)
391 outfile << coords[j][i] <<
" ";
396 outfile <<
" </DataArray>" << endl;
397 outfile <<
" </Points>" << endl;
398 outfile <<
" <Cells>" << endl;
399 outfile <<
" <DataArray type=\"Int32\" "
400 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
401 for (i = 0; i < nquad0-1; ++i)
403 for (j = 0; j < nquad1-1; ++j)
405 outfile << j*nquad0 + i <<
" "
406 << j*nquad0 + i + 1 <<
" "
407 << (j+1)*nquad0 + i + 1 <<
" "
408 << (j+1)*nquad0 + i << endl;
412 outfile <<
" </DataArray>" << endl;
413 outfile <<
" <DataArray type=\"Int32\" "
414 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
415 for (i = 0; i < ntotminus; ++i)
417 outfile << i*4+4 <<
" ";
420 outfile <<
" </DataArray>" << endl;
421 outfile <<
" <DataArray type=\"UInt8\" "
422 <<
"Name=\"types\" format=\"ascii\">" << endl;
423 for (i = 0; i < ntotminus; ++i)
428 outfile <<
" </DataArray>" << endl;
429 outfile <<
" </Cells>" << endl;
430 outfile <<
" <PointData>" << endl;
436 int nPlanes =
m_planes.num_elements();
437 int nPtsPlane =
m_planes[0]->GetNpoints();
440 ASSERTL1(normals.num_elements() >= nDim,
441 "Output vector does not have sufficient dimensions to"
443 ASSERTL1(normals[0].num_elements() >= nPtsPlane,
444 "Output vector does not have sufficient dimensions to"
451 for (
int i = 0; i < nDim; ++i)
453 for (
int n = 1; n < nPlanes; ++n)
456 &normals[i][n*nPtsPlane], 1);
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
#define ASSERTL0(condition, msg)
virtual ~ExpList2DHomogeneous1D()
Destructor.
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
LibUtilities::TranspositionSharedPtr m_transposition
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
const boost::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
NekDouble m_lhom
Width of homogeneous direction.
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
int GetExpSize(void)
This function returns the number of elements in the expansion.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
LibUtilities::BasisSharedPtr m_homogeneousBasis
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
boost::shared_ptr< ExpList1D > ExpList1DSharedPtr
Shared pointer to an ExpList1D object.
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
LibUtilities::SessionReaderSharedPtr m_session
Session.
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2)
Array< OneD, ExpListSharedPtr > m_planes
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
ExpList2DHomogeneous1D()
Default constructor.
This class is the abstraction of a one-dimensional multi-elemental expansions which is merely a colle...
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
void GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
This function calculates the coordinates of all the elemental quadrature points . ...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Describes the specification for a Basis.