44 namespace MultiRegions
47 ExpList2DHomogeneous1D::ExpList2DHomogeneous1D():
58 const bool dealiasing,
65 "Size of basis number of points and number"
66 "of planes are not the same");
71 planes.num_elements() * planes[0]->GetExpSize());
73 for(cnt = n = 0; n < planes.num_elements(); ++n)
76 for (i = 0; i < planes[n]->GetExpSize(); ++i)
78 (*m_exp)[cnt++] = planes[n]->GetExp(i);
96 const bool dealiasing,
112 for (j = 0; j < nel; ++j)
117 for (n = 1; n <
m_planes.num_elements(); ++n)
121 for(j = 0; j < nel; ++j)
123 (*m_exp).push_back((*
m_exp)[j]);
146 for (
int n = 0; n <
m_planes.num_elements(); ++n)
165 int ncoeffs_per_plane =
m_planes[0]->GetNcoeffs();
166 int npoints_per_plane =
m_planes[0]->GetTotPoints();
168 int nzplanes =
m_planes.num_elements();
177 int nel =
m_planes[0]->GetExpSize();
182 for (cnt = n = 0; n < nzplanes; ++n)
185 tmparray=
m_coeffs + ncoeffs_per_plane*n);
187 tmparray =
m_phys + npoints_per_plane*n);
189 for(i = 0; i < nel; ++i)
192 + n*ncoeffs_per_plane;
193 m_phys_offset[cnt++] =
m_planes[n]->GetPhys_Offset(i)
194 + n*npoints_per_plane;
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,
371 m_planes[0]->WriteVtkPieceHeader(outfile, expansion);
376 int outputExtraPlane = 0;
381 outputExtraPlane = 1;
384 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
385 int nquad1 =
m_planes.num_elements() + outputExtraPlane;
386 int ntot = nquad0*nquad1;
387 int ntotminus = (nquad0-1)*(nquad1-1);
393 GetCoords(expansion,coords[0],coords[1],coords[2]);
395 if (outputExtraPlane)
400 tmp = coords[0] + (nquad1-1)*nquad0, 1);
402 tmp = coords[1] + (nquad1-1)*nquad0, 1);
405 (coords[2][nquad0] - coords[2][0]);
406 Vmath::Fill(nquad0, z, tmp = coords[2] + (nquad1-1)*nquad0, 1);
409 outfile <<
" <Piece NumberOfPoints=\""
410 << ntot <<
"\" NumberOfCells=\""
411 << ntotminus <<
"\">" << endl;
412 outfile <<
" <Points>" << endl;
413 outfile <<
" <DataArray type=\"Float64\" "
414 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
416 for (i = 0; i < ntot; ++i)
418 for (j = 0; j < 3; ++j)
420 outfile << coords[j][i] <<
" ";
425 outfile <<
" </DataArray>" << endl;
426 outfile <<
" </Points>" << endl;
427 outfile <<
" <Cells>" << endl;
428 outfile <<
" <DataArray type=\"Int32\" "
429 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
430 for (i = 0; i < nquad0-1; ++i)
432 for (j = 0; j < nquad1-1; ++j)
434 outfile << j*nquad0 + i <<
" "
435 << j*nquad0 + i + 1 <<
" "
436 << (j+1)*nquad0 + i + 1 <<
" "
437 << (j+1)*nquad0 + i << endl;
441 outfile <<
" </DataArray>" << endl;
442 outfile <<
" <DataArray type=\"Int32\" "
443 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
444 for (i = 0; i < ntotminus; ++i)
446 outfile << i*4+4 <<
" ";
449 outfile <<
" </DataArray>" << endl;
450 outfile <<
" <DataArray type=\"UInt8\" "
451 <<
"Name=\"types\" format=\"ascii\">" << endl;
452 for (i = 0; i < ntotminus; ++i)
457 outfile <<
" </DataArray>" << endl;
458 outfile <<
" </Cells>" << endl;
459 outfile <<
" <PointData>" << endl;
465 int nPlanes =
m_planes.num_elements();
466 int nPtsPlane =
m_planes[0]->GetNpoints();
469 ASSERTL1(normals.num_elements() >= nDim,
470 "Output vector does not have sufficient dimensions to"
472 ASSERTL1(normals[0].num_elements() >= nPtsPlane,
473 "Output vector does not have sufficient dimensions to"
480 for (
int i = 0; i < nDim; ++i)
482 for (
int n = 1; n < nPlanes; ++n)
485 &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...
1D Evenly-spaced points using Fourier Fit
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 .
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.