42 namespace MultiRegions
56 const bool dealiasing,
57 const Array<OneD, ExpListSharedPtr> &planes)
63 "Size of basis number of points and number"
64 "of planes are not the same");
69 planes.num_elements() * planes[0]->GetExpSize());
71 for(cnt = n = 0; n < planes.num_elements(); ++n)
74 for (i = 0; i < planes[n]->GetExpSize(); ++i)
76 (*m_exp)[cnt++] = planes[n]->GetExp(i);
94 const bool dealiasing,
109 for (j = 0; j < nel; ++j)
114 for (n = 1; n <
m_planes.num_elements(); ++n)
118 for(j = 0; j < nel; ++j)
120 (*m_exp).push_back((*
m_exp)[j]);
143 for (
int n = 0; n <
m_planes.num_elements(); ++n)
162 int ncoeffs_per_plane =
m_planes[0]->GetNcoeffs();
163 int npoints_per_plane =
m_planes[0]->GetTotPoints();
165 int nzplanes =
m_planes.num_elements();
174 int nel =
m_planes[0]->GetExpSize();
178 Array<OneD, NekDouble> tmparray;
180 for (cnt = n = 0; n < nzplanes; ++n)
183 tmparray=
m_coeffs + ncoeffs_per_plane*n);
185 tmparray = m_phys + npoints_per_plane*n);
187 for(i = 0; i < nel; ++i)
190 + n*ncoeffs_per_plane;
191 m_phys_offset[cnt] =
m_planes[n]->GetPhys_Offset(i)
192 + n*npoints_per_plane;
193 m_offset_elmt_id[cnt++] =
m_planes[n]->GetOffset_Elmt_Id(i)
201 Array<OneD, NekDouble> &xc0,
202 Array<OneD, NekDouble> &xc1,
203 Array<OneD, NekDouble> &xc2)
206 Array<OneD, NekDouble> tmp_xc,xhom;
207 int nyplanes =
m_planes.num_elements();
214 (*m_exp)[eid]->GetCoords(xc0);
220 "output coord_1 is not defined");
222 (*m_exp)[eid]->GetCoords(xc0,xc1);
227 ASSERTL0(
false,
"Cannot have coordim being three dimensions"
228 "in a homogeneous field");
234 Array<OneD, NekDouble> z(nyplanes);
236 Array<OneD, NekDouble> local_pts(
m_planes.num_elements());
238 for(n = 0; n <
m_planes.num_elements(); n++)
246 for (n = 0; n < nyplanes; ++n)
248 Vmath::Fill(npoints,z[n],tmp_xc = xhom + npoints*n,1);
279 Array<OneD, NekDouble> &xc0,
280 Array<OneD, NekDouble> &xc1,
281 Array<OneD, NekDouble> &xc2)
284 Array<OneD, NekDouble> tmp_xc, xhom;
285 int nyplanes =
m_planes.num_elements();
286 int npoints =
m_planes[0]->GetTotPoints();
301 Array<OneD, NekDouble> z(nyplanes);
302 Array<OneD, NekDouble> local_pts(
m_planes.num_elements());
304 for(n = 0; n <
m_planes.num_elements(); n++)
312 for(n = 0; n < nyplanes; ++n)
314 Vmath::Fill(npoints,z[n],tmp_xc = xhom + npoints*n,1);
333 std::ostream &outfile,
338 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
339 int nquad1 =
m_planes.num_elements();
341 Array<OneD,NekDouble> coords[3];
343 coords[0] = Array<OneD,NekDouble>(3*nquad0*nquad1);
344 coords[1] = coords[0] + nquad0*nquad1;
345 coords[2] = coords[1] + nquad0*nquad1;
347 GetCoords(expansion,coords[0],coords[1],coords[2]);
349 outfile <<
"Zone, I=" << nquad0 <<
", J=" << nquad1
350 <<
", F=Block" << std::endl;
354 for(i = 0; i < nquad0*nquad1; ++i)
356 outfile << coords[j][i] <<
" ";
358 outfile << std::endl;
364 std::ostream &outfile,
368 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
369 int nquad1 =
m_planes.num_elements();
370 int ntot = nquad0*nquad1;
371 int ntotminus = (nquad0-1)*(nquad1-1);
373 Array<OneD,NekDouble> coords[3];
374 coords[0] = Array<OneD,NekDouble>(ntot);
375 coords[1] = Array<OneD,NekDouble>(ntot);
376 coords[2] = Array<OneD,NekDouble>(ntot);
377 GetCoords(expansion,coords[0],coords[1],coords[2]);
379 outfile <<
" <Piece NumberOfPoints=\""
380 << ntot <<
"\" NumberOfCells=\""
381 << ntotminus <<
"\">" << endl;
382 outfile <<
" <Points>" << endl;
383 outfile <<
" <DataArray type=\"Float32\" "
384 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
386 for (i = 0; i < ntot; ++i)
388 for (j = 0; j < 3; ++j)
390 outfile << coords[j][i] <<
" ";
395 outfile <<
" </DataArray>" << endl;
396 outfile <<
" </Points>" << endl;
397 outfile <<
" <Cells>" << endl;
398 outfile <<
" <DataArray type=\"Int32\" "
399 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
400 for (i = 0; i < nquad0-1; ++i)
402 for (j = 0; j < nquad1-1; ++j)
404 outfile << j*nquad0 + i <<
" "
405 << j*nquad0 + i + 1 <<
" "
406 << (j+1)*nquad0 + i + 1 <<
" "
407 << (j+1)*nquad0 + i << endl;
411 outfile <<
" </DataArray>" << endl;
412 outfile <<
" <DataArray type=\"Int32\" "
413 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
414 for (i = 0; i < ntotminus; ++i)
416 outfile << i*4+4 <<
" ";
419 outfile <<
" </DataArray>" << endl;
420 outfile <<
" <DataArray type=\"UInt8\" "
421 <<
"Name=\"types\" format=\"ascii\">" << endl;
422 for (i = 0; i < ntotminus; ++i)
427 outfile <<
" </DataArray>" << endl;
428 outfile <<
" </Cells>" << endl;
429 outfile <<
" <PointData>" << endl;
433 Array<
OneD, Array<OneD, NekDouble> > &normals)
435 int nPlanes =
m_planes.num_elements();
436 int nPtsPlane =
m_planes[0]->GetNpoints();
439 ASSERTL1(normals.num_elements() >= nDim,
440 "Output vector does not have sufficient dimensions to"
442 ASSERTL1(normals[0].num_elements() >= nPtsPlane,
443 "Output vector does not have sufficient dimensions to"
450 for (
int i = 0; i < nDim; ++i)
452 for (
int n = 1; n < nPlanes; ++n)
455 &normals[i][n*nPtsPlane], 1);