49 namespace MultiRegions
87 SpatialDomains::ExpansionMap::const_iterator expIt;
88 for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
95 if((TetGeom = boost::dynamic_pointer_cast<SpatialDomains::TetGeom>(expIt->second->m_geomShPtr)))
105 (*m_exp).push_back(tet);
132 else if((HexGeom = boost::dynamic_pointer_cast<SpatialDomains::HexGeom>(expIt->second->m_geomShPtr)))
135 (*m_exp).push_back(hex);
142 ASSERTL0(
false,
"dynamic cast to a proper Geometry3D failed");
172 const std::string &variable) :
184 = graph3D->GetExpansions(variable);
186 SpatialDomains::ExpansionMap::const_iterator expIt;
187 for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
194 if((TetGeom = boost::dynamic_pointer_cast<
198 = expIt->second->m_basisKeyVector[0];
200 = expIt->second->m_basisKeyVector[1];
202 = expIt->second->m_basisKeyVector[2];
207 ASSERTL0(
false,
"LocalRegions::NodalTetExp is not "
215 tet->SetElmtId(elmtid++);
216 (*m_exp).push_back(tet);
219 else if((PrismGeom = boost::dynamic_pointer_cast<SpatialDomains
220 ::PrismGeom>(expIt->second->m_geomShPtr)))
223 = expIt->second->m_basisKeyVector[0];
225 = expIt->second->m_basisKeyVector[1];
227 = expIt->second->m_basisKeyVector[2];
232 prism->SetElmtId(elmtid++);
233 (*m_exp).push_back(prism);
235 else if((PyrGeom = boost::dynamic_pointer_cast<
239 = expIt->second->m_basisKeyVector[0];
241 = expIt->second->m_basisKeyVector[1];
243 = expIt->second->m_basisKeyVector[2];
248 pyramid->SetElmtId(elmtid++);
249 (*m_exp).push_back(pyramid);
251 else if((HexGeom = boost::dynamic_pointer_cast<
255 = expIt->second->m_basisKeyVector[0];
257 = expIt->second->m_basisKeyVector[1];
259 = expIt->second->m_basisKeyVector[2];
264 hex->SetElmtId(elmtid++);
265 (*m_exp).push_back(hex);
269 ASSERTL0(
false,
"dynamic cast to a proper Geometry3D "
311 for(
int i = 0; i < expansions.size(); ++i)
318 SpatialDomains::ExpansionMap::const_iterator expmap = expansions.find(i);
319 ASSERTL1(expmap != expansions.end(),
"Unable to find expansion.");
322 if((TetGeom = boost::dynamic_pointer_cast<
326 = exp->m_basisKeyVector[0];
328 = exp->m_basisKeyVector[1];
330 = exp->m_basisKeyVector[2];
335 ASSERTL0(
false,
"LocalRegions::NodalTetExp is not "
343 tet->SetElmtId(elmtid++);
344 (*m_exp).push_back(tet);
347 else if((PrismGeom = boost::dynamic_pointer_cast<
351 = exp->m_basisKeyVector[0];
353 = exp->m_basisKeyVector[1];
355 = exp->m_basisKeyVector[2];
360 prism->SetElmtId(elmtid++);
361 (*m_exp).push_back(prism);
363 else if((PyrGeom = boost::dynamic_pointer_cast<
367 = exp->m_basisKeyVector[0];
369 = exp->m_basisKeyVector[1];
371 = exp->m_basisKeyVector[2];
376 pyramid->SetElmtId(elmtid++);
377 (*m_exp).push_back(pyramid);
379 else if((HexGeom = boost::dynamic_pointer_cast<
383 = exp->m_basisKeyVector[0];
385 = exp->m_basisKeyVector[1];
387 = exp->m_basisKeyVector[2];
392 hex->SetElmtId(elmtid++);
393 (*m_exp).push_back(hex);
397 ASSERTL0(
false,
"dynamic cast to a proper Geometry3D "
435 for(i = 0; i <
m_exp->size(); ++i)
439 m_offset_elmt_id[i] = i;
440 m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
441 m_npoints += (*m_exp)[i]->GetTotPoints();
454 switch ((*
m_exp)[i]->DetShapeType())
461 ASSERTL0(
false,
"Unknown expansion type.");
474 int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
475 int nquad1 = (*m_exp)[expansion]->GetNumPoints(1);
476 int nquad2 = (*m_exp)[expansion]->GetNumPoints(2);
477 int ntot = nquad0*nquad1*nquad2;
478 int ntotminus = (nquad0-1)*(nquad1-1)*(nquad2-1);
484 (*m_exp)[expansion]->GetCoords(coords[0],coords[1],coords[2]);
486 outfile <<
" <Piece NumberOfPoints=\""
487 << ntot <<
"\" NumberOfCells=\""
488 << ntotminus <<
"\">" << endl;
489 outfile <<
" <Points>" << endl;
490 outfile <<
" <DataArray type=\"Float64\" "
491 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
493 for (i = 0; i < ntot; ++i)
495 for (j = 0; j < 3; ++j)
497 outfile << setprecision(8) << scientific
498 << (float)coords[j][i] <<
" ";
504 outfile <<
" </DataArray>" << endl;
505 outfile <<
" </Points>" << endl;
506 outfile <<
" <Cells>" << endl;
507 outfile <<
" <DataArray type=\"Int32\" "
508 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
509 for (i = 0; i < nquad0-1; ++i)
511 for (j = 0; j < nquad1-1; ++j)
513 for (k = 0; k < nquad2-1; ++k)
515 outfile << k*nquad0*nquad1 + j*nquad0 + i <<
" "
516 << k*nquad0*nquad1 + j*nquad0 + i + 1 <<
" "
517 << k*nquad0*nquad1 + (j+1)*nquad0 + i + 1 <<
" "
518 << k*nquad0*nquad1 + (j+1)*nquad0 + i <<
" "
519 << (k+1)*nquad0*nquad1 + j*nquad0 + i <<
" "
520 << (k+1)*nquad0*nquad1 + j*nquad0 + i + 1 <<
" "
521 << (k+1)*nquad0*nquad1 + (j+1)*nquad0 + i + 1 <<
" "
522 << (k+1)*nquad0*nquad1 + (j+1)*nquad0 + i <<
" " << endl;
527 outfile <<
" </DataArray>" << endl;
528 outfile <<
" <DataArray type=\"Int32\" "
529 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
530 for (i = 0; i < ntotminus; ++i)
532 outfile << i*8+8 <<
" ";
535 outfile <<
" </DataArray>" << endl;
536 outfile <<
" <DataArray type=\"UInt8\" "
537 <<
"Name=\"types\" format=\"ascii\">" << endl;
538 for (i = 0; i < ntotminus; ++i)
543 outfile <<
" </DataArray>" << endl;
544 outfile <<
" </Cells>" << endl;
545 outfile <<
" <PointData>" << endl;
551 for (i = 0; i <
m_exp->size(); ++i)
553 for (j = 0; j < (*m_exp)[i]->GetNfaces(); ++j)
555 (*m_exp)[i]->ComputeFaceNormal(j);
570 int pt0 = (*m_exp)[i]->GetNumPoints(0);
571 int pt1 = (*m_exp)[i]->GetNumPoints(1);
572 int pt2 = (*m_exp)[i]->GetNumPoints(2);
573 int npt0 = (int) pt0*scale;
574 int npt1 = (int) pt1*scale;
575 int npt2 = (int) pt2*scale;
583 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
584 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(),
585 &inarray[cnt], newPointsKey0,
586 newPointsKey1, newPointsKey2,
590 cnt1 += npt0*npt1*npt2;
604 int pt0 = (*m_exp)[i]->GetNumPoints(0);
605 int pt1 = (*m_exp)[i]->GetNumPoints(1);
606 int pt2 = (*m_exp)[i]->GetNumPoints(2);
607 int npt0 = (int) pt0*scale;
608 int npt1 = (int) pt1*scale;
609 int npt2 = (int) pt2*scale;
620 (*
m_exp)[i]->GetBasis(0)->GetPointsKey(),
621 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
622 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(),
625 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)