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, locCoords,
1246 v =
m_graph->GetVertex((*
m_exp)[i]->GetGeom()->GetVid(0));
1248 w.
SetX(gloCoords[0]);
1249 w.
SetY(gloCoords[1]);
1250 w.
SetZ(gloCoords[2]);
1251 v->GetCoords(x,y,z);
1253 elmtIdDist.push_back(std::pair<int, NekDouble>(i, v->dist(w)));
1258 if (!elmtIdDist.empty())
1261 int min_id = elmtIdDist[0].second;
1263 for (
int i = 1; i < elmtIdDist.size(); ++i)
1265 if (elmtIdDist[i].second < min_d) {
1266 min_d = elmtIdDist[i].second;
1267 min_id = elmtIdDist[i].first;
1281 static int start = 0;
1284 Array<OneD, NekDouble> savLocCoords(locCoords.num_elements());
1287 for (
int i = start; i < (*m_exp).size(); ++i)
1289 if ((*
m_exp)[i]->GetGeom()->ContainsPoint(gloCoords, locCoords,
1297 if(resid < resid_min)
1301 Vmath::Vcopy(locCoords.num_elements(),savLocCoords,1,locCoords,1);
1306 for (
int i = 0; i < start; ++i)
1308 if ((*
m_exp)[i]->GetGeom()->ContainsPoint(gloCoords, locCoords,
1316 if(resid < resid_min)
1320 Vmath::Vcopy(locCoords.num_elements(),savLocCoords,1,locCoords,1);
1325 std::string msg =
"Failed to find point in element to tolerance of "
1326 + boost::lexical_cast<std::string>(resid)
1327 +
" using nearest point found";
1330 if(returnNearestElmt)
1332 Vmath::Vcopy(locCoords.num_elements(),locCoords,1,savLocCoords,1);
1362 int coordim =
GetExp(0)->GetCoordim();
1363 char vars[3] = {
'x',
'y',
'z' };
1374 outfile <<
"Variables = x";
1375 for (
int i = 1; i < coordim; ++i)
1377 outfile <<
", " << vars[i];
1382 outfile <<
", " << var;
1385 outfile << std::endl << std::endl;
1398 int nBases = (*m_exp)[0]->GetNumBases();
1401 Array<OneD, Array<OneD, NekDouble> > coords(3);
1403 if (expansion == -1)
1407 coords[0] = Array<OneD, NekDouble>(nPoints);
1408 coords[1] = Array<OneD, NekDouble>(nPoints);
1409 coords[2] = Array<OneD, NekDouble>(nPoints);
1411 GetCoords(coords[0], coords[1], coords[2]);
1413 for (i = 0; i <
m_exp->size(); ++i)
1417 for (j = 0; j < nBases; ++j)
1419 numInt *= (*m_exp)[i]->GetNumPoints(j)-1;
1422 numBlocks += numInt;
1427 nPoints = (*m_exp)[expansion]->GetTotPoints();
1429 coords[0] = Array<OneD, NekDouble>(nPoints);
1430 coords[1] = Array<OneD, NekDouble>(nPoints);
1431 coords[2] = Array<OneD, NekDouble>(nPoints);
1433 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
1436 for (j = 0; j < nBases; ++j)
1438 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j)-1;
1446 int nPlanes =
GetZIDs().num_elements();
1447 NekDouble tmp = numBlocks * (nPlanes-1.0) / nPlanes;
1448 numBlocks = (int)tmp;
1456 outfile <<
"Zone, N=" << nPoints <<
", E="
1457 << numBlocks <<
", F=FEBlock" ;
1462 outfile <<
", ET=QUADRILATERAL" << std::endl;
1465 outfile <<
", ET=BRICK" << std::endl;
1468 ASSERTL0(
false,
"Not set up for this type of output");
1473 for (j = 0; j < coordim; ++j)
1475 for (i = 0; i < nPoints; ++i)
1477 outfile << coords[j][i] <<
" ";
1478 if (i % 1000 == 0 && i)
1480 outfile << std::endl;
1483 outfile << std::endl;
1491 int nbase = (*m_exp)[0]->GetNumBases();
1494 boost::shared_ptr<LocalRegions::ExpansionVector> exp =
m_exp;
1496 if (expansion != -1)
1498 exp = boost::shared_ptr<LocalRegions::ExpansionVector>(
1500 (*exp)[0] = (*m_exp)[expansion];
1505 for(i = 0; i < (*exp).size(); ++i)
1507 const int np0 = (*exp)[i]->GetNumPoints(0);
1508 const int np1 = (*exp)[i]->GetNumPoints(1);
1510 for(j = 1; j < np1; ++j)
1512 for(k = 1; k < np0; ++k)
1514 outfile << cnt + (j-1)*np0 + k <<
" ";
1515 outfile << cnt + (j-1)*np0 + k+1 <<
" ";
1516 outfile << cnt + j *np0 + k+1 <<
" ";
1517 outfile << cnt + j *np0 + k << endl;
1524 else if (nbase == 3)
1526 for(i = 0; i < (*exp).size(); ++i)
1528 const int np0 = (*exp)[i]->GetNumPoints(0);
1529 const int np1 = (*exp)[i]->GetNumPoints(1);
1530 const int np2 = (*exp)[i]->GetNumPoints(2);
1531 const int np01 = np0*np1;
1533 for(j = 1; j < np2; ++j)
1535 for(k = 1; k < np1; ++k)
1537 for(l = 1; l < np0; ++l)
1539 outfile << cnt + (j-1)*np01 + (k-1)*np0 + l <<
" ";
1540 outfile << cnt + (j-1)*np01 + (k-1)*np0 + l+1 <<
" ";
1541 outfile << cnt + (j-1)*np01 + k *np0 + l+1 <<
" ";
1542 outfile << cnt + (j-1)*np01 + k *np0 + l <<
" ";
1543 outfile << cnt + j *np01 + (k-1)*np0 + l <<
" ";
1544 outfile << cnt + j *np01 + (k-1)*np0 + l+1 <<
" ";
1545 outfile << cnt + j *np01 + k *np0 + l+1 <<
" ";
1546 outfile << cnt + j *np01 + k *np0 + l << endl;
1555 ASSERTL0(
false,
"Not set up for this dimension");
1566 if (expansion == -1)
1574 for(
int i = 0; i < totpoints; ++i)
1576 outfile <<
m_phys[i] <<
" ";
1577 if(i % 1000 == 0 && i)
1579 outfile << std::endl;
1582 outfile << std::endl;
1587 int nPoints = (*m_exp)[expansion]->GetTotPoints();
1589 for (
int i = 0; i < nPoints; ++i)
1594 outfile << std::endl;
1600 outfile <<
"<?xml version=\"1.0\"?>" << endl;
1601 outfile <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
1602 <<
"byte_order=\"LittleEndian\">" << endl;
1603 outfile <<
" <UnstructuredGrid>" << endl;
1608 outfile <<
" </UnstructuredGrid>" << endl;
1609 outfile <<
"</VTKFile>" << endl;
1614 ASSERTL0(
false,
"Routine not implemented for this expansion.");
1619 outfile <<
" </PointData>" << endl;
1620 outfile <<
" </Piece>" << endl;
1627 int nq = (*m_exp)[expansion]->GetTotPoints();
1630 outfile <<
" <DataArray type=\"Float64\" Name=\""
1631 << var <<
"\">" << endl;
1634 for(i = 0; i < nq; ++i)
1639 outfile <<
" </DataArray>" << endl;
1661 const Array<OneD, const NekDouble> &inarray,
1662 const Array<OneD, const NekDouble> &soln)
1674 err = max(err, abs(inarray[i] - soln[i]));
1700 const Array<OneD, const NekDouble> &inarray,
1701 const Array<OneD, const NekDouble> &soln)
1708 for (i = 0; i < (*m_exp).size(); ++i)
1716 for (i = 0; i < (*m_exp).size(); ++i)
1734 for (i = 0; i < (*m_exp).size(); ++i)
1746 "This method is not defined or valid for this class type");
1747 Array<OneD, NekDouble> NoEnergy(1,0.0);
1754 "This method is not defined or valid for this class type");
1763 "This method is not defined or valid for this class type");
1771 "This method is not defined or valid for this class type");
1772 Array<OneD, unsigned int> NoModes(1);
1780 "This method is not defined or valid for this class type");
1781 Array<OneD, unsigned int> NoModes(1);
1790 "This method is not defined or valid for this class type");
1795 "This method is not defined or valid for this class type");
1799 const std::string &fileName,
1800 const std::string &varName,
1801 const boost::shared_ptr<ExpList> locExpList)
1803 string varString = fileName.substr(0, fileName.find_last_of(
"."));
1804 int j, k, len = varString.length();
1805 varString = varString.substr(len-1, len);
1807 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
1808 std::vector<std::vector<NekDouble> > FieldData;
1811 f.
Import(fileName, FieldDef, FieldData);
1814 for (j = 0; j < FieldDef.size(); ++j)
1816 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
1818 if (FieldDef[j]->m_fields[k] == varName)
1821 locExpList->ExtractDataToCoeffs(
1822 FieldDef[j], FieldData[j],
1823 FieldDef[j]->m_fields[k],
1824 locExpList->UpdateCoeffs());
1830 ASSERTL0(found,
"Could not find variable '"+varName+
1831 "' in file boundary condition "+fileName);
1832 locExpList->BwdTrans_IterPerExp(
1833 locExpList->GetCoeffs(),
1834 locExpList->UpdatePhys());
1855 const Array<OneD, const NekDouble> &inarray,
1856 const Array<OneD, const NekDouble> &soln)
1861 for (i = 0; i < (*m_exp).size(); ++i)
1875 Array<OneD, LibUtilities::BasisSharedPtr> &HomoBasis,
1876 std::vector<NekDouble> &HomoLen,
1877 std::vector<unsigned int> &HomoZIDs,
1878 std::vector<unsigned int> &HomoYIDs)
1880 int startenum, endenum, s;
1882 ASSERTL1(NumHomoDir == HomoBasis.num_elements(),
"Homogeneous basis is not the same length as NumHomoDir");
1883 ASSERTL1(NumHomoDir == HomoLen.size(),
"Homogeneous length vector is not the same length as NumHomDir");
1886 switch((*
m_exp)[0]->GetShapeDimension())
1902 for(s = startenum; s <= endenum; ++s)
1905 std::vector<unsigned int> elementIDs;
1906 std::vector<LibUtilities::BasisType> basis;
1907 std::vector<unsigned int> numModes;
1908 std::vector<std::string> fields;
1911 bool UniOrder =
true;
1914 for(
int i = 0; i < (*m_exp).size(); ++i)
1918 elementIDs.push_back((*
m_exp)[i]->GetGeom()->GetGlobalID());
1922 for(
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
1924 basis.push_back((*
m_exp)[i]->GetBasis(j)->GetBasisType());
1925 numModes.push_back((*
m_exp)[i]->GetBasis(j)->GetNumModes());
1929 for(n = 0 ; n < NumHomoDir; ++n)
1931 basis.push_back(HomoBasis[n]->GetBasisType());
1932 numModes.push_back(HomoBasis[n]->GetNumModes());
1939 ASSERTL0((*
m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
"Routine is not set up for multiple bases definitions");
1941 for(
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
1943 numModes.push_back((*
m_exp)[i]->GetBasis(j)->GetNumModes());
1944 if(numModes[j] != (*
m_exp)[i]->GetBasis(j)->GetNumModes())
1950 for(n = 0 ; n < NumHomoDir; ++n)
1952 numModes.push_back(HomoBasis[n]->GetNumModes());
1959 if(elementIDs.size() > 0)
1962 fielddef.push_back(fdef);
1973 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
1997 map<int, int> ElmtID_to_ExpID;
1998 for(i = 0; i < (*m_exp).size(); ++i)
2000 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2003 for(i = 0; i < fielddef->m_elementIDs.size(); ++i)
2005 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
2006 int datalen = (*m_exp)[eid]->GetNcoeffs();
2007 fielddata.insert(fielddata.end(),&coeffs[
m_coeff_offset[eid]],&coeffs[m_coeff_offset[eid]]+datalen);
2015 std::vector<NekDouble> &fielddata,
2017 Array<OneD, NekDouble> &coeffs)
2037 std::vector<NekDouble> &fielddata,
2039 Array<OneD, NekDouble> &coeffs)
2043 int modes_offset = 0;
2044 int datalen = fielddata.size()/fielddef->m_fields.size();
2047 for(i = 0; i < fielddef->m_fields.size(); ++i)
2049 if(fielddef->m_fields[i] == field)
2056 ASSERTL0(i != fielddef->m_fields.size(),
2057 "Field (" + field +
") not found in file.");
2060 map<int, int> elmtToExpId;
2065 for(i = (*m_exp).size()-1; i >= 0; --i)
2067 elmtToExpId[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
2070 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
2074 if (fielddef->m_uniOrder ==
true)
2080 fielddef->m_numModes, modes_offset);
2082 const int elmtId = fielddef->m_elementIDs[i];
2083 if (elmtToExpId.count(elmtId) == 0)
2089 expId = elmtToExpId[elmtId];
2091 if (datalen == (*
m_exp)[expId]->GetNcoeffs())
2098 (*m_exp)[expId]->ExtractDataToCoeffs(
2099 &fielddata[offset], fielddef->m_numModes,
2104 modes_offset += (*m_exp)[0]->GetNumBases();
2116 if(fromExpList->GetNcoeffs() ==
m_ncoeffs)
2122 std::vector<unsigned int> nummodes;
2123 for(i = 0; i < (*m_exp).size(); ++i)
2126 for(
int j= 0; j < fromExpList->GetExp(eid)->GetNumBases(); ++j)
2128 nummodes.push_back(fromExpList->GetExp(eid)->GetBasisNumModes(j));
2131 (*m_exp)[eid]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes,0,
2134 offset += fromExpList->GetExp(eid)->GetNcoeffs();
2140 const Array<OneD,const boost::shared_ptr<ExpList> >
2144 "This method is not defined or valid for this class type");
2145 static Array<OneD,const boost::shared_ptr<ExpList> > result;
2152 "This method is not defined or valid for this class type");
2153 static boost::shared_ptr<ExpList> result;
2158 const Array<
OneD,
const Array<OneD, NekDouble> > &Vec,
2159 const Array<OneD, const NekDouble> &Fwd,
2160 const Array<OneD, const NekDouble> &Bwd,
2161 Array<OneD, NekDouble> &Upwind)
2164 "This method is not defined or valid for this class type");
2168 const Array<OneD, const NekDouble> &Vn,
2169 const Array<OneD, const NekDouble> &Fwd,
2170 const Array<OneD, const NekDouble> &Bwd,
2171 Array<OneD, NekDouble> &Upwind)
2174 "This method is not defined or valid for this class type");
2180 "This method is not defined or valid for this class type");
2181 static boost::shared_ptr<ExpList> returnVal;
2188 "This method is not defined or valid for this class type");
2189 static boost::shared_ptr<AssemblyMapDG> result;
2195 return GetTraceMap()->GetBndCondTraceToGlobalTraceMap();
2199 Array<
OneD, Array<OneD, NekDouble> > &normals)
2202 "This method is not defined or valid for this class type");
2206 const Array<OneD, const NekDouble> &Fx,
2207 const Array<OneD, const NekDouble> &Fy,
2208 Array<OneD, NekDouble> &outarray)
2211 "This method is not defined or valid for this class type");
2215 const Array<OneD, const NekDouble> &Fn,
2216 Array<OneD, NekDouble> &outarray)
2219 "This method is not defined or valid for this class type");
2223 const Array<OneD, const NekDouble> &Fwd,
2224 const Array<OneD, const NekDouble> &Bwd,
2225 Array<OneD, NekDouble> &outarray)
2228 "This method is not defined or valid for this class type");
2232 Array<OneD,NekDouble> &Bwd)
2235 "This method is not defined or valid for this class type");
2239 const Array<OneD,const NekDouble> &field,
2240 Array<OneD,NekDouble> &Fwd,
2241 Array<OneD,NekDouble> &Bwd)
2244 "This method is not defined or valid for this class type");
2250 "This method is not defined or valid for this class type");
2254 const Array<OneD, const NekDouble> &inarray,
2255 Array<OneD,NekDouble> &outarray)
2258 "This method is not defined or valid for this class type");
2262 const Array<OneD,const NekDouble> &inarray,
2263 Array<OneD, NekDouble> &outarray,
2267 "This method is not defined or valid for this class type");
2271 const Array<OneD, const NekDouble> &inarray,
2272 Array<OneD, NekDouble> &outarray,
2276 const Array<OneD, const NekDouble> &dirForcing)
2278 ASSERTL0(
false,
"HelmSolve not implemented.");
2282 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
2283 const Array<OneD, const NekDouble> &inarray,
2284 Array<OneD, NekDouble> &outarray,
2287 const Array<OneD, const NekDouble>& dirForcing)
2290 "This method is not defined or valid for this class type");
2294 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
2295 const Array<OneD, const NekDouble> &inarray,
2296 Array<OneD, NekDouble> &outarray,
2299 const Array<OneD, const NekDouble>& dirForcing)
2302 "This method is not defined or valid for this class type");
2306 Array<OneD, NekDouble> &outarray,
2312 "This method is not defined or valid for this class type");
2316 Array<OneD, NekDouble> &outarray,
2322 "This method is not defined or valid for this class type");
2328 "This method is not defined or valid for this class type");
2333 const Array<OneD, NekDouble> &TotField,
2337 "This method is not defined or valid for this class type");
2341 Array<OneD, const NekDouble> &V2,
2342 Array<OneD, NekDouble> &outarray,
2346 "This method is not defined or valid for this class type");
2352 "This method is not defined or valid for this class type");
2360 "This method is not defined or valid for this class type");
2366 "This method is not defined or valid for this class type");
2372 "This method is not defined or valid for this class type");
2377 Array<OneD, NekDouble> &outarray,
2384 Array<OneD, NekDouble> &outarray,
2391 const Array<OneD, const NekDouble> &inarray,
2392 Array<OneD, NekDouble> &outarray,
2400 const Array<OneD,const NekDouble> &inarray,
2401 Array<OneD, NekDouble> &outarray,
2419 Array<OneD, NekDouble> &coord_1,
2420 Array<OneD, NekDouble> &coord_2)
2423 Array<OneD, NekDouble> e_coord_0;
2424 Array<OneD, NekDouble> e_coord_1;
2425 Array<OneD, NekDouble> e_coord_2;
2430 for(i= 0; i < (*m_exp).size(); ++i)
2433 (*m_exp)[i]->GetCoords(e_coord_0);
2437 ASSERTL0(coord_1.num_elements() != 0,
2438 "output coord_1 is not defined");
2440 for(i= 0; i < (*m_exp).size(); ++i)
2443 e_coord_1 = coord_1 + m_phys_offset[i];
2444 (*m_exp)[i]->GetCoords(e_coord_0,e_coord_1);
2448 ASSERTL0(coord_1.num_elements() != 0,
2449 "output coord_1 is not defined");
2450 ASSERTL0(coord_2.num_elements() != 0,
2451 "output coord_2 is not defined");
2453 for(i= 0; i < (*m_exp).size(); ++i)
2456 e_coord_1 = coord_1 + m_phys_offset[i];
2457 e_coord_2 = coord_2 + m_phys_offset[i];
2458 (*m_exp)[i]->GetCoords(e_coord_0,e_coord_1,e_coord_2);
2469 "This method is not defined or valid for this class type");
2475 Array<OneD,int> &EdgeID)
2478 "This method is not defined or valid for this class type");
2486 "This method is not defined or valid for this class type");
2491 const Array<OneD,const SpatialDomains::BoundaryConditionShPtr>
2495 "This method is not defined or valid for this class type");
2496 static Array<OneD, const SpatialDomains::BoundaryConditionShPtr>
2506 "This method is not defined or valid for this class type");
2507 static Array<OneD, SpatialDomains::BoundaryConditionShPtr> result;
2515 const std::string varName,
2520 "This method is not defined or valid for this class type");
2528 "This method is not defined or valid for this class type");
2529 static map<int,RobinBCInfoSharedPtr> result;
2541 "This method is not defined or valid for this class type");
2546 unsigned int regionId,
2547 const std::string& variable)
2549 SpatialDomains::BoundaryConditionCollection::const_iterator collectionIter = collection.find(regionId);
2550 ASSERTL1(collectionIter != collection.end(),
"Unable to locate collection "+boost::lexical_cast<
string>(regionId));
2552 SpatialDomains::BoundaryConditionMap::const_iterator conditionMapIter = boundaryConditionMap->find(variable);
2553 ASSERTL1(conditionMapIter != boundaryConditionMap->end(),
"Unable to locate condition map.");
2555 return boundaryCondition;
2561 "This method is not defined or valid for this class type");