52 const bool useFFT,
const bool dealiasing,
66 "Size of basis number of points and number"
67 "of planes are not the same");
71 planes.size() * planes[0]->GetExpSize());
73 for (cnt = n = 0; n < planes.size(); ++n)
76 for (i = 0; i < planes[n]->GetExpSize(); ++i)
78 (*m_exp)[cnt++] = planes[n]->GetExp(i);
89 const bool useFFT,
const bool dealiasing,
100 m_session, graph1D,
false,
"DefaultVar", ImpType);
106 for (j = 0; j < nel; ++j)
111 for (n = 1; n <
m_planes.size(); ++n)
115 for (j = 0; j < nel; ++j)
117 (*m_exp).push_back((*
m_exp)[j]);
131 std::dynamic_pointer_cast<ExpList>(In.
m_planes[0]);
133 for (
int n = 0; n <
m_planes.size(); ++n)
152 int ncoeffs_per_plane =
m_planes[0]->GetNcoeffs();
153 int npoints_per_plane =
m_planes[0]->GetTotPoints();
158 m_ncoeffs = ncoeffs_per_plane * nzplanes;
159 m_npoints = npoints_per_plane * nzplanes;
164 int nel =
m_planes[0]->GetExpSize();
169 for (cnt = n = 0; n < nzplanes; ++n)
171 m_planes[n]->SetCoeffsArray(tmparray =
173 m_planes[n]->SetPhysArray(tmparray =
m_phys + npoints_per_plane * n);
175 for (i = 0; i < nel; ++i)
178 m_planes[n]->GetCoeff_Offset(i) + n * ncoeffs_per_plane;
180 m_planes[n]->GetPhys_Offset(i) + n * npoints_per_plane;
199 (*m_exp)[eid]->GetCoords(xc0);
204 ASSERTL0(xc1.size() != 0,
"output coord_1 is not defined");
206 (*m_exp)[eid]->GetCoords(xc0, xc1);
211 ASSERTL0(
false,
"Cannot have coordim being three dimensions"
212 "in a homogeneous field");
222 for (n = 0; n <
m_planes.size(); n++)
230 for (n = 0; n < nyplanes; ++n)
232 Vmath::Fill(npoints,
z[n], tmp_xc = xhom + npoints * n, 1);
235 Vmath::Vcopy(npoints, xc0, 1, tmp_xc = xc0 + npoints * n, 1);
238 Vmath::Vcopy(npoints, xc1, 1, tmp_xc = xc1 + npoints * n, 1);
269 int npoints =
m_planes[0]->GetTotPoints();
287 for (n = 0; n <
m_planes.size(); n++)
295 for (n = 0; n < nyplanes; ++n)
297 Vmath::Fill(npoints,
z[n], tmp_xc = xhom + npoints * n, 1);
300 Vmath::Vcopy(npoints, xc0, 1, tmp_xc = xc0 + npoints * n, 1);
303 Vmath::Vcopy(npoints, xc1, 1, tmp_xc = xc1 + npoints * n, 1);
319 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
325 coords[1] = coords[0] + nquad0 * nquad1;
326 coords[2] = coords[1] + nquad0 * nquad1;
328 GetCoords(expansion, coords[0], coords[1], coords[2]);
330 outfile <<
"Zone, I=" << nquad0 <<
", J=" << nquad1 <<
", F=Block"
335 for (i = 0; i < nquad0 * nquad1; ++i)
337 outfile << coords[j][i] <<
" ";
339 outfile << std::endl;
345 [[maybe_unused]]
int istrip)
350 m_planes[0]->WriteVtkPieceHeader(outfile, expansion);
355 int outputExtraPlane = 0;
360 outputExtraPlane = 1;
363 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
364 int nquad1 =
m_planes.size() + outputExtraPlane;
365 int ntot = nquad0 * nquad1;
366 int ntotminus = (nquad0 - 1) * (nquad1 - 1);
372 GetCoords(expansion, coords[0], coords[1], coords[2]);
374 if (outputExtraPlane)
379 tmp = coords[0] + (nquad1 - 1) * nquad0, 1);
381 tmp = coords[1] + (nquad1 - 1) * nquad0, 1);
384 (coords[2][nquad0] - coords[2][0]);
385 Vmath::Fill(nquad0,
z, tmp = coords[2] + (nquad1 - 1) * nquad0, 1);
388 outfile <<
" <Piece NumberOfPoints=\"" << ntot <<
"\" NumberOfCells=\""
389 << ntotminus <<
"\">" << endl;
390 outfile <<
" <Points>" << endl;
391 outfile <<
" <DataArray type=\"Float64\" "
392 << R
"(NumberOfComponents="3" format="ascii">)" << endl;
394 for (i = 0; i < ntot; ++i)
396 for (j = 0; j < 3; ++j)
398 outfile << coords[j][i] <<
" ";
403 outfile <<
" </DataArray>" << endl;
404 outfile <<
" </Points>" << endl;
405 outfile <<
" <Cells>" << endl;
406 outfile <<
" <DataArray type=\"Int32\" "
407 << R
"(Name="connectivity" format="ascii">)" << endl;
408 for (i = 0; i < nquad0 - 1; ++i)
410 for (j = 0; j < nquad1 - 1; ++j)
412 outfile << j * nquad0 + i <<
" " << j * nquad0 + i + 1 <<
" "
413 << (j + 1) * nquad0 + i + 1 <<
" " << (j + 1) * nquad0 + i
418 outfile <<
" </DataArray>" << endl;
419 outfile <<
" <DataArray type=\"Int32\" "
420 << R
"(Name="offsets" format="ascii">)" << endl;
421 for (i = 0; i < ntotminus; ++i)
423 outfile << i * 4 + 4 <<
" ";
426 outfile <<
" </DataArray>" << endl;
427 outfile <<
" <DataArray type=\"UInt8\" "
428 << R
"(Name="types" format="ascii">)" << endl;
429 for (i = 0; i < ntotminus; ++i)
434 outfile <<
" </DataArray>" << endl;
435 outfile <<
" </Cells>" << endl;
436 outfile <<
" <PointData>" << endl;
443 int nPtsPlane =
m_planes[0]->GetNpoints();
447 "Output vector does not have sufficient dimensions to"
449 ASSERTL1(normals[0].size() >= nPtsPlane,
450 "Output vector does not have sufficient dimensions to"
457 for (
int i = 0; i < nDim; ++i)
459 for (
int n = 1; n < nPlanes; ++n)
462 &normals[i][n * nPtsPlane], 1);
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Describes the specification for a Basis.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2) override
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip) override
void v_WriteTecplotZone(std::ostream &outfile, int expansion) override
~ExpList2DHomogeneous1D() override
Destructor.
void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals) override
Populate normals with the normals of all expansions.
ExpList2DHomogeneous1D()
Default constructor.
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
NekDouble m_lhom
Width of homogeneous direction.
LibUtilities::TranspositionSharedPtr m_transposition
Array< OneD, ExpListSharedPtr > m_planes
LibUtilities::BasisSharedPtr m_homogeneousBasis
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
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 .
LibUtilities::CommSharedPtr m_comm
Communicator.
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
LibUtilities::SessionReaderSharedPtr m_session
Session.
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ eFourierEvenlySpaced
1D Evenly-spaced points using Fourier Fit
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
@ eFourier
Fourier Expansion .
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::vector< double > z(NPUPPER)
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)