49 namespace MultiRegions
63 const std::vector<unsigned int> &eIDs):
ExpList(In, eIDs)
103 SpatialDomains::ExpansionMap::const_iterator expIt;
104 for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
111 if((TetGeom = boost::dynamic_pointer_cast<SpatialDomains::TetGeom>(expIt->second->m_geomShPtr)))
121 (*m_exp).push_back(tet);
148 else if((HexGeom = boost::dynamic_pointer_cast<SpatialDomains::HexGeom>(expIt->second->m_geomShPtr)))
151 (*m_exp).push_back(hex);
158 ASSERTL0(
false,
"dynamic cast to a proper Geometry3D failed");
188 const std::string &variable) :
200 = graph3D->GetExpansions(variable);
202 SpatialDomains::ExpansionMap::const_iterator expIt;
203 for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
210 if((TetGeom = boost::dynamic_pointer_cast<
214 = expIt->second->m_basisKeyVector[0];
216 = expIt->second->m_basisKeyVector[1];
218 = expIt->second->m_basisKeyVector[2];
223 ASSERTL0(
false,
"LocalRegions::NodalTetExp is not "
231 tet->SetElmtId(elmtid++);
232 (*m_exp).push_back(tet);
235 else if((PrismGeom = boost::dynamic_pointer_cast<SpatialDomains
236 ::PrismGeom>(expIt->second->m_geomShPtr)))
239 = expIt->second->m_basisKeyVector[0];
241 = expIt->second->m_basisKeyVector[1];
243 = expIt->second->m_basisKeyVector[2];
248 prism->SetElmtId(elmtid++);
249 (*m_exp).push_back(prism);
251 else if((PyrGeom = boost::dynamic_pointer_cast<
255 = expIt->second->m_basisKeyVector[0];
257 = expIt->second->m_basisKeyVector[1];
259 = expIt->second->m_basisKeyVector[2];
264 pyramid->SetElmtId(elmtid++);
265 (*m_exp).push_back(pyramid);
267 else if((HexGeom = boost::dynamic_pointer_cast<
271 = expIt->second->m_basisKeyVector[0];
273 = expIt->second->m_basisKeyVector[1];
275 = expIt->second->m_basisKeyVector[2];
280 hex->SetElmtId(elmtid++);
281 (*m_exp).push_back(hex);
285 ASSERTL0(
false,
"dynamic cast to a proper Geometry3D "
327 for(
int i = 0; i < expansions.size(); ++i)
334 SpatialDomains::ExpansionMap::const_iterator expmap = expansions.find(i);
335 ASSERTL1(expmap != expansions.end(),
"Unable to find expansion.");
338 if((TetGeom = boost::dynamic_pointer_cast<
342 = exp->m_basisKeyVector[0];
344 = exp->m_basisKeyVector[1];
346 = exp->m_basisKeyVector[2];
351 ASSERTL0(
false,
"LocalRegions::NodalTetExp is not "
359 tet->SetElmtId(elmtid++);
360 (*m_exp).push_back(tet);
363 else if((PrismGeom = boost::dynamic_pointer_cast<
367 = exp->m_basisKeyVector[0];
369 = exp->m_basisKeyVector[1];
371 = exp->m_basisKeyVector[2];
376 prism->SetElmtId(elmtid++);
377 (*m_exp).push_back(prism);
379 else if((PyrGeom = boost::dynamic_pointer_cast<
383 = exp->m_basisKeyVector[0];
385 = exp->m_basisKeyVector[1];
387 = exp->m_basisKeyVector[2];
392 pyramid->SetElmtId(elmtid++);
393 (*m_exp).push_back(pyramid);
395 else if((HexGeom = boost::dynamic_pointer_cast<
399 = exp->m_basisKeyVector[0];
401 = exp->m_basisKeyVector[1];
403 = exp->m_basisKeyVector[2];
408 hex->SetElmtId(elmtid++);
409 (*m_exp).push_back(hex);
413 ASSERTL0(
false,
"dynamic cast to a proper Geometry3D "
451 for(i = 0; i <
m_exp->size(); ++i)
455 m_offset_elmt_id[i] = i;
456 m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
457 m_npoints += (*m_exp)[i]->GetTotPoints();
470 switch ((*
m_exp)[i]->DetShapeType())
477 ASSERTL0(
false,
"Unknown expansion type.");
490 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
491 int nquad1 = (*m_exp)[expansion]->GetNumPoints(1);
492 int nquad2 = (*m_exp)[expansion]->GetNumPoints(2);
493 int ntot = nquad0*nquad1*nquad2;
494 int ntotminus = (nquad0-1)*(nquad1-1)*(nquad2-1);
500 (*m_exp)[expansion]->GetCoords(coords[0],coords[1],coords[2]);
502 outfile <<
" <Piece NumberOfPoints=\""
503 << ntot <<
"\" NumberOfCells=\""
504 << ntotminus <<
"\">" << endl;
505 outfile <<
" <Points>" << endl;
506 outfile <<
" <DataArray type=\"Float64\" "
507 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
509 for (i = 0; i < ntot; ++i)
511 for (j = 0; j < 3; ++j)
513 outfile << setprecision(8) << scientific
514 << (float)coords[j][i] <<
" ";
520 outfile <<
" </DataArray>" << endl;
521 outfile <<
" </Points>" << endl;
522 outfile <<
" <Cells>" << endl;
523 outfile <<
" <DataArray type=\"Int32\" "
524 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
525 for (i = 0; i < nquad0-1; ++i)
527 for (j = 0; j < nquad1-1; ++j)
529 for (k = 0; k < nquad2-1; ++k)
531 outfile << k*nquad0*nquad1 + j*nquad0 + i <<
" "
532 << k*nquad0*nquad1 + j*nquad0 + i + 1 <<
" "
533 << k*nquad0*nquad1 + (j+1)*nquad0 + i + 1 <<
" "
534 << k*nquad0*nquad1 + (j+1)*nquad0 + i <<
" "
535 << (k+1)*nquad0*nquad1 + j*nquad0 + i <<
" "
536 << (k+1)*nquad0*nquad1 + j*nquad0 + i + 1 <<
" "
537 << (k+1)*nquad0*nquad1 + (j+1)*nquad0 + i + 1 <<
" "
538 << (k+1)*nquad0*nquad1 + (j+1)*nquad0 + i <<
" " << endl;
543 outfile <<
" </DataArray>" << endl;
544 outfile <<
" <DataArray type=\"Int32\" "
545 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
546 for (i = 0; i < ntotminus; ++i)
548 outfile << i*8+8 <<
" ";
551 outfile <<
" </DataArray>" << endl;
552 outfile <<
" <DataArray type=\"UInt8\" "
553 <<
"Name=\"types\" format=\"ascii\">" << endl;
554 for (i = 0; i < ntotminus; ++i)
559 outfile <<
" </DataArray>" << endl;
560 outfile <<
" </Cells>" << endl;
561 outfile <<
" <PointData>" << endl;
567 for (i = 0; i <
m_exp->size(); ++i)
569 for (j = 0; j < (*m_exp)[i]->GetNfaces(); ++j)
571 (*m_exp)[i]->ComputeFaceNormal(j);
586 int pt0 = (*m_exp)[i]->GetNumPoints(0);
587 int pt1 = (*m_exp)[i]->GetNumPoints(1);
588 int pt2 = (*m_exp)[i]->GetNumPoints(2);
589 int npt0 = (int) pt0*scale;
590 int npt1 = (int) pt1*scale;
591 int npt2 = (int) pt2*scale;
599 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
600 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(),
601 &inarray[cnt], newPointsKey0,
602 newPointsKey1, newPointsKey2,
606 cnt1 += npt0*npt1*npt2;
620 int pt0 = (*m_exp)[i]->GetNumPoints(0);
621 int pt1 = (*m_exp)[i]->GetNumPoints(1);
622 int pt2 = (*m_exp)[i]->GetNumPoints(2);
623 int npt0 = (int) pt0*scale;
624 int npt1 = (int) pt1*scale;
625 int npt2 = (int) pt2*scale;
636 (*
m_exp)[i]->GetBasis(0)->GetPointsKey(),
637 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
638 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(),
641 cnt += npt0*npt1*npt2;
boost::shared_ptr< PyrGeom > PyrGeomSharedPtr
#define ASSERTL0(condition, msg)
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
virtual void v_SetUpPhysNormals()
Set up the normals on each expansion.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
BasisType GetBasisType() const
Return type of expansion basis.
Lagrange Polynomials using the Gauss points .
boost::shared_ptr< HexExp > HexExpSharedPtr
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
boost::shared_ptr< HexGeom > HexGeomSharedPtr
int getNumberOfCoefficients(int Na, int Nb, int Nc)
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
int GetExpSize(void)
This function returns the number of elements in the expansion.
boost::shared_ptr< TetExp > TetExpSharedPtr
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
Base class for all multi-elemental spectral/hp expansions.
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
boost::shared_ptr< PyrExp > PyrExpSharedPtr
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...
int GetNumPoints() const
Return points order at which basis is defined.
LibUtilities::SessionReaderSharedPtr m_session
Session.
void PhysGalerkinProject3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
Defines a specification for a set of points.
boost::shared_ptr< PrismExp > PrismExpSharedPtr
virtual void v_ReadGlobalOptimizationParameters()
virtual ~ExpList3D()
Destructor.
void Interp3D(const BasisKey &fbasis0, const BasisKey &fbasis1, const BasisKey &fbasis2, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, const BasisKey &tbasis2, Array< OneD, NekDouble > &to)
this function interpolates a 3D function evaluated at the quadrature points of the 3D basis...
boost::shared_ptr< Expansion > ExpansionShPtr
boost::shared_ptr< PrismGeom > PrismGeomSharedPtr
void ReadGlobalOptimizationParameters()
boost::shared_ptr< TetGeom > TetGeomSharedPtr
Abstraction of a three-dimensional multi-elemental expansion which is merely a collection of local ex...
ExpList3D()
Default constructor.
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
int GetNumModes() const
Returns the order of the basis.
void SetExpType(ExpansionType Type)
Returns the type of the expansion.
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Describes the specification for a Basis.
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
std::map< int, ExpansionShPtr > ExpansionMap
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)