52 const NekDouble lhom_z,
const bool useFFT,
const bool dealiasing,
55 lhom_z, useFFT, dealiasing)
64 const NekDouble lhom_z,
const bool useFFT,
const bool dealiasing,
68 lhom_z, useFFT, dealiasing)
76 m_session, graph1D,
false,
"DefaultVar", ImpType);
81 for (j = 0; j < nel; ++j)
89 for (n = 1; n < (ny * nz); ++n)
93 for (j = 0; j < nel; ++j)
95 (*m_exp).push_back((*
m_exp)[j]);
109 if (DeclareLinesSetCoeffPhys)
114 for (
int n = 0; n <
m_lines.size(); ++n)
129 const bool DeclareLinesSetCoeffPhys,
133 if (DeclareLinesSetCoeffPhys)
136 std::vector<unsigned int> eIDsLine;
137 int nel = eIDs.size() /
m_lines.size();
139 for (
int i = 0; i < nel; ++i)
141 eIDsLine.push_back(eIDs[i]);
145 std::dynamic_pointer_cast<ExpList>(In.
m_lines[0]);
148 *(zero_line_old), eIDsLine, ImpType);
150 for (
int n = 0; n <
m_lines.size(); ++n)
170 int ncoeffs_per_line =
m_lines[0]->GetNcoeffs();
171 int npoints_per_line =
m_lines[0]->GetTotPoints();
182 int nel =
m_lines[0]->GetExpSize();
187 for (cnt = n = 0; n < nyzlines; ++n)
189 m_lines[n]->SetCoeffsArray(tmparray =
m_coeffs + ncoeffs_per_line * n);
190 m_lines[n]->SetPhysArray(tmparray =
m_phys + npoints_per_line * n);
192 for (i = 0; i < nel; ++i)
195 m_lines[n]->GetCoeff_Offset(i) + n * ncoeffs_per_line;
197 m_lines[n]->GetPhys_Offset(i) + n * npoints_per_line;
228 (*m_exp)[eid]->GetCoords(x);
230 for (m = 0; m < nzlines; ++m)
232 for (j = 0; j < nylines; ++j)
234 for (n = 0; n < npoints; ++n)
237 tmp_xc = xc0 + n + (j * npoints) +
238 (m * npoints * nylines),
241 tmp_xc = xc1 + n + (j * npoints) +
242 (m * npoints * nylines),
245 tmp_xc = xc2 + n + (j * npoints) +
246 (m * npoints * nylines),
275 int npoints =
m_lines[0]->GetTotPoints();
296 for (m = 0; m < nzlines; ++m)
298 for (j = 0; j < nylines; ++j)
300 for (n = 0; n < npoints; ++n)
303 tmp_xc = xc0 + n + (j * npoints) +
304 (m * npoints * nylines),
307 tmp_xc = xc1 + n + (j * npoints) +
308 (m * npoints * nylines),
311 tmp_xc = xc2 + n + (j * npoints) +
312 (m * npoints * nylines),
329 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
336 coords[1] = coords[0] + nquad0 * nquad1 * nquad2;
337 coords[2] = coords[1] + nquad0 * nquad1 * nquad2;
339 GetCoords(expansion, coords[0], coords[1], coords[2]);
341 outfile <<
"Zone, I=" << nquad0 <<
", J=" << nquad1 <<
",K=" << nquad2
342 <<
", F=Block" << std::endl;
344 for (j = 0; j < 3; ++j)
346 for (i = 0; i < nquad0 * nquad1 * nquad2; ++i)
348 outfile << coords[j][i] <<
" ";
350 outfile << std::endl;
358 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
361 int ntot = nquad0 * nquad1 * nquad2;
362 int ntotminus = (nquad0 - 1) * (nquad1 - 1) * (nquad2 - 1);
368 GetCoords(expansion, coords[0], coords[1], coords[2]);
370 outfile <<
" <Piece NumberOfPoints=\"" << ntot <<
"\" NumberOfCells=\""
371 << ntotminus <<
"\">" << endl;
372 outfile <<
" <Points>" << endl;
373 outfile <<
" <DataArray type=\"Float64\" "
374 << R
"(NumberOfComponents="3" format="ascii">)" << endl;
376 for (i = 0; i < ntot; ++i)
378 for (j = 0; j < 3; ++j)
380 outfile << coords[j][i] <<
" ";
385 outfile <<
" </DataArray>" << endl;
386 outfile <<
" </Points>" << endl;
387 outfile <<
" <Cells>" << endl;
388 outfile <<
" <DataArray type=\"Int32\" "
389 << R
"(Name="connectivity" format="ascii">)" << endl;
390 for (i = 0; i < nquad0 - 1; ++i)
392 for (j = 0; j < nquad1 - 1; ++j)
394 for (k = 0; k < nquad2 - 1; ++k)
396 outfile << k * nquad0 * nquad1 + j * nquad0 + i <<
" "
397 << k * nquad0 * nquad1 + j * nquad0 + i + 1 <<
" "
398 << k * nquad0 * nquad1 + (j + 1) * nquad0 + i + 1 <<
" "
399 << k * nquad0 * nquad1 + (j + 1) * nquad0 + i <<
" "
400 << (k + 1) * nquad0 * nquad1 + j * nquad0 + i <<
" "
401 << (k + 1) * nquad0 * nquad1 + j * nquad0 + i + 1 <<
" "
402 << (k + 1) * nquad0 * nquad1 + (j + 1) * nquad0 + i + 1
404 << (k + 1) * nquad0 * nquad1 + (j + 1) * nquad0 + i
410 outfile <<
" </DataArray>" << endl;
411 outfile <<
" <DataArray type=\"Int32\" "
412 << R
"(Name="offsets" format="ascii">)" << endl;
413 for (i = 0; i < ntotminus; ++i)
415 outfile << i * 8 + 8 <<
" ";
418 outfile <<
" </DataArray>" << endl;
419 outfile <<
" <DataArray type=\"UInt8\" "
420 << R
"(Name="types" format="ascii">)" << endl;
421 for (i = 0; i < ntotminus; ++i)
426 outfile <<
" </DataArray>" << endl;
427 outfile <<
" </Cells>" << endl;
428 outfile <<
" <PointData>" << endl;
443 for (
int m = 0; m < nzlines; ++m)
445 for (
int n = 0; n < nylines; ++n)
447 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...
void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip) override
NekDouble v_L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray) override
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...
~ExpList3DHomogeneous2D() override
Destructor.
void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2) override
ExpList3DHomogeneous2D()
Default constructor.
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
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.
scalarT< T > sqrt(scalarT< T > in)