48     namespace MultiRegions
 
   86             ExpList(In,DeclareCoeffPhysArrays)
 
   95                              const std::vector<unsigned int> &eIDs,
 
   96                              const bool DeclareCoeffPhysArrays):
 
   97             ExpList(In, eIDs, DeclareCoeffPhysArrays)
 
  141                                                     = graph1D->GetExpansions();
 
  145             SpatialDomains::ExpansionMap::const_iterator expIt;
 
  146             for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
 
  148                 if ((SegmentGeom = boost::dynamic_pointer_cast<
 
  150                              expIt->second->m_geomShPtr)))
 
  154                     seg->SetElmtId(
id++);
 
  155                     (*m_exp).push_back(seg);
 
  159                     ASSERTL0(
false,
"dynamic cast to a SegGeom failed");
 
  201                 const bool DeclareCoeffPhysArrays):
 
  212                                                     = graph1D->GetExpansions();
 
  215             SpatialDomains::ExpansionMap::const_iterator expIt;
 
  216             for (expIt = expansions.begin(); expIt != expansions.end(); ++expIt)
 
  221                 if ((SegmentGeom = boost::dynamic_pointer_cast<
 
  223                              expIt->second->m_geomShPtr)))
 
  229                     seg->SetElmtId(
id++);
 
  232                     (*m_exp).push_back(seg);
 
  236                     ASSERTL0(
false,
"dynamic cast to a SegGeom failed");
 
  248             if(DeclareCoeffPhysArrays)
 
  285                              const bool DeclareCoeffPhysArrays,
 
  286                              const std::string var,
 
  287                              bool SetToOneSpaceDimension):
 
  294             SpatialDomains::CompositeMap::const_iterator compIt;
 
  298                 = graph1D->GetExpansions(var);
 
  301             for(compIt = domain.begin(); compIt != domain.end(); ++compIt)
 
  303                 comp = compIt->second;
 
  306                 for(j = 0; j < compIt->second->size(); ++j)
 
  308                     SpatialDomains::ExpansionMap::const_iterator expIt;
 
  310                     if((SegmentGeom = boost::dynamic_pointer_cast<
 
  312                                 (*compIt->second)[j])))
 
  315                         if((expIt = expansions.find(SegmentGeom->GetGlobalID())) != expansions.end())
 
  319                             if(SetToOneSpaceDimension)
 
  322                                     SegmentGeom->GenerateOneSpaceDimGeom();
 
  335                             ASSERTL0(
false,
"Failed to find basis key");
 
  341                         ASSERTL0(
false,
"Failed to dynamic cast geometry to SegGeom");
 
  346                     seg->SetElmtId(
id++);
 
  349                     (*m_exp).push_back(seg);
 
  361             if(DeclareCoeffPhysArrays)
 
  389                              const bool DeclareCoeffPhysArrays,
 
  390                              const std::string variable):
 
  399             SpatialDomains::CompositeMap::const_iterator compIt;
 
  404             for(compIt = domain.begin(); compIt != domain.end(); ++compIt)
 
  406                 comp = compIt->second;
 
  408                 for(j = 0; j < compIt->second->size(); ++j)
 
  410                     if((SegmentGeom = boost::dynamic_pointer_cast<
 
  412                                 (*compIt->second)[j])))
 
  422                         seg->SetElmtId(
id++);
 
  423                         (*m_exp).push_back(seg);
 
  427                         ASSERTL0(
false,
"dynamic cast to a SegGeom failed");
 
  442             if(DeclareCoeffPhysArrays)
 
  474             const bool DeclareCoeffPhysArrays,
 
  475             const std::string variable):
 
  478             int i, j, id, elmtid = 0;
 
  490             map<int,int> EdgeDone;
 
  491             map<int,int> NormalSet;
 
  497             for(i = 0; i < bndCond.num_elements(); ++i)
 
  499                 if(bndCond[i]->GetBoundaryConditionType()
 
  502                     for(j = 0; j < bndConstraint[i]->GetExpSize(); ++j)
 
  505                                     ->GetExp(j)->GetBasis(0)->GetBasisKey();
 
  506                         exp1D = bndConstraint[i]->GetExp(j)->
 
  507                                     as<LocalRegions::Expansion1D>();
 
  508                         segGeom = exp1D->GetGeom1D();
 
  512                         edgesDone.insert(segGeom->GetEid());
 
  514                         seg->SetElmtId(elmtid++);
 
  515                         (*m_exp).push_back(seg);
 
  525             for(i = 0; i < locexp.size(); ++i)
 
  529                 for(j = 0; j < locexp[i]->GetNedges(); ++j)
 
  531                     segGeom = exp2D->
GetGeom2D()->GetEdge(j);
 
  532                     id      = segGeom->GetEid();
 
  534                     if (edgesDone.count(
id) != 0)
 
  539                     it = edgeOrders.find(
id);
 
  541                     if (it == edgeOrders.end())
 
  543                         edgeOrders.insert(std::make_pair(
id, std::make_pair(
 
  544                             segGeom, locexp[i]->DetEdgeBasisKey(j))));
 
  549                             = locexp[i]->DetEdgeBasisKey(j);
 
  558                         if (np2 >= np1 && nm2 >= nm1)
 
  562                         else if (np2 < np1 && nm2 < nm1)
 
  564                             it->second.second = edge;
 
  569                                 "inappropriate number of points/modes (max " 
  570                                 "num of points is not set with max order)");
 
  577                 pSession->GetComm()->GetRowComm();
 
  578             int nproc = vComm->GetSize(); 
 
  579             int edgepr = vComm->GetRank(); 
 
  586                 for(i = 0; i < locexp.size(); ++i)
 
  588                     eCnt += locexp[i]->GetNedges();
 
  594                 edgesCnt[edgepr] = eCnt;
 
  600                 for (i = 1; i < nproc; ++i)
 
  602                     eTotOffsets[i] = eTotOffsets[i-1] + edgesCnt[i-1];
 
  610                 int cntr = eTotOffsets[edgepr];
 
  612                 for(i = 0; i < locexp.size(); ++i)
 
  618                     for(j = 0; j < nedges; ++j, ++cntr)
 
  621                                               locexp[i]->DetEdgeBasisKey(j);
 
  622                         EdgesTotID  [cntr] = exp2D->GetGeom2D()->GetEid(j);
 
  632                 for (i = 0; i < totEdgeCnt; ++i)
 
  634                     it = edgeOrders.find(EdgesTotID[i]);
 
  636                     if (it == edgeOrders.end())
 
  654                     if (np2 >= np1 && nm2 >= nm1)
 
  658                     else if (np2 < np1 && nm2 < nm1)
 
  660                         it->second.second = edge;
 
  665                                  "inappropriate number of points/modes (max " 
  666                                  "num of points is not set with max order)");
 
  671             for (it = edgeOrders.begin(); it != edgeOrders.end(); ++it)
 
  675                 seg->SetElmtId(elmtid++);
 
  676                 (*m_exp).push_back(seg);
 
  688             if(DeclareCoeffPhysArrays)
 
  718             for(i = 0; i < 
m_exp->size(); ++i)
 
  722                 m_offset_elmt_id[i] = i;
 
  723                 m_ncoeffs += (*m_exp)[i]->GetNcoeffs();
 
  724                 m_npoints += (*m_exp)[i]->GetTotPoints();
 
  758             int quad_npoints = elmExp->GetTotPoints();
 
  760                                                     elmExp->GetPointsType(0));
 
  767             int kernel_width = kernel->GetKernelWidth();
 
  774             for(i = 0; i < inarray.num_elements(); i++)
 
  777                 kernel->MoveKernelCenter(inarray[i],local_kernel_breaks);
 
  781                 kernel->FindMeshUnderKernel(local_kernel_breaks,h,mesh_breaks);
 
  784                 int total_nbreaks = local_kernel_breaks.num_elements() +
 
  785                                     mesh_breaks.num_elements();
 
  788                 kernel->Sort(local_kernel_breaks,mesh_breaks,total_breaks);
 
  793                 for(j = 0; j < total_breaks.num_elements()-1; j++)
 
  799                     for(r = 0; r < quad_points.num_elements(); r++)
 
  801                         mapped_quad_points[r]
 
  802                                 = (quad_points[r] + 1.0) * 0.5 * (b - a) + a;
 
  811                                  elmExp->GetBasisNumModes(0),u_value);
 
  815                     kernel->EvaluateKernel(mapped_quad_points,h,k_value);
 
  818                     for(r = 0; r < quad_npoints; r++)
 
  820                         integral_value += (b - a) * 0.5 * k_value[r]
 
  821                                                 * u_value[r] * quad_weights[r];
 
  824                 outarray[i] = integral_value/h;
 
  855             for(i = 0; i < outarray.num_elements(); i++)
 
  861             int x_size = inarray2.num_elements();
 
  866             for(i = 0; i < x_size; i++ )
 
  868                 x_elm[i] = (int)floor(inarray2[i]/h);
 
  872             for(i = 0; i < x_size; i++)
 
  878                 while(x_elm[i] >= num_elm)
 
  880                     x_elm[i] -= num_elm ;
 
  885             for(i = 0; i < x_size; i++)
 
  887                 x_values_cp[i] = (inarray2[i]/h - floor(inarray2[i]/h))*2 - 1.0;
 
  894             for(i = 0; i < nmodes; i++)
 
  897                                     jacobi_poly.get()+i*x_size,NULL,i,0.0,0.0);
 
  901             for(r = 0; r < nmodes; r++)
 
  903                 for(j = 0; j < x_size; j++)
 
  905                     int index = ((x_elm[j])*nmodes)+r;
 
  906                     outarray[j] += inarray1[index]*jacobi_poly[r][j];
 
  950             for (i = 0; i < 
m_exp->size(); ++i)
 
  952                 for (j = 0; j < (*m_exp)[i]->GetNverts(); ++j)
 
  954                     (*m_exp)[i]->ComputeVertexNormal(j);
 
  975             int i,j,k,e_npoints,offset;
 
  982             ASSERTL1(Vec.num_elements() >= coordim,
 
  983                     "Input vector does not have sufficient dimensions to " 
  987             for(i = 0; i < 
m_exp->size(); ++i)
 
  990                 e_npoints = (*m_exp)[i]->GetNumPoints(0);
 
  991                 normals   = (*m_exp)[i]->GetPhysNormals();
 
  997                 for(j = 0; j < e_npoints; ++j)
 
 1001                     for(k = 0; k < coordim; ++k)
 
 1003                         Vn += Vec[k][offset+j]*normals[k*e_npoints + j];
 
 1009                         Upwind[offset + j] = Fwd[offset + j];
 
 1013                         Upwind[offset + j] = Bwd[offset + j];
 
 1038             int i,j,e_npoints,offset;
 
 1042             for(i = 0; i < 
m_exp->size(); ++i)
 
 1045                 e_npoints = (*m_exp)[i]->GetNumPoints(0);
 
 1049                 for(j = 0; j < e_npoints; ++j)
 
 1052                     if(Vn[offset + j] > 0.0)
 
 1054                         Upwind[offset + j] = Fwd[offset + j];
 
 1058                         Upwind[offset + j] = Bwd[offset + j];
 
 1075             int i,j,k,e_npoints,offset;
 
 1083             ASSERTL1(normals.num_elements() >= coordim,
 
 1084                      "Output vector does not have sufficient dimensions to " 
 1087             for (i = 0; i < 
m_exp->size(); ++i)
 
 1094                 int edgeNumber = loc_exp->GetLeftAdjacentElementEdge();
 
 1097                 e_npoints  = (*m_exp)[i]->GetNumPoints(0);
 
 1099                 locnormals = loc_elmt->GetEdgeNormal(edgeNumber);
 
 1100         int e_nmodes   = loc_exp->GetBasis(0)->GetNumModes();
 
 1101                 int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
 
 1103                 if (e_nmodes != loc_nmodes)
 
 1105             if (loc_exp->GetRightAdjacentElementEdge() >= 0)
 
 1108                                        loc_exp->GetRightAdjacentElementExp();
 
 1110             int EdgeNumber = loc_exp->GetRightAdjacentElementEdge();
 
 1113                         locnormals = loc_elmt->GetEdgeNormal(EdgeNumber);
 
 1118                         for (j = 0; j < e_npoints; ++j)
 
 1122                             for (k = 0; k < coordim; ++k)
 
 1124                                 normals[k][offset + j] = -locnormals[k][j];
 
 1133                         for (
int p = 0; p < coordim; ++p)
 
 1137                                 loc_exp->GetBasis(0)->GetPointsKey();
 
 1139                                 loc_elmt->GetBasis(0)->GetPointsKey();
 
 1149                         for (j = 0; j < e_npoints; ++j)
 
 1153                             for (k = 0; k < coordim; ++k)
 
 1155                                 normals[k][offset + j] = normal[k][j];
 
 1166                     for (j = 0; j < e_npoints; ++j)
 
 1170                         for (k = 0; k < coordim; ++k)
 
 1172                             normals[k][offset + j] = locnormals[k][j];
 
 1204             int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
 
 1206             int ntotminus = (nquad0-1);
 
 1212             (*m_exp)[expansion]->GetCoords(coords[0],coords[1],coords[2]);
 
 1214             outfile << 
"    <Piece NumberOfPoints=\"" 
 1215                     << ntot << 
"\" NumberOfCells=\"" 
 1216                     << ntotminus << 
"\">" << endl;
 
 1217             outfile << 
"      <Points>" << endl;
 
 1218             outfile << 
"        <DataArray type=\"Float32\" " 
 1219                     << 
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
 
 1221             for (i = 0; i < ntot; ++i)
 
 1223                 for (j = 0; j < 3; ++j)
 
 1225                     outfile << setprecision(8) << scientific 
 
 1226                             << (float)coords[j][i] << 
" ";
 
 1231             outfile << 
"        </DataArray>" << endl;
 
 1232             outfile << 
"      </Points>" << endl;
 
 1233             outfile << 
"      <Cells>" << endl;
 
 1234             outfile << 
"        <DataArray type=\"Int32\" " 
 1235                     << 
"Name=\"connectivity\" format=\"ascii\">" << endl;
 
 1236             for (i = 0; i < nquad0-1; ++i)
 
 1238                 outfile << i << 
" " << i+1 << endl;
 
 1241             outfile << 
"        </DataArray>" << endl;
 
 1242             outfile << 
"        <DataArray type=\"Int32\" " 
 1243                     << 
"Name=\"offsets\" format=\"ascii\">" << endl;
 
 1244             for (i = 0; i < ntotminus; ++i)
 
 1246                 outfile << i*2+2 << 
" ";
 
 1249             outfile << 
"        </DataArray>" << endl;
 
 1250             outfile << 
"        <DataArray type=\"UInt8\" " 
 1251                     << 
"Name=\"types\" format=\"ascii\">" << endl;
 
 1252             for (i = 0; i < ntotminus; ++i)
 
 1257             outfile << 
"        </DataArray>" << endl;
 
 1258             outfile << 
"      </Cells>" << endl;
 
 1259             outfile << 
"      <PointData>" << endl;
 
const Array< OneD, const NekDouble > & GetCoeffs() const 
This function returns (a reference to) the array  (implemented as m_coeffs) containing all local expa...
ExpList1D()
The default constructor. 
#define ASSERTL0(condition, msg)
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool. 
std::map< int, vector< PeriodicEntity > > PeriodicMap
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
BasisType GetBasisType() const 
Return type of expansion basis. 
const boost::shared_ptr< LocalRegions::ExpansionVector > GetExp() const 
This function returns the vector of elements in the expansion. 
PointsType GetPointsType() const 
Return type of quadrature. 
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points. 
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< SessionReader > SessionReaderSharedPtr
virtual void v_SetUpPhysNormals()
Set up the normals on each expansion. 
std::vector< ExpansionSharedPtr > ExpansionVector
Expansion2DSharedPtr GetLeftAdjacentElementExp() const 
void v_Upwind(const Array< OneD, const Array< OneD, NekDouble > > &Vec, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
Upwind the Fwd and Bwd states based on the velocity field given by Vec. 
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs. 
boost::shared_ptr< SegExp > SegExpSharedPtr
Base class for all multi-elemental spectral/hp expansions. 
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object. 
SpatialDomains::Geometry2DSharedPtr GetGeom2D() const 
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions. 
boost::shared_ptr< SegGeom > SegGeomSharedPtr
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys. 
void PeriodicEval(Array< OneD, NekDouble > &inarray1, Array< OneD, NekDouble > &inarray2, NekDouble h, int nmodes, Array< OneD, NekDouble > &outarray)
Evaluates the global spectral/hp expansion at some arbitray set of points. 
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. 
boost::shared_ptr< Kernel > KernelSharedPtr
PointsManagerT & PointsManager(void)
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list. 
Defines a specification for a set of points. 
boost::shared_ptr< GeometryVector > Composite
std::map< int, Composite > CompositeMap
void SetCoeffPhysOffsets(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
boost::shared_ptr< Geometry2D > Geometry2DSharedPtr
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions. 
void Interp1D(const BasisKey &fbasis0, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, Array< OneD, NekDouble > &to)
this function interpolates a 1D function  evaluated at the quadrature points of the basis fbasis0 to ...
This class is the abstraction of a one-dimensional multi-elemental expansions which is merely a colle...
boost::shared_ptr< Geometry1D > Geometry1DSharedPtr
void PostProcess(LibUtilities::KernelSharedPtr kernel, Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray, NekDouble h, int elmId=0)
Performs the post-processing on a specified element. 
virtual void v_ReadGlobalOptimizationParameters()
void ReadGlobalOptimizationParameters()
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid. 
int GetNumModes() const 
Returns the order of the basis. 
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
const StdRegions::StdExpansionVector &locexp); 
void SetExpType(ExpansionType Type)
Returns the type of the expansion. 
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x) 
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
boost::shared_ptr< Expansion1D > Expansion1DSharedPtr
int GetNedges() const 
This function returns the number of edges of the expansion domain. 
virtual ~ExpList1D()
Destructor. 
Describes the specification for a Basis. 
void jacobfd(const int np, const double *z, double *poly_in, double *polyd, const int n, const double alpha, const double beta)
Routine to calculate Jacobi polynomials, , and their first derivative, . 
std::map< int, ExpansionShPtr > ExpansionMap
boost::shared_ptr< Expansion2D > Expansion2DSharedPtr