43 namespace MultiRegions
46 ExpList1DHomogeneous2D::ExpList1DHomogeneous2D():
58 const bool dealiasing,
65 "Size of basis number of points and number of lines are "
68 for(n = 0; n < points.num_elements(); ++n)
71 (*m_exp).push_back(points[n]->
GetExp(0));
88 for(
int n = 0; n <
m_lines.num_elements(); ++n)
106 int ncoeffs_per_line =
m_lines[0]->GetNcoeffs();
107 int npoints_per_line =
m_lines[0]->GetTotPoints();
109 int nyzlines =
m_lines.num_elements();
118 int nel =
m_lines[0]->GetExpSize();
124 for(cnt = n = 0; n < nyzlines; ++n)
127 m_lines[n]->SetPhysArray(tmparray = m_phys + npoints_per_line*n);
129 for(i = 0; i < nel; ++i)
132 m_phys_offset[cnt] =
m_lines[n]->GetPhys_Offset(i) + n*npoints_per_line;
133 m_offset_elmt_id[cnt++] =
m_lines[n]->GetOffset_Elmt_Id(i) + n*nel;
166 for(m = 0; m < nzlines; ++m)
168 for(j = 0; j < nylines; ++j)
170 for(n = 0; n < npoints; ++n)
172 Vmath::Fill(1,x[n],tmp_xc = xc0 + n +(j*npoints) + (m*npoints*nylines), 1);
173 Vmath::Fill(1,y[j],tmp_xc = xc1 + n +(j*npoints) + (m*npoints*nylines), 1);
174 Vmath::Fill(1,z[m],tmp_xc = xc2 + n +(j*npoints) + (m*npoints*nylines), 1);
225 for(m = 0; m < nzlines; ++m)
227 for(j = 0; j < nylines; ++j)
229 for(n = 0; n < npoints; ++n)
231 Vmath::Fill(1,x[n],tmp_xc = xc0 + n +(j*npoints) + (m*npoints*nylines), 1);
232 Vmath::Fill(1,y[j],tmp_xc = xc1 + n +(j*npoints) + (m*npoints*nylines), 1);
233 Vmath::Fill(1,z[m],tmp_xc = xc2 + n +(j*npoints) + (m*npoints*nylines), 1);
269 coords[1] = coords[0] + nquad0*nquad1*nquad2;
270 coords[2] = coords[1] + nquad0*nquad1*nquad2;
272 GetCoords(expansion,coords[0],coords[1],coords[2]);
274 outfile <<
"Zone, I=" << nquad1 <<
", J=" << nquad0*nquad2
275 <<
", F=Block" << std::endl;
277 for(j = 0; j < nquad1; ++j)
281 outfile << coords[j][i] <<
" ";
283 outfile << std::endl;
296 int ntot = nquad0*nquad1*nquad2;
297 int ntotminus = (nquad0)*(nquad1-1)*(nquad2-1);
303 GetCoords(expansion,coords[0],coords[1],coords[2]);
305 outfile <<
" <Piece NumberOfPoints=\""
306 << ntot <<
"\" NumberOfCells=\""
307 << ntotminus <<
"\">" << endl;
308 outfile <<
" <Points>" << endl;
309 outfile <<
" <DataArray type=\"Float32\" "
310 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
312 for (i = 0; i < ntot; ++i)
314 for (j = 0; j < 3; ++j)
316 outfile << coords[j][i] <<
" ";
321 outfile <<
" </DataArray>" << endl;
322 outfile <<
" </Points>" << endl;
323 outfile <<
" <Cells>" << endl;
324 outfile <<
" <DataArray type=\"Int32\" "
325 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
326 for (i = 0; i < nquad0; ++i)
328 for (j = 0; j < nquad1-1; ++j)
330 outfile << j*nquad0 + i <<
" "
331 << j*nquad0 + i + 1 <<
" "
332 << (j+1)*nquad0 + i + 1 <<
" "
333 << (j+1)*nquad0 + i << endl;
337 outfile <<
" </DataArray>" << endl;
338 outfile <<
" <DataArray type=\"Int32\" "
339 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
340 for (i = 0; i < ntotminus; ++i)
342 outfile << i*4+4 <<
" ";
345 outfile <<
" </DataArray>" << endl;
346 outfile <<
" <DataArray type=\"UInt8\" "
347 <<
"Name=\"types\" format=\"ascii\">" << endl;
348 for (i = 0; i < ntotminus; ++i)
353 outfile <<
" </DataArray>" << endl;
354 outfile <<
" </Cells>" << endl;
355 outfile <<
" <PointData>" << endl;
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
virtual ~ExpList1DHomogeneous2D()
Destructor.
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
ExpList1DHomogeneous2D()
Default constructor.
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
const boost::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
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 . ...
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.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Array< OneD, ExpListSharedPtr > m_lines
Vector of ExpList, will be filled with ExpList1D.
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Abstraction of a one-dimensional multi-elemental expansion which is merely a collection of local expa...
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 void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
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 .
Array< OneD, int > m_offset_elmt_id
Array containing the element id m_offset_elmt_id[n] that the n^th consecutive block of data in m_coef...
NekDouble m_lhom_y
Width of homogeneous direction y.
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2)
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
int m_ny
Number of modes = number of poitns in y direction.
LibUtilities::BasisSharedPtr m_homogeneousBasis_y
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
int m_nz
Number of modes = number of poitns in z direction.
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Describes the specification for a Basis.