43 namespace MultiRegions
46 ExpList2DHomogeneous1D::ExpList2DHomogeneous1D():
58 const bool dealiasing,
72 "Size of basis number of points and number" 73 "of planes are not the same");
78 planes.num_elements() * planes[0]->GetExpSize());
80 for(cnt = n = 0; n < planes.num_elements(); ++n)
83 for (i = 0; i < planes[n]->GetExpSize(); ++i)
85 (*m_exp)[cnt++] = planes[n]->GetExp(i);
103 const bool dealiasing,
120 for (j = 0; j < nel; ++j)
125 for (n = 1; n <
m_planes.num_elements(); ++n)
129 for(j = 0; j < nel; ++j)
131 (*m_exp).push_back((*
m_exp)[j]);
155 for (
int n = 0; n <
m_planes.num_elements(); ++n)
174 int ncoeffs_per_plane =
m_planes[0]->GetNcoeffs();
175 int npoints_per_plane =
m_planes[0]->GetTotPoints();
177 int nzplanes =
m_planes.num_elements();
186 int nel =
m_planes[0]->GetExpSize();
191 for (cnt = n = 0; n < nzplanes; ++n)
194 tmparray=
m_coeffs + ncoeffs_per_plane*n);
196 tmparray =
m_phys + npoints_per_plane*n);
198 for(i = 0; i < nel; ++i)
201 + n*ncoeffs_per_plane;
202 m_phys_offset[cnt++] =
m_planes[n]->GetPhys_Offset(i)
203 + n*npoints_per_plane;
216 int nyplanes =
m_planes.num_elements();
223 (*m_exp)[eid]->GetCoords(xc0);
229 "output coord_1 is not defined");
231 (*m_exp)[eid]->GetCoords(xc0,xc1);
236 ASSERTL0(
false,
"Cannot have coordim being three dimensions" 237 "in a homogeneous field");
247 for(n = 0; n <
m_planes.num_elements(); n++)
255 for (n = 0; n < nyplanes; ++n)
257 Vmath::Fill(npoints,z[n],tmp_xc = xhom + npoints*n,1);
294 int nyplanes =
m_planes.num_elements();
295 int npoints =
m_planes[0]->GetTotPoints();
313 for(n = 0; n <
m_planes.num_elements(); n++)
321 for(n = 0; n < nyplanes; ++n)
323 Vmath::Fill(npoints,z[n],tmp_xc = xhom + npoints*n,1);
342 std::ostream &outfile,
347 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
348 int nquad1 =
m_planes.num_elements();
353 coords[1] = coords[0] + nquad0*nquad1;
354 coords[2] = coords[1] + nquad0*nquad1;
356 GetCoords(expansion,coords[0],coords[1],coords[2]);
358 outfile <<
"Zone, I=" << nquad0 <<
", J=" << nquad1
359 <<
", F=Block" << std::endl;
363 for(i = 0; i < nquad0*nquad1; ++i)
365 outfile << coords[j][i] <<
" ";
367 outfile << std::endl;
373 std::ostream &outfile,
377 boost::ignore_unused(istrip);
382 m_planes[0]->WriteVtkPieceHeader(outfile, expansion);
387 int outputExtraPlane = 0;
392 outputExtraPlane = 1;
395 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
396 int nquad1 =
m_planes.num_elements() + outputExtraPlane;
397 int ntot = nquad0*nquad1;
398 int ntotminus = (nquad0-1)*(nquad1-1);
404 GetCoords(expansion,coords[0],coords[1],coords[2]);
406 if (outputExtraPlane)
411 tmp = coords[0] + (nquad1-1)*nquad0, 1);
413 tmp = coords[1] + (nquad1-1)*nquad0, 1);
416 (coords[2][nquad0] - coords[2][0]);
417 Vmath::Fill(nquad0, z, tmp = coords[2] + (nquad1-1)*nquad0, 1);
420 outfile <<
" <Piece NumberOfPoints=\"" 421 << ntot <<
"\" NumberOfCells=\"" 422 << ntotminus <<
"\">" << endl;
423 outfile <<
" <Points>" << endl;
424 outfile <<
" <DataArray type=\"Float64\" " 425 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
427 for (i = 0; i < ntot; ++i)
429 for (j = 0; j < 3; ++j)
431 outfile << coords[j][i] <<
" ";
436 outfile <<
" </DataArray>" << endl;
437 outfile <<
" </Points>" << endl;
438 outfile <<
" <Cells>" << endl;
439 outfile <<
" <DataArray type=\"Int32\" " 440 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
441 for (i = 0; i < nquad0-1; ++i)
443 for (j = 0; j < nquad1-1; ++j)
445 outfile << j*nquad0 + i <<
" " 446 << j*nquad0 + i + 1 <<
" " 447 << (j+1)*nquad0 + i + 1 <<
" " 448 << (j+1)*nquad0 + i << endl;
452 outfile <<
" </DataArray>" << endl;
453 outfile <<
" <DataArray type=\"Int32\" " 454 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
455 for (i = 0; i < ntotminus; ++i)
457 outfile << i*4+4 <<
" ";
460 outfile <<
" </DataArray>" << endl;
461 outfile <<
" <DataArray type=\"UInt8\" " 462 <<
"Name=\"types\" format=\"ascii\">" << endl;
463 for (i = 0; i < ntotminus; ++i)
468 outfile <<
" </DataArray>" << endl;
469 outfile <<
" </Cells>" << endl;
470 outfile <<
" <PointData>" << endl;
476 int nPlanes =
m_planes.num_elements();
477 int nPtsPlane =
m_planes[0]->GetNpoints();
480 ASSERTL1(normals.num_elements() >= nDim,
481 "Output vector does not have sufficient dimensions to" 483 ASSERTL1(normals[0].num_elements() >= nPtsPlane,
484 "Output vector does not have sufficient dimensions to" 491 for (
int i = 0; i < nDim; ++i)
493 for (
int n = 1; n < nPlanes; ++n)
496 &normals[i][n*nPtsPlane], 1);
507 for (i = 0; i < (*m_exp).size(); ++i)
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
#define ASSERTL0(condition, msg)
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
virtual ~ExpList2DHomogeneous1D()
Destructor.
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
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.
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
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.
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
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.
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 .
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
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...
LibUtilities::CommSharedPtr m_comm
Communicator.
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 . ...
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
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)
std::shared_ptr< ExpList1D > ExpList1DSharedPtr
Shared pointer to an ExpList1D object.
Describes the specification for a Basis.
std::shared_ptr< SessionReader > SessionReaderSharedPtr