36 #include <boost/core/ignore_unused.hpp>
45 namespace MultiRegions
56 const NekDouble lhom_z,
const bool useFFT,
const bool dealiasing,
59 lhom_z, useFFT, dealiasing)
61 boost::ignore_unused(ImpType);
69 const NekDouble lhom_z,
const bool useFFT,
const bool dealiasing,
73 lhom_z, useFFT, dealiasing)
81 m_session, graph1D,
false,
"DefaultVar", ImpType);
86 for (j = 0; j < nel; ++j)
94 for (n = 1; n < (ny * nz); ++n)
98 for (j = 0; j < nel; ++j)
100 (*m_exp).push_back((*
m_exp)[j]);
114 if (DeclareLinesSetCoeffPhys)
119 for (
int n = 0; n <
m_lines.size(); ++n)
134 const bool DeclareLinesSetCoeffPhys,
138 if (DeclareLinesSetCoeffPhys)
141 std::vector<unsigned int> eIDsLine;
142 int nel = eIDs.size() /
m_lines.size();
144 for (
int i = 0; i < nel; ++i)
146 eIDsLine.push_back(eIDs[i]);
150 std::dynamic_pointer_cast<ExpList>(In.
m_lines[0]);
153 *(zero_line_old), eIDsLine, ImpType);
155 for (
int n = 0; n <
m_lines.size(); ++n)
175 int ncoeffs_per_line =
m_lines[0]->GetNcoeffs();
176 int npoints_per_line =
m_lines[0]->GetTotPoints();
187 int nel =
m_lines[0]->GetExpSize();
192 for (cnt = n = 0; n < nyzlines; ++n)
194 m_lines[n]->SetCoeffsArray(tmparray =
m_coeffs + ncoeffs_per_line * n);
195 m_lines[n]->SetPhysArray(tmparray =
m_phys + npoints_per_line * n);
197 for (i = 0; i < nel; ++i)
200 m_lines[n]->GetCoeff_Offset(i) + n * ncoeffs_per_line;
202 m_lines[n]->GetPhys_Offset(i) + n * npoints_per_line;
233 (*m_exp)[eid]->GetCoords(x);
235 for (m = 0; m < nzlines; ++m)
237 for (j = 0; j < nylines; ++j)
239 for (n = 0; n < npoints; ++n)
242 tmp_xc = xc0 + n + (j * npoints) +
243 (m * npoints * nylines),
246 tmp_xc = xc1 + n + (j * npoints) +
247 (m * npoints * nylines),
250 tmp_xc = xc2 + n + (j * npoints) +
251 (m * npoints * nylines),
280 int npoints =
m_lines[0]->GetTotPoints();
301 for (m = 0; m < nzlines; ++m)
303 for (j = 0; j < nylines; ++j)
305 for (n = 0; n < npoints; ++n)
308 tmp_xc = xc0 + n + (j * npoints) +
309 (m * npoints * nylines),
312 tmp_xc = xc1 + n + (j * npoints) +
313 (m * npoints * nylines),
316 tmp_xc = xc2 + n + (j * npoints) +
317 (m * npoints * nylines),
334 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
341 coords[1] = coords[0] + nquad0 * nquad1 * nquad2;
342 coords[2] = coords[1] + nquad0 * nquad1 * nquad2;
344 GetCoords(expansion, coords[0], coords[1], coords[2]);
346 outfile <<
"Zone, I=" << nquad0 <<
", J=" << nquad1 <<
",K=" << nquad2
347 <<
", F=Block" << std::endl;
349 for (j = 0; j < 3; ++j)
351 for (i = 0; i < nquad0 * nquad1 * nquad2; ++i)
353 outfile << coords[j][i] <<
" ";
355 outfile << std::endl;
363 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
366 int ntot = nquad0 * nquad1 * nquad2;
367 int ntotminus = (nquad0 - 1) * (nquad1 - 1) * (nquad2 - 1);
373 GetCoords(expansion, coords[0], coords[1], coords[2]);
375 outfile <<
" <Piece NumberOfPoints=\"" << ntot <<
"\" NumberOfCells=\""
376 << ntotminus <<
"\">" << endl;
377 outfile <<
" <Points>" << endl;
378 outfile <<
" <DataArray type=\"Float64\" "
379 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
381 for (i = 0; i < ntot; ++i)
383 for (j = 0; j < 3; ++j)
385 outfile << coords[j][i] <<
" ";
390 outfile <<
" </DataArray>" << endl;
391 outfile <<
" </Points>" << endl;
392 outfile <<
" <Cells>" << endl;
393 outfile <<
" <DataArray type=\"Int32\" "
394 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
395 for (i = 0; i < nquad0 - 1; ++i)
397 for (j = 0; j < nquad1 - 1; ++j)
399 for (k = 0; k < nquad2 - 1; ++k)
401 outfile << k * nquad0 * nquad1 + j * nquad0 + i <<
" "
402 << k * nquad0 * nquad1 + j * nquad0 + i + 1 <<
" "
403 << k * nquad0 * nquad1 + (j + 1) * nquad0 + i + 1 <<
" "
404 << k * nquad0 * nquad1 + (j + 1) * nquad0 + i <<
" "
405 << (k + 1) * nquad0 * nquad1 + j * nquad0 + i <<
" "
406 << (k + 1) * nquad0 * nquad1 + j * nquad0 + i + 1 <<
" "
407 << (k + 1) * nquad0 * nquad1 + (j + 1) * nquad0 + i + 1
409 << (k + 1) * nquad0 * nquad1 + (j + 1) * nquad0 + i
415 outfile <<
" </DataArray>" << endl;
416 outfile <<
" <DataArray type=\"Int32\" "
417 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
418 for (i = 0; i < ntotminus; ++i)
420 outfile << i * 8 + 8 <<
" ";
423 outfile <<
" </DataArray>" << endl;
424 outfile <<
" <DataArray type=\"UInt8\" "
425 <<
"Name=\"types\" format=\"ascii\">" << endl;
426 for (i = 0; i < ntotminus; ++i)
431 outfile <<
" </DataArray>" << endl;
432 outfile <<
" </Cells>" << endl;
433 outfile <<
" <PointData>" << endl;
448 for (
int m = 0; m < nzlines; ++m)
450 for (
int n = 0; n < nylines; ++n)
452 errL2 =
m_lines[n + (m * nylines)]->
L2(inarray + cnt, soln + cnt);
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 one-dimensional multi-elemental expansion which is merely a collection of local expa...
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip) override
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray) override
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion) override
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2) override
ExpList3DHomogeneous2D()
Default constructor.
virtual ~ExpList3DHomogeneous2D()
Destructor.
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
LibUtilities::BasisSharedPtr m_homogeneousBasis_y
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
NekDouble m_lhom_z
Width of homogeneous direction z.
Array< OneD, ExpListSharedPtr > m_lines
Vector of ExpList, will be filled with ExpList1D.
LibUtilities::BasisSharedPtr m_homogeneousBasis_z
Base expansion in z direction.
NekDouble m_lhom_y
Width of homogeneous direction y.
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 .
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.
NekDouble L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
This function calculates the error of the global This function calculates the error with respect to...
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 .
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
The above copyright notice and this permission notice shall be included.
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 scalar y = alpha + x.
scalarT< T > sqrt(scalarT< T > in)