56 namespace MultiRegions
92 ::AllocateSharedPtr()),
110 m_comm(pSession->GetComm()),
119 ::AllocateSharedPtr()),
138 m_comm(pSession->GetComm()),
147 ::AllocateSharedPtr()),
164 m_session(in.m_session),
166 m_ncoeffs(in.m_ncoeffs),
167 m_npoints(in.m_npoints),
170 m_coeff_offset(in.m_coeff_offset),
171 m_phys_offset(in.m_phys_offset),
172 m_offset_elmt_id(in.m_offset_elmt_id),
173 m_globalOptParam(in.m_globalOptParam),
174 m_blockMat(in.m_blockMat),
179 if(DeclareCoeffPhysArrays)
225 "local physical space is not true ");
248 const Array<OneD, const NekDouble> &inarray)
253 for(i = 0; i < (*m_exp).size(); ++i)
272 const Array<OneD,const NekDouble> &inarray,
273 Array<OneD, NekDouble> &outarray)
277 int nrows = blockmat->GetRows();
278 int ncols = blockmat->GetColumns();
285 out = (*blockmat)*in;
301 const Array<OneD, const NekDouble> &inarray,
302 Array<OneD, NekDouble> &outarray)
306 const Array<OneD, const bool> doBlockMatOp
308 const Array<OneD, LibUtilities::ShapeType> shape =
m_globalOptParam->GetShapeList();
309 const Array<OneD, const int> num_elmts =
m_globalOptParam->GetShapeNumElements();
311 Array<OneD,NekDouble> tmp_outarray;
314 for(
int n = 0; n < shape.num_elements(); ++n)
331 for(i = 0; i < num_elmts[n]; ++i)
355 const Array<OneD, const NekDouble> &inarray,
356 Array<OneD, NekDouble> &outarray)
360 Array<OneD,NekDouble> e_outarray;
362 for(i = 0; i < (*m_exp).size(); ++i)
364 (*m_exp)[i]->IProductWRTDerivBase(dir,inarray+
m_phys_offset[i],
404 Array<OneD, NekDouble> &out_d0,
405 Array<OneD, NekDouble> &out_d1,
406 Array<OneD, NekDouble> &out_d2)
409 Array<OneD, NekDouble> e_out_d0;
410 Array<OneD, NekDouble> e_out_d1;
411 Array<OneD, NekDouble> e_out_d2;
413 for(i= 0; i < (*m_exp).size(); ++i)
416 if(out_d1.num_elements())
418 e_out_d1 = out_d1 + m_phys_offset[i];
421 if(out_d2.num_elements())
423 e_out_d2 = out_d2 + m_phys_offset[i];
425 (*m_exp)[i]->PhysDeriv(inarray+m_phys_offset[i],e_out_d0,e_out_d1,e_out_d2);
430 const Array<OneD, const NekDouble> &inarray,
431 Array<OneD, NekDouble> &out_d)
438 Array<OneD, NekDouble> &out_d)
443 Array<OneD, NekDouble> e_out_ds;
444 for(i=0; i<(*m_exp).size(); ++i)
447 (*m_exp)[i]->PhysDeriv_s(inarray+m_phys_offset[i],e_out_ds);
452 Array<OneD, NekDouble > e_out_dn;
453 for(i=0; i<(*m_exp).size(); i++)
456 (*m_exp)[i]->PhysDeriv_n(inarray+m_phys_offset[i],e_out_dn);
462 int intdir= (int)edir;
463 Array<OneD, NekDouble> e_out_d;
464 for(i= 0; i < (*m_exp).size(); ++i)
467 (*m_exp)[i]->PhysDeriv(intdir, inarray+m_phys_offset[i], e_out_d);
483 const Array<OneD, const NekDouble> &inarray,
484 Array<OneD, NekDouble> &outarray)
491 if(inarray.get() == outarray.get())
522 Array<OneD, NekDouble> &outarray)
532 const Array<OneD, const NekDouble>& inarray,
533 Array<OneD, NekDouble> &outarray)
537 Array<OneD,NekDouble> e_outarray;
539 for(i= 0; i < (*m_exp).size(); ++i)
541 (*m_exp)[i]->FwdTrans_BndConstrained(inarray+
m_phys_offset[i],
567 (*
m_exp)[0]->GetBasisType(0)
569 "Smoothing is currently not allowed unless you are using "
570 "a nodal base for efficiency reasons. The implemented "
571 "smoothing technique requires the mass matrix inversion "
572 "which is trivial just for GLL_LAGRANGE_SEM and "
573 "GAUSS_LAGRANGE_SEMexpansions.");
602 map<int,int> elmt_id;
607 for(i = 0 ; i < (*m_exp).size(); ++i)
618 n_exp = (*m_exp).size();
619 for(i = 0; i < n_exp; ++i)
625 Array<OneD,unsigned int> nrows(n_exp);
626 Array<OneD,unsigned int> ncols(n_exp);
633 for(i = 0; i < n_exp; ++i)
635 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
636 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
643 for(i = 0; i < n_exp; ++i)
645 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
646 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
657 for(i = 0; i < n_exp; ++i)
659 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
660 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
668 for(i = 0; i < n_exp; ++i)
670 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
671 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
679 for(i = 0; i < n_exp; ++i)
681 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
682 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
690 "Global Matrix creation not defined for this type "
701 Array<OneD, NekDouble> varcoeffs_wk;
703 for(i = cnt1 = 0; i < n_exp; ++i)
711 StdRegions::VarCoeffMap::const_iterator x;
719 (*m_exp)[eid]->DetShapeType(),
724 loc_mat = boost::dynamic_pointer_cast<
LocalRegions::Expansion>((*m_exp)[elmt_id.find(i)->second])->GetLocMatrix(matkey);
725 BlkMatrix->SetBlock(i,i,loc_mat);
742 return matrixIter->second;
748 const Array<OneD,const NekDouble> &inarray,
749 Array<OneD, NekDouble> &outarray)
751 const Array<OneD, const bool> doBlockMatOp
753 const Array<OneD, const int> num_elmts
756 Array<OneD,NekDouble> tmp_outarray;
759 for(
int n = 0; n < num_elmts.num_elements(); ++n)
779 for(i= 0; i < num_elmts[n]; ++i)
787 StdRegions::VarCoeffMap::const_iterator x;
795 (*m_exp)[eid]->DetShapeType(),
818 int i,j,n,gid1,gid2,cntdim1,cntdim2;
822 unsigned int glob_rows;
823 unsigned int glob_cols;
824 unsigned int loc_rows;
825 unsigned int loc_cols;
827 bool assembleFirstDim;
828 bool assembleSecondDim;
835 glob_cols = locToGloMap->GetNumGlobalCoeffs();
837 assembleFirstDim =
false;
838 assembleSecondDim =
true;
843 glob_rows = locToGloMap->GetNumGlobalCoeffs();
846 assembleFirstDim =
true;
847 assembleSecondDim =
false;
855 glob_rows = locToGloMap->GetNumGlobalCoeffs();
856 glob_cols = locToGloMap->GetNumGlobalCoeffs();
858 assembleFirstDim =
true;
859 assembleSecondDim =
true;
865 "Global Matrix creation not defined for this type "
877 for(n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
885 StdRegions::VarCoeffMap::const_iterator x;
893 (*m_exp)[eid]->DetShapeType(),
899 loc_rows = loc_mat->GetRows();
900 loc_cols = loc_mat->GetColumns();
902 for(i = 0; i < loc_rows; ++i)
906 gid1 = locToGloMap->GetLocalToGlobalMap (cntdim1 + i);
907 sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
915 for(j = 0; j < loc_cols; ++j)
917 if(assembleSecondDim)
920 ->GetLocalToGlobalMap(cntdim2 + j);
922 ->GetLocalToGlobalSign(cntdim2 + j);
931 coord = make_pair(gid1,gid2);
932 if( spcoomat.count(coord) == 0 )
934 spcoomat[coord] = sign1*sign2*(*loc_mat)(i,j);
938 spcoomat[coord] += sign1*sign2*(*loc_mat)(i,j);
953 int i,j,n,gid1,gid2,loc_lda,eid;
957 int totDofs = locToGloMap->GetNumGlobalCoeffs();
958 int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
960 unsigned int rows = totDofs - NumDirBCs;
961 unsigned int cols = totDofs - NumDirBCs;
965 int bwidth = locToGloMap->GetFullSystemBandWidth();
977 if( (2*(bwidth+1)) < rows)
997 for(n = 0; n < (*m_exp).size(); ++n)
1005 StdRegions::VarCoeffMap::const_iterator x;
1013 (*m_exp)[eid]->DetShapeType(),
1020 if(RobinBCInfo.count(n) != 0)
1025 int rows = loc_mat->GetRows();
1026 int cols = loc_mat->GetColumns();
1027 const NekDouble *dat = loc_mat->GetRawPtr();
1029 Blas::Dscal(rows*cols,loc_mat->Scale(),new_mat->GetRawPtr(),1);
1032 for(rBC = RobinBCInfo.find(n)->second;rBC; rBC = rBC->next)
1034 (*m_exp)[n]->AddRobinMassMatrix(rBC->m_robinID,rBC->m_robinPrimitiveCoeffs,new_mat);
1042 loc_lda = loc_mat->GetColumns();
1044 for(i = 0; i < loc_lda; ++i)
1046 gid1 = locToGloMap->GetLocalToGlobalMap(
m_coeff_offset[n] + i) - NumDirBCs;
1047 sign1 = locToGloMap->GetLocalToGlobalSign(
m_coeff_offset[n] + i);
1050 for(j = 0; j < loc_lda; ++j)
1052 gid2 = locToGloMap->GetLocalToGlobalMap(
m_coeff_offset[n] + j) - NumDirBCs;
1053 sign2 = locToGloMap->GetLocalToGlobalSign(
m_coeff_offset[n] + j);
1060 if((matStorage ==
eFULL)||(gid2 >= gid1))
1062 value = Gmat->GetValue(gid1,gid2) + sign1*sign2*(*loc_mat)(i,j);
1063 Gmat->SetValue(gid1,gid2,value);
1103 ASSERTL0(
false,
"Matrix solution type not defined");
1108 vExpList, locToGloMap);
1116 const map<int,RobinBCInfoSharedPtr> vRobinBCInfo =
GetRobinBCInfo();
1122 ASSERTL0(
false,
"Matrix solution type not defined");
1127 vExpList,locToGloMap);
1149 Array<OneD, NekDouble> &outarray)
1153 const Array<OneD, const bool> doBlockMatOp
1155 const Array<OneD, LibUtilities::ShapeType> shape =
m_globalOptParam->GetShapeList();
1156 const Array<OneD, const int> num_elmts =
m_globalOptParam->GetShapeNumElements();
1158 Array<OneD,NekDouble> tmp_outarray;
1161 for(
int n = 0; n < num_elmts.num_elements(); ++n)
1171 cnt += num_elmts[n];
1178 for(i= 0; i < num_elmts[n]; ++i)
1189 const Array<OneD, const NekDouble> &gloCoord)
1191 Array<OneD, NekDouble> stdCoord(
GetCoordim(0),0.0);
1192 for (
int i = 0; i < (*m_exp).size(); ++i)
1194 if ((*
m_exp)[i]->GetGeom()->ContainsPoint(gloCoord))
1199 ASSERTL0(
false,
"Cannot find element for this point.");
1210 const Array<OneD, const NekDouble> &gloCoord,
1212 bool returnNearestElmt)
1214 Array<OneD, NekDouble> Lcoords(gloCoord.num_elements());
1216 return GetExpIndex(gloCoord,Lcoords,tol,returnNearestElmt);
1221 Array<OneD, NekDouble> &locCoords,
1223 bool returnNearestElmt)
1231 std::vector<std::pair<int,NekDouble> > elmtIdDist;
1241 for (
int i = 0; i < (*m_exp).size(); ++i)
1243 if ((*
m_exp)[i]->GetGeom()->ContainsPoint(gloCoords,
1247 w.
SetX(gloCoords[0]);
1248 w.
SetY(gloCoords[1]);
1249 w.
SetZ(gloCoords[2]);
1252 for (
int j = 0; j < (*m_exp)[i]->GetNverts(); ++j) {
1254 (*
m_exp)[i]->GetGeom()->GetVid(j));
1255 if (j == 0 || dist > v->dist(w))
1260 elmtIdDist.push_back(
1261 std::pair<int, NekDouble>(i, dist));
1266 if (!elmtIdDist.empty())
1268 int min_id = elmtIdDist[0].first;
1271 for (
int i = 1; i < elmtIdDist.size(); ++i)
1273 if (elmtIdDist[i].second < min_d) {
1274 min_id = elmtIdDist[i].first;
1275 min_d = elmtIdDist[i].second;
1280 (*m_exp)[min_id]->GetGeom()->GetLocCoords(gloCoords,
1292 static int start = 0;
1295 Array<OneD, NekDouble> savLocCoords(locCoords.num_elements());
1298 for (
int i = start; i < (*m_exp).size(); ++i)
1300 if ((*
m_exp)[i]->GetGeom()->ContainsPoint(gloCoords, locCoords,
1308 if(resid < resid_min)
1312 Vmath::Vcopy(locCoords.num_elements(),savLocCoords,1,locCoords,1);
1317 for (
int i = 0; i < start; ++i)
1319 if ((*
m_exp)[i]->GetGeom()->ContainsPoint(gloCoords, locCoords,
1327 if(resid < resid_min)
1331 Vmath::Vcopy(locCoords.num_elements(),savLocCoords,1,locCoords,1);
1336 std::string msg =
"Failed to find point in element to tolerance of "
1337 + boost::lexical_cast<std::string>(resid)
1338 +
" using nearest point found";
1341 if(returnNearestElmt)
1343 Vmath::Vcopy(locCoords.num_elements(),locCoords,1,savLocCoords,1);
1373 int coordim =
GetExp(0)->GetCoordim();
1374 char vars[3] = {
'x',
'y',
'z' };
1385 outfile <<
"Variables = x";
1386 for (
int i = 1; i < coordim; ++i)
1388 outfile <<
", " << vars[i];
1393 outfile <<
", " << var;
1396 outfile << std::endl << std::endl;
1409 int nBases = (*m_exp)[0]->GetNumBases();
1412 Array<OneD, Array<OneD, NekDouble> > coords(3);
1414 if (expansion == -1)
1418 coords[0] = Array<OneD, NekDouble>(nPoints);
1419 coords[1] = Array<OneD, NekDouble>(nPoints);
1420 coords[2] = Array<OneD, NekDouble>(nPoints);
1422 GetCoords(coords[0], coords[1], coords[2]);
1424 for (i = 0; i <
m_exp->size(); ++i)
1428 for (j = 0; j < nBases; ++j)
1430 numInt *= (*m_exp)[i]->GetNumPoints(j)-1;
1433 numBlocks += numInt;
1438 nPoints = (*m_exp)[expansion]->GetTotPoints();
1440 coords[0] = Array<OneD, NekDouble>(nPoints);
1441 coords[1] = Array<OneD, NekDouble>(nPoints);
1442 coords[2] = Array<OneD, NekDouble>(nPoints);
1444 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
1447 for (j = 0; j < nBases; ++j)
1449 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j)-1;
1457 int nPlanes =
GetZIDs().num_elements();
1458 NekDouble tmp = numBlocks * (nPlanes-1.0) / nPlanes;
1459 numBlocks = (int)tmp;
1467 outfile <<
"Zone, N=" << nPoints <<
", E="
1468 << numBlocks <<
", F=FEBlock" ;
1473 outfile <<
", ET=QUADRILATERAL" << std::endl;
1476 outfile <<
", ET=BRICK" << std::endl;
1479 ASSERTL0(
false,
"Not set up for this type of output");
1484 for (j = 0; j < coordim; ++j)
1486 for (i = 0; i < nPoints; ++i)
1488 outfile << coords[j][i] <<
" ";
1489 if (i % 1000 == 0 && i)
1491 outfile << std::endl;
1494 outfile << std::endl;
1502 int nbase = (*m_exp)[0]->GetNumBases();
1505 boost::shared_ptr<LocalRegions::ExpansionVector> exp =
m_exp;
1507 if (expansion != -1)
1509 exp = boost::shared_ptr<LocalRegions::ExpansionVector>(
1511 (*exp)[0] = (*m_exp)[expansion];
1516 for(i = 0; i < (*exp).size(); ++i)
1518 const int np0 = (*exp)[i]->GetNumPoints(0);
1519 const int np1 = (*exp)[i]->GetNumPoints(1);
1521 for(j = 1; j < np1; ++j)
1523 for(k = 1; k < np0; ++k)
1525 outfile << cnt + (j-1)*np0 + k <<
" ";
1526 outfile << cnt + (j-1)*np0 + k+1 <<
" ";
1527 outfile << cnt + j *np0 + k+1 <<
" ";
1528 outfile << cnt + j *np0 + k << endl;
1535 else if (nbase == 3)
1537 for(i = 0; i < (*exp).size(); ++i)
1539 const int np0 = (*exp)[i]->GetNumPoints(0);
1540 const int np1 = (*exp)[i]->GetNumPoints(1);
1541 const int np2 = (*exp)[i]->GetNumPoints(2);
1542 const int np01 = np0*np1;
1544 for(j = 1; j < np2; ++j)
1546 for(k = 1; k < np1; ++k)
1548 for(l = 1; l < np0; ++l)
1550 outfile << cnt + (j-1)*np01 + (k-1)*np0 + l <<
" ";
1551 outfile << cnt + (j-1)*np01 + (k-1)*np0 + l+1 <<
" ";
1552 outfile << cnt + (j-1)*np01 + k *np0 + l+1 <<
" ";
1553 outfile << cnt + (j-1)*np01 + k *np0 + l <<
" ";
1554 outfile << cnt + j *np01 + (k-1)*np0 + l <<
" ";
1555 outfile << cnt + j *np01 + (k-1)*np0 + l+1 <<
" ";
1556 outfile << cnt + j *np01 + k *np0 + l+1 <<
" ";
1557 outfile << cnt + j *np01 + k *np0 + l << endl;
1566 ASSERTL0(
false,
"Not set up for this dimension");
1577 if (expansion == -1)
1585 for(
int i = 0; i < totpoints; ++i)
1587 outfile <<
m_phys[i] <<
" ";
1588 if(i % 1000 == 0 && i)
1590 outfile << std::endl;
1593 outfile << std::endl;
1598 int nPoints = (*m_exp)[expansion]->GetTotPoints();
1600 for (
int i = 0; i < nPoints; ++i)
1605 outfile << std::endl;
1611 outfile <<
"<?xml version=\"1.0\"?>" << endl;
1612 outfile <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
1613 <<
"byte_order=\"LittleEndian\">" << endl;
1614 outfile <<
" <UnstructuredGrid>" << endl;
1619 outfile <<
" </UnstructuredGrid>" << endl;
1620 outfile <<
"</VTKFile>" << endl;
1625 ASSERTL0(
false,
"Routine not implemented for this expansion.");
1630 outfile <<
" </PointData>" << endl;
1631 outfile <<
" </Piece>" << endl;
1638 int nq = (*m_exp)[expansion]->GetTotPoints();
1641 outfile <<
" <DataArray type=\"Float64\" Name=\""
1642 << var <<
"\">" << endl;
1645 for(i = 0; i < nq; ++i)
1650 outfile <<
" </DataArray>" << endl;
1672 const Array<OneD, const NekDouble> &inarray,
1673 const Array<OneD, const NekDouble> &soln)
1685 err = max(err, abs(inarray[i] - soln[i]));
1711 const Array<OneD, const NekDouble> &inarray,
1712 const Array<OneD, const NekDouble> &soln)
1719 for (i = 0; i < (*m_exp).size(); ++i)
1727 for (i = 0; i < (*m_exp).size(); ++i)
1745 for (i = 0; i < (*m_exp).size(); ++i)
1757 "This method is not defined or valid for this class type");
1758 Array<OneD, NekDouble> NoEnergy(1,0.0);
1765 "This method is not defined or valid for this class type");
1774 "This method is not defined or valid for this class type");
1782 "This method is not defined or valid for this class type");
1783 Array<OneD, unsigned int> NoModes(1);
1791 "This method is not defined or valid for this class type");
1792 Array<OneD, unsigned int> NoModes(1);
1801 "This method is not defined or valid for this class type");
1806 "This method is not defined or valid for this class type");
1810 const std::string &fileName,
1811 const std::string &varName,
1812 const boost::shared_ptr<ExpList> locExpList)
1814 string varString = fileName.substr(0, fileName.find_last_of(
"."));
1815 int j, k, len = varString.length();
1816 varString = varString.substr(len-1, len);
1818 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
1819 std::vector<std::vector<NekDouble> > FieldData;
1822 f.
Import(fileName, FieldDef, FieldData);
1825 for (j = 0; j < FieldDef.size(); ++j)
1827 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
1829 if (FieldDef[j]->m_fields[k] == varName)
1832 locExpList->ExtractDataToCoeffs(
1833 FieldDef[j], FieldData[j],
1834 FieldDef[j]->m_fields[k],
1835 locExpList->UpdateCoeffs());
1841 ASSERTL0(found,
"Could not find variable '"+varName+
1842 "' in file boundary condition "+fileName);
1843 locExpList->BwdTrans_IterPerExp(
1844 locExpList->GetCoeffs(),
1845 locExpList->UpdatePhys());
1866 const Array<OneD, const NekDouble> &inarray,
1867 const Array<OneD, const NekDouble> &soln)
1872 for (i = 0; i < (*m_exp).size(); ++i)
1886 Array<OneD, LibUtilities::BasisSharedPtr> &HomoBasis,
1887 std::vector<NekDouble> &HomoLen,
1888 std::vector<unsigned int> &HomoZIDs,
1889 std::vector<unsigned int> &HomoYIDs)
1896 ASSERTL1(NumHomoDir == HomoBasis.num_elements(),
"Homogeneous basis is not the same length as NumHomoDir");
1897 ASSERTL1(NumHomoDir == HomoLen.size(),
"Homogeneous length vector is not the same length as NumHomDir");
1900 switch((*
m_exp)[0]->GetShapeDimension())
1916 for(s = startenum; s <= endenum; ++s)
1918 std::vector<unsigned int> elementIDs;
1919 std::vector<LibUtilities::BasisType> basis;
1920 std::vector<unsigned int> numModes;
1921 std::vector<std::string> fields;
1924 bool UniOrder =
true;
1929 for(
int i = 0; i < (*m_exp).size(); ++i)
1931 if((*
m_exp)[i]->GetGeom()->GetShapeType() == shape)
1933 elementIDs.push_back((*
m_exp)[i]->GetGeom()->GetGlobalID());
1936 for(
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
1938 basis.push_back((*
m_exp)[i]->GetBasis(j)->GetBasisType());
1939 numModes.push_back((*
m_exp)[i]->GetBasis(j)->GetNumModes());
1943 for(n = 0 ; n < NumHomoDir; ++n)
1945 basis.push_back(HomoBasis[n]->GetBasisType());
1946 numModes.push_back(HomoBasis[n]->GetNumModes());
1953 ASSERTL0((*
m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
"Routine is not set up for multiple bases definitions");
1955 for(
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
1957 numModes.push_back((*
m_exp)[i]->GetBasis(j)->GetNumModes());
1958 if(numModes[j] != (*
m_exp)[i]->GetBasis(j)->GetNumModes())
1964 for(n = 0 ; n < NumHomoDir; ++n)
1966 numModes.push_back(HomoBasis[n]->GetNumModes());
1973 if(elementIDs.size() > 0)
1976 fielddef.push_back(fdef);
1987 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
2011 map<int, int> ElmtID_to_ExpID;
2012 for(i = 0; i < (*m_exp).size(); ++i)
2014 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2017 for(i = 0; i < fielddef->m_elementIDs.size(); ++i)
2019 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
2020 int datalen = (*m_exp)[eid]->GetNcoeffs();
2021 fielddata.insert(fielddata.end(),&coeffs[
m_coeff_offset[eid]],&coeffs[m_coeff_offset[eid]]+datalen);
2029 std::vector<NekDouble> &fielddata,
2031 Array<OneD, NekDouble> &coeffs)
2051 std::vector<NekDouble> &fielddata,
2053 Array<OneD, NekDouble> &coeffs)
2057 int modes_offset = 0;
2058 int datalen = fielddata.size()/fielddef->m_fields.size();
2061 for(i = 0; i < fielddef->m_fields.size(); ++i)
2063 if(fielddef->m_fields[i] == field)
2070 ASSERTL0(i != fielddef->m_fields.size(),
2071 "Field (" + field +
") not found in file.");
2074 map<int, int> elmtToExpId;
2079 for(i = (*m_exp).size()-1; i >= 0; --i)
2081 elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2084 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
2088 if (fielddef->m_uniOrder ==
true)
2094 fielddef->m_numModes, modes_offset);
2096 const int elmtId = fielddef->m_elementIDs[i];
2097 if (elmtToExpId.count(elmtId) == 0)
2103 expId = elmtToExpId[elmtId];
2105 if (datalen == (*
m_exp)[expId]->GetNcoeffs())
2112 (*m_exp)[expId]->ExtractDataToCoeffs(
2113 &fielddata[offset], fielddef->m_numModes,
2118 modes_offset += (*m_exp)[0]->GetNumBases();
2130 if(fromExpList->GetNcoeffs() ==
m_ncoeffs)
2136 std::vector<unsigned int> nummodes;
2137 for(i = 0; i < (*m_exp).size(); ++i)
2140 for(
int j= 0; j < fromExpList->GetExp(eid)->GetNumBases(); ++j)
2142 nummodes.push_back(fromExpList->GetExp(eid)->GetBasisNumModes(j));
2145 (*m_exp)[eid]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes,0,
2148 offset += fromExpList->GetExp(eid)->GetNcoeffs();
2154 const Array<OneD,const boost::shared_ptr<ExpList> >
2158 "This method is not defined or valid for this class type");
2159 static Array<OneD,const boost::shared_ptr<ExpList> > result;
2166 "This method is not defined or valid for this class type");
2167 static boost::shared_ptr<ExpList> result;
2172 const Array<
OneD,
const Array<OneD, NekDouble> > &Vec,
2173 const Array<OneD, const NekDouble> &Fwd,
2174 const Array<OneD, const NekDouble> &Bwd,
2175 Array<OneD, NekDouble> &Upwind)
2178 "This method is not defined or valid for this class type");
2182 const Array<OneD, const NekDouble> &Vn,
2183 const Array<OneD, const NekDouble> &Fwd,
2184 const Array<OneD, const NekDouble> &Bwd,
2185 Array<OneD, NekDouble> &Upwind)
2188 "This method is not defined or valid for this class type");
2194 "This method is not defined or valid for this class type");
2195 static boost::shared_ptr<ExpList> returnVal;
2202 "This method is not defined or valid for this class type");
2203 static boost::shared_ptr<AssemblyMapDG> result;
2209 return GetTraceMap()->GetBndCondTraceToGlobalTraceMap();
2213 Array<
OneD, Array<OneD, NekDouble> > &normals)
2216 "This method is not defined or valid for this class type");
2220 const Array<OneD, const NekDouble> &Fx,
2221 const Array<OneD, const NekDouble> &Fy,
2222 Array<OneD, NekDouble> &outarray)
2225 "This method is not defined or valid for this class type");
2229 const Array<OneD, const NekDouble> &Fn,
2230 Array<OneD, NekDouble> &outarray)
2233 "This method is not defined or valid for this class type");
2237 const Array<OneD, const NekDouble> &Fwd,
2238 const Array<OneD, const NekDouble> &Bwd,
2239 Array<OneD, NekDouble> &outarray)
2242 "This method is not defined or valid for this class type");
2246 Array<OneD,NekDouble> &Bwd)
2249 "This method is not defined or valid for this class type");
2253 const Array<OneD,const NekDouble> &field,
2254 Array<OneD,NekDouble> &Fwd,
2255 Array<OneD,NekDouble> &Bwd)
2258 "This method is not defined or valid for this class type");
2264 "This method is not defined or valid for this class type");
2268 const Array<OneD, const NekDouble> &inarray,
2269 Array<OneD,NekDouble> &outarray)
2272 "This method is not defined or valid for this class type");
2276 const Array<OneD,const NekDouble> &inarray,
2277 Array<OneD, NekDouble> &outarray,
2281 "This method is not defined or valid for this class type");
2285 const Array<OneD, const NekDouble> &inarray,
2286 Array<OneD, NekDouble> &outarray,
2290 const Array<OneD, const NekDouble> &dirForcing)
2292 ASSERTL0(
false,
"HelmSolve not implemented.");
2296 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
2297 const Array<OneD, const NekDouble> &inarray,
2298 Array<OneD, NekDouble> &outarray,
2301 const Array<OneD, const NekDouble>& dirForcing)
2304 "This method is not defined or valid for this class type");
2308 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
2309 const Array<OneD, const NekDouble> &inarray,
2310 Array<OneD, NekDouble> &outarray,
2313 const Array<OneD, const NekDouble>& dirForcing)
2316 "This method is not defined or valid for this class type");
2320 Array<OneD, NekDouble> &outarray,
2326 "This method is not defined or valid for this class type");
2330 Array<OneD, NekDouble> &outarray,
2336 "This method is not defined or valid for this class type");
2342 "This method is not defined or valid for this class type");
2347 const Array<OneD, NekDouble> &TotField,
2351 "This method is not defined or valid for this class type");
2355 Array<OneD, const NekDouble> &V2,
2356 Array<OneD, NekDouble> &outarray,
2360 "This method is not defined or valid for this class type");
2366 "This method is not defined or valid for this class type");
2374 "This method is not defined or valid for this class type");
2380 "This method is not defined or valid for this class type");
2386 "This method is not defined or valid for this class type");
2391 Array<OneD, NekDouble> &outarray,
2398 Array<OneD, NekDouble> &outarray,
2405 const Array<OneD, const NekDouble> &inarray,
2406 Array<OneD, NekDouble> &outarray,
2414 const Array<OneD,const NekDouble> &inarray,
2415 Array<OneD, NekDouble> &outarray,
2433 Array<OneD, NekDouble> &coord_1,
2434 Array<OneD, NekDouble> &coord_2)
2437 Array<OneD, NekDouble> e_coord_0;
2438 Array<OneD, NekDouble> e_coord_1;
2439 Array<OneD, NekDouble> e_coord_2;
2444 for(i= 0; i < (*m_exp).size(); ++i)
2447 (*m_exp)[i]->GetCoords(e_coord_0);
2451 ASSERTL0(coord_1.num_elements() != 0,
2452 "output coord_1 is not defined");
2454 for(i= 0; i < (*m_exp).size(); ++i)
2457 e_coord_1 = coord_1 + m_phys_offset[i];
2458 (*m_exp)[i]->GetCoords(e_coord_0,e_coord_1);
2462 ASSERTL0(coord_1.num_elements() != 0,
2463 "output coord_1 is not defined");
2464 ASSERTL0(coord_2.num_elements() != 0,
2465 "output coord_2 is not defined");
2467 for(i= 0; i < (*m_exp).size(); ++i)
2470 e_coord_1 = coord_1 + m_phys_offset[i];
2471 e_coord_2 = coord_2 + m_phys_offset[i];
2472 (*m_exp)[i]->GetCoords(e_coord_0,e_coord_1,e_coord_2);
2483 "This method is not defined or valid for this class type");
2489 Array<OneD,int> &EdgeID)
2492 "This method is not defined or valid for this class type");
2500 "This method is not defined or valid for this class type");
2505 const Array<OneD,const SpatialDomains::BoundaryConditionShPtr>
2509 "This method is not defined or valid for this class type");
2510 static Array<OneD, const SpatialDomains::BoundaryConditionShPtr>
2520 "This method is not defined or valid for this class type");
2521 static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
2529 const std::string varName,
2534 "This method is not defined or valid for this class type");
2542 "This method is not defined or valid for this class type");
2543 static map<int,RobinBCInfoSharedPtr> result;
2555 "This method is not defined or valid for this class type");
2560 unsigned int regionId,
2561 const std::string& variable)
2563 SpatialDomains::BoundaryConditionCollection::const_iterator collectionIter = collection.find(regionId);
2564 ASSERTL1(collectionIter != collection.end(),
"Unable to locate collection "+boost::lexical_cast<
string>(regionId));
2566 SpatialDomains::BoundaryConditionMap::const_iterator conditionMapIter = boundaryConditionMap->find(variable);
2567 ASSERTL1(conditionMapIter != boundaryConditionMap->end(),
"Unable to locate condition map.");
2569 return boundaryCondition;
2575 "This method is not defined or valid for this class type");