36 #include <boost/core/ignore_unused.hpp> 45 namespace MultiRegions
48 ExpList3DHomogeneous2D::ExpList3DHomogeneous2D():
61 const bool dealiasing,
65 boost::ignore_unused(ImpType);
77 const bool dealiasing,
96 for(j = 0; j < nel; ++j)
104 for(n = 1; n < (ny*nz); ++n)
107 for(j = 0; j < nel; ++j)
109 (*m_exp).push_back((*
m_exp)[j]);
127 const bool DeclareLinesSetCoeffPhys):
132 if(DeclareLinesSetCoeffPhys)
137 for(
int n = 0; n <
m_lines.num_elements(); ++n)
151 const std::vector<unsigned int> &eIDs,
152 const bool DeclareLinesSetCoeffPhys,
158 if(DeclareLinesSetCoeffPhys)
161 std::vector<unsigned int> eIDsLine;
162 int nel = eIDs.size()/
m_lines.num_elements();
164 for (
int i = 0; i < nel; ++i)
166 eIDsLine.push_back(eIDs[i]);
175 for(
int n = 0; n <
m_lines.num_elements(); ++n)
194 int ncoeffs_per_line =
m_lines[0]->GetNcoeffs();
195 int npoints_per_line =
m_lines[0]->GetTotPoints();
197 int nyzlines =
m_lines.num_elements();
206 int nel =
m_lines[0]->GetExpSize();
211 for(cnt = n = 0; n < nyzlines; ++n)
214 m_lines[n]->SetPhysArray(tmparray =
m_phys + npoints_per_line*n);
216 for(i = 0; i < nel; ++i)
219 m_phys_offset[cnt++] =
m_lines[n]->GetPhys_Offset(i) + n*npoints_per_line;
250 (*m_exp)[eid]->GetCoords(x);
253 for(m = 0; m < nzlines; ++m)
255 for(j = 0; j < nylines; ++j)
257 for(n = 0; n < npoints; ++n)
259 Vmath::Fill(1,x[n],tmp_xc = xc0 + n +(j*npoints) + (m*npoints*nylines), 1);
260 Vmath::Fill(1,y[j],tmp_xc = xc1 + n +(j*npoints) + (m*npoints*nylines), 1);
261 Vmath::Fill(1,z[m],tmp_xc = xc2 + n +(j*npoints) + (m*npoints*nylines), 1);
289 int npoints =
m_lines[0]->GetTotPoints();
310 for(m = 0; m < nzlines; ++m)
312 for(j = 0; j < nylines; ++j)
314 for(n = 0; n < npoints; ++n)
316 Vmath::Fill(1,x[n],tmp_xc = xc0 + n +(j*npoints) + (m*npoints*nylines), 1);
317 Vmath::Fill(1,y[j],tmp_xc = xc1 + n +(j*npoints) + (m*npoints*nylines), 1);
318 Vmath::Fill(1,z[m],tmp_xc = xc2 + n +(j*npoints) + (m*npoints*nylines), 1);
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=" 347 << nquad2 <<
", 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=\"" 376 << ntot <<
"\" NumberOfCells=\"" 377 << ntotminus <<
"\">" << endl;
378 outfile <<
" <Points>" << endl;
379 outfile <<
" <DataArray type=\"Float64\" " 380 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
382 for (i = 0; i < ntot; ++i)
384 for (j = 0; j < 3; ++j)
386 outfile << coords[j][i] <<
" ";
391 outfile <<
" </DataArray>" << endl;
392 outfile <<
" </Points>" << endl;
393 outfile <<
" <Cells>" << endl;
394 outfile <<
" <DataArray type=\"Int32\" " 395 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
396 for (i = 0; i < nquad0-1; ++i)
398 for (j = 0; j < nquad1-1; ++j)
400 for (k = 0; k < nquad2-1; ++k)
402 outfile << k*nquad0*nquad1 + j*nquad0 + i <<
" " 403 << k*nquad0*nquad1 + j*nquad0 + i + 1 <<
" " 404 << k*nquad0*nquad1 + (j+1)*nquad0 + i + 1 <<
" " 405 << k*nquad0*nquad1 + (j+1)*nquad0 + i <<
" " 406 << (k+1)*nquad0*nquad1 + j*nquad0 + i <<
" " 407 << (k+1)*nquad0*nquad1 + j*nquad0 + i + 1 <<
" " 408 << (k+1)*nquad0*nquad1 + (j+1)*nquad0 + i + 1 <<
" " 409 << (k+1)*nquad0*nquad1 + (j+1)*nquad0 + i <<
" " << endl;
414 outfile <<
" </DataArray>" << endl;
415 outfile <<
" <DataArray type=\"Int32\" " 416 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
417 for (i = 0; i < ntotminus; ++i)
419 outfile << i*8+8 <<
" ";
422 outfile <<
" </DataArray>" << endl;
423 outfile <<
" <DataArray type=\"UInt8\" " 424 <<
"Name=\"types\" format=\"ascii\">" << endl;
425 for (i = 0; i < ntotminus; ++i)
430 outfile <<
" </DataArray>" << endl;
431 outfile <<
" </Cells>" << endl;
432 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);
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
NekDouble m_lhom_z
Width of homogeneous direction z.
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.
Array< OneD, ExpListSharedPtr > m_lines
Vector of ExpList, will be filled with ExpList1D.
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
LibUtilities::BasisSharedPtr m_homogeneousBasis_z
Base expansion in z direction.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2)
ExpList3DHomogeneous2D()
Default constructor.
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
NekDouble m_lhom_y
Width of homogeneous direction y.
virtual ~ExpList3DHomogeneous2D()
Destructor.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
LibUtilities::SessionReaderSharedPtr m_session
Session.
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
LibUtilities::BasisSharedPtr m_homogeneousBasis_y
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
This class is the abstraction of a one-dimensional multi-elemental expansions which is merely a colle...
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 .
NekDouble L2(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
This function calculates the error with respect to soln of the global spectral/hp element approximat...
std::shared_ptr< ExpList1D > ExpList1DSharedPtr
Shared pointer to an ExpList1D object.
Abstraction of a one-dimensional multi-elemental expansion which is merely a collection of local expa...
Describes the specification for a Basis.
std::shared_ptr< SessionReader > SessionReaderSharedPtr