36 #ifndef NEKTAR_LIBS_MULTIREGIONS_EXPLIST_H
37 #define NEKTAR_LIBS_MULTIREGIONS_EXPLIST_H
48 #include <boost/enable_shared_from_this.hpp>
57 namespace MultiRegions
64 class GlobalLinSysKey;
102 class ExpList:
public boost::enable_shared_from_this<ExpList>
120 const bool DeclareCoeffPhysArrays =
true);
182 inline void SetPhys(
const Array<OneD, const NekDouble> &inarray);
185 inline void SetPhysArray(Array<OneD, NekDouble> &inarray);
211 const Array<OneD, const NekDouble> &inarray,
212 Array<OneD, NekDouble> &outarray);
216 const Array<OneD, const NekDouble> &inarray,
217 Array<OneD, NekDouble> &outarray,
226 const Array<OneD, const NekDouble> &inarray,
227 Array<OneD, NekDouble> &outarray);
235 Array<OneD,NekDouble> &outarray);
241 Array<OneD, NekDouble> &outarray,
249 Array<OneD, NekDouble> &outarray);
253 const Array<OneD,const NekDouble> &inarray,
254 Array<OneD, NekDouble> &outarray,
258 inline void SmoothField(Array<OneD,NekDouble> &field);
262 const Array<OneD, const NekDouble> &inarray,
263 Array<OneD, NekDouble> &outarray,
268 const Array<OneD, const NekDouble> &dirForcing =
273 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
274 const Array<OneD, const NekDouble> &inarray,
275 Array<OneD, NekDouble> &outarray,
278 const Array<OneD, const NekDouble>&
284 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
285 const Array<OneD, const NekDouble> &inarray,
286 Array<OneD, NekDouble> &outarray,
289 const Array<OneD, const NekDouble>&
294 const Array<OneD, const NekDouble> &inarray,
295 Array<OneD, NekDouble> &outarray);
301 const Array<OneD, const NekDouble> &inarray,
302 Array<OneD,NekDouble> &outarray);
308 Array<OneD,NekDouble> &outarray,
314 Array<OneD, NekDouble> &coord_0,
320 const Array<OneD, const NekDouble> &inarray,
321 Array<OneD, NekDouble> &outarray,
324 bool UnShuff =
true);
327 const Array<OneD, const NekDouble> &inarray,
328 Array<OneD, NekDouble> &outarray,
331 bool UnShuff =
true);
334 const Array<OneD, NekDouble> &inarray1,
335 const Array<OneD, NekDouble> &inarray2,
336 Array<OneD, NekDouble> &outarray,
340 Array<OneD, NekDouble> &BndVals,
341 const Array<OneD, NekDouble> &TotField,
345 Array<OneD, const NekDouble> &V1,
346 Array<OneD, const NekDouble> &V2,
347 Array<OneD, NekDouble> &outarray,
354 std::string var =
"")
360 std::ofstream &outfile,
387 std::ofstream &outfile,
391 std::ofstream &outfile,
393 std::string var =
"v")
415 inline const Array<OneD, const NekDouble> &
GetCoeffs()
const;
419 Array<OneD,NekDouble>& outarray);
447 const Array<OneD, const NekDouble> &inarray,
454 const Array<OneD, const NekDouble> &inarray,
457 return v_L2(inarray, soln);
463 const Array<OneD, const NekDouble> &inarray,
523 const Array<OneD, NekDouble> &inarray,
524 Array<OneD, NekDouble> &outarray)
535 const Array<OneD, NekDouble> &inarray,
536 Array<OneD, NekDouble> &outarray)
554 inline const boost::shared_ptr<LocalRegions::ExpansionVector>
564 const Array<OneD, const NekDouble> &gloCoord);
570 const Array<OneD, const NekDouble> &gloCoord,
572 bool returnNearestElmt =
false);
580 const Array<OneD, const NekDouble> &gloCoords,
581 Array<OneD, NekDouble> &locCoords,
583 bool returnNearestElmt =
false);
610 const Array<OneD, const NekDouble> &inarray,
611 Array<OneD, NekDouble> &out_d);
617 const Array<OneD, const NekDouble> &inarray,
618 Array<OneD, NekDouble> &out_d0,
624 const Array<OneD, const NekDouble> &inarray,
625 Array<OneD, NekDouble> &out_d);
629 inline const Array<OneD, const boost::shared_ptr<ExpList> >
635 const Array<
OneD,
const Array<OneD, NekDouble> > &Vec,
636 const Array<OneD, const NekDouble> &Fwd,
637 const Array<OneD, const NekDouble> &Bwd,
638 Array<OneD, NekDouble> &
Upwind);
641 const Array<OneD, const NekDouble> &Vn,
642 const Array<OneD, const NekDouble> &Fwd,
643 const Array<OneD, const NekDouble> &Bwd,
644 Array<OneD, NekDouble> &
Upwind);
650 inline boost::shared_ptr<ExpList> &
GetTrace();
652 inline boost::shared_ptr<AssemblyMapDG> &
GetTraceMap(
void);
656 inline void GetNormals(Array<
OneD, Array<OneD, NekDouble> > &normals);
659 const Array<OneD, const NekDouble> &Fx,
660 const Array<OneD, const NekDouble> &Fy,
661 Array<OneD, NekDouble> &outarray);
664 const Array<OneD, const NekDouble> &Fn,
665 Array<OneD, NekDouble> &outarray);
668 const Array<OneD, const NekDouble> &Fwd,
669 const Array<OneD, const NekDouble> &Bwd,
670 Array<OneD, NekDouble> &outarray);
673 Array<OneD,NekDouble> &Fwd,
674 Array<OneD,NekDouble> &Bwd);
677 const Array<OneD,const NekDouble> &field,
678 Array<OneD,NekDouble> &Fwd,
679 Array<OneD,NekDouble> &Bwd);
684 const Array<OneD, const NekDouble> &inarray,
685 Array<OneD,NekDouble> &outarray);
695 const std::string varName =
"",
705 const Array<OneD,const NekDouble> &inarray,
706 Array<OneD, NekDouble> &outarray,
711 const Array<OneD,const NekDouble> &inarray,
712 Array<OneD, NekDouble> &outarray);
717 Array<OneD,int> &EdgeID);
720 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef,
722 Array<OneD, LibUtilities::BasisSharedPtr> &HomoBasis =
724 std::vector<NekDouble> &HomoLen =
726 std::vector<unsigned int> &HomoZIDs =
728 std::vector<unsigned int> &HomoYIDs =
750 std::vector<LibUtilities::FieldDefinitionsSharedPtr>
768 std::vector<NekDouble> &fielddata)
778 std::vector<NekDouble> &fielddata,
779 Array<OneD, NekDouble> &coeffs)
791 std::vector<NekDouble> &fielddata,
793 Array<OneD, NekDouble> &coeffs);
802 const boost::shared_ptr<ExpList> &fromExpList,
803 const Array<OneD, const NekDouble> &fromCoeffs,
804 Array<OneD, NekDouble> &toCoeffs);
810 std::vector<NekDouble> &fielddata,
812 Array<OneD, NekDouble> &coeffs);
818 return shared_from_this();
828 boost::shared_ptr<LibUtilities::Comm>
GetComm()
855 const boost::shared_ptr<AssemblyMapCG> &locToGloMap);
928 boost::shared_ptr<LocalRegions::ExpansionVector>
m_exp;
963 const Array<OneD,const NekDouble> &inarray,
964 Array<OneD, NekDouble> &outarray);
969 const boost::shared_ptr<AssemblyMapCG> &locToGloMap);
973 const boost::shared_ptr<DNekMat> &Gmat,
974 Array<OneD, NekDouble> &EigValsReal,
975 Array<OneD, NekDouble> &EigValsImag,
976 Array<OneD, NekDouble> &EigVecs
984 const boost::shared_ptr<AssemblyMapCG> &locToGloMap);
1001 return (*m_exp).size();
1004 virtual const Array<OneD,const boost::shared_ptr<ExpList> >
1010 const Array<
OneD,
const Array<OneD, NekDouble> > &Vec,
1011 const Array<OneD, const NekDouble> &Fwd,
1012 const Array<OneD, const NekDouble> &Bwd,
1013 Array<OneD, NekDouble> &
Upwind);
1016 const Array<OneD, const NekDouble> &Vn,
1017 const Array<OneD, const NekDouble> &Fwd,
1018 const Array<OneD, const NekDouble> &Bwd,
1019 Array<OneD, NekDouble> &
Upwind);
1021 virtual boost::shared_ptr<ExpList> &
v_GetTrace();
1028 Array<
OneD, Array<OneD, NekDouble> > &normals);
1031 const Array<OneD, const NekDouble> &Fx,
1032 const Array<OneD, const NekDouble> &Fy,
1033 Array<OneD, NekDouble> &outarray);
1036 const Array<OneD, const NekDouble> &Fn,
1037 Array<OneD, NekDouble> &outarray);
1040 const Array<OneD, const NekDouble> &Fwd,
1041 const Array<OneD, const NekDouble> &Bwd,
1042 Array<OneD, NekDouble> &outarray);
1045 Array<OneD,NekDouble> &Fwd,
1046 Array<OneD,NekDouble> &Bwd);
1049 const Array<OneD,const NekDouble> &field,
1050 Array<OneD,NekDouble> &Fwd,
1051 Array<OneD,NekDouble> &Bwd);
1054 Array<OneD,NekDouble> &outarray);
1057 const Array<OneD, const NekDouble> &inarray,
1058 Array<OneD,NekDouble> &outarray);
1061 const Array<OneD,const NekDouble> &inarray,
1062 Array<OneD, NekDouble> &outarray,
1066 const Array<OneD, const NekDouble> &inarray,
1067 Array<OneD, NekDouble> &outarray,
1071 const Array<OneD, const NekDouble> &dirForcing);
1074 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
1075 const Array<OneD, const NekDouble> &inarray,
1076 Array<OneD, NekDouble> &outarray,
1079 const Array<OneD, const NekDouble>&
1083 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
1084 const Array<OneD, const NekDouble> &inarray,
1085 Array<OneD, NekDouble> &outarray,
1088 const Array<OneD, const NekDouble>&
1102 const Array<OneD,const NekDouble> &inarray,
1103 Array<OneD, NekDouble> &outarray,
1107 const Array<OneD,const NekDouble> &inarray,
1108 Array<OneD,NekDouble> &outarray);
1111 const Array<OneD,const NekDouble> &inarray,
1112 Array<OneD, NekDouble> &outarray,
1116 const Array<OneD,const NekDouble> &inarray,
1117 Array<OneD,NekDouble> &outarray);
1122 const Array<OneD, const NekDouble> &inarray,
1123 Array<OneD, NekDouble> &outarray,
1127 const Array<OneD,const NekDouble> &inarray,
1128 Array<OneD, NekDouble> &outarray);
1132 const Array<OneD,const NekDouble> &inarray,
1133 Array<OneD, NekDouble> &outarray,
1137 Array<OneD, NekDouble> &coord_0,
1138 Array<OneD, NekDouble> &coord_1,
1142 const Array<OneD, const NekDouble> &inarray,
1143 Array<OneD, NekDouble> &out_d0,
1144 Array<OneD, NekDouble> &out_d1,
1145 Array<OneD, NekDouble> &out_d2);
1149 const Array<OneD, const NekDouble> &inarray,
1150 Array<OneD, NekDouble> &out_d);
1154 const Array<OneD, const NekDouble> &inarray,
1155 Array<OneD, NekDouble> &out_d);
1158 const Array<OneD, const NekDouble> &inarray,
1159 Array<OneD, NekDouble> &outarray,
1162 bool UnShuff =
true);
1165 const Array<OneD, const NekDouble> &inarray,
1166 Array<OneD, NekDouble> &outarray,
1169 bool UnShuff =
true);
1172 const Array<OneD, NekDouble> &inarray1,
1173 const Array<OneD, NekDouble> &inarray2,
1174 Array<OneD, NekDouble> &outarray,
1178 Array<OneD, NekDouble> &BndVals,
1179 const Array<OneD, NekDouble> &TotField,
1183 Array<OneD, const NekDouble> &V1,
1184 Array<OneD, const NekDouble> &V2,
1185 Array<OneD, NekDouble> &outarray,
1191 Array<OneD,int> &EdgeID);
1195 virtual std::vector<LibUtilities::FieldDefinitionsSharedPtr>
1199 std::vector<LibUtilities::FieldDefinitionsSharedPtr> &fielddef);
1203 std::vector<NekDouble> &fielddata);
1207 std::vector<NekDouble> &fielddata,
1208 Array<OneD, NekDouble> &coeffs);
1212 std::vector<NekDouble> &fielddata, std::string &field,
1213 Array<OneD, NekDouble> &coeffs);
1215 virtual void v_ExtractCoeffsToCoeffs(
const boost::shared_ptr<ExpList> &fromExpList,
const Array<OneD, const NekDouble> &fromCoeffs, Array<OneD, NekDouble> &toCoeffs);
1218 std::string var =
"");
1230 const Array<OneD, const NekDouble> &phys,
1234 const Array<OneD, const NekDouble> &inarray);
1239 virtual Array<OneD, const unsigned int>
v_GetZIDs(
void);
1240 virtual Array<OneD, const unsigned int>
v_GetYIDs(
void);
1244 const NekDouble scale,
const Array<OneD, NekDouble> &inarray,
1245 Array<OneD, NekDouble> &outarray);
1249 const Array<OneD, NekDouble> &inarray,
1250 Array<OneD, NekDouble> &outarray);
1253 const std::string &varName,
1254 const boost::shared_ptr<ExpList> locExpList);
1262 unsigned int index,
const std::string& variable);
1265 virtual const Array<OneD,const SpatialDomains::BoundaryConditionShPtr> &
v_GetBndConditions();
1267 virtual Array<OneD, SpatialDomains::BoundaryConditionShPtr>
1272 const std::string varName =
"",
1288 "This method is not defined or valid for this class type");
1296 "This method is not defined or valid for this class type");
1300 virtual boost::shared_ptr<ExpList> &
v_GetPlane(
int n);
1323 return (*
m_exp)[eid]->GetNcoeffs();
1335 for(i= 0; i < (*m_exp).size(); ++i)
1337 returnval = max(returnval,
1351 Array<OneD,int> returnval((*m_exp).size(),0);
1353 for(i= 0; i < (*m_exp).size(); ++i)
1373 return (*
m_exp)[eid]->GetTotPoints();
1381 int nbase = (*m_exp)[0]->GetNumBases();
1383 for(
int i = 0; i < (*m_exp).size(); ++i)
1386 for(
int j = 0; j < nbase; ++j)
1388 cnt *= (int)(scale*((*
m_exp)[i]->GetNumPoints(j)));
1436 const Array<OneD, const NekDouble> &inarray)
1439 "Input array does not have correct number of elements.");
1473 const Array<OneD, const NekDouble> &inarray,
1474 Array<OneD, NekDouble> &outarray,
1484 const Array<OneD, const NekDouble> &inarray,
1485 Array<OneD, NekDouble> &outarray)
1494 const Array<OneD, const NekDouble> &inarray,
1495 Array<OneD, NekDouble> &outarray,
1505 const Array<OneD, const NekDouble> &inarray,
1506 Array<OneD,NekDouble> &outarray)
1523 const Array<OneD, const NekDouble> &inarray,
1524 Array<OneD, NekDouble> &outarray,
1534 const Array<OneD, const NekDouble> &inarray,
1535 Array<OneD, NekDouble> &outarray)
1545 const Array<OneD,const NekDouble> &inarray,
1546 Array<OneD, NekDouble> &outarray,
1556 const Array<OneD, const NekDouble> &inarray,
1557 Array<OneD, NekDouble> &outarray,
1561 const Array<OneD, const NekDouble> &dirForcing)
1563 v_HelmSolve(inarray, outarray, flags, factors, varcoeff, dirForcing);
1571 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
1572 const Array<OneD, const NekDouble> &inarray,
1573 Array<OneD, NekDouble> &outarray,
1576 const Array<OneD, const NekDouble>& dirForcing)
1579 lambda, coeffstate,dirForcing);
1583 const Array<
OneD, Array<OneD, NekDouble> > &velocity,
1584 const Array<OneD, const NekDouble> &inarray,
1585 Array<OneD, NekDouble> &outarray,
1588 const Array<OneD, const NekDouble>& dirForcing)
1591 lambda, coeffstate,dirForcing);
1598 Array<OneD, NekDouble> &coord_1,
1599 Array<OneD, NekDouble> &coord_2)
1609 Array<OneD, NekDouble> &out_d0,
1610 Array<OneD, NekDouble> &out_d1,
1611 Array<OneD, NekDouble> &out_d2)
1621 const Array<OneD, const NekDouble> &inarray,
1622 Array<OneD, NekDouble> &out_d)
1629 const Array<OneD, const NekDouble> &inarray,
1630 Array<OneD, NekDouble> &out_d)
1639 const Array<OneD, const NekDouble> &inarray,
1640 Array<OneD, NekDouble> &outarray,
1652 const Array<OneD, const NekDouble> &inarray,
1653 Array<OneD, NekDouble> &outarray,
1665 const Array<OneD, NekDouble> &inarray1,
1666 const Array<OneD, NekDouble> &inarray2,
1667 Array<OneD, NekDouble> &outarray,
1677 Array<OneD, NekDouble> &BndVals,
1678 const Array<OneD, NekDouble> &TotField,
1688 Array<OneD, const NekDouble> &V1,
1689 Array<OneD, const NekDouble> &V2,
1690 Array<OneD, NekDouble> &outarray,
1703 "eid is larger than number of elements");
1704 return (*
m_exp)[eid]->GetCoordim();
1746 Array<OneD,NekDouble>& outarray)
1804 return (*m_exp).size();
1822 inline const boost::shared_ptr<LocalRegions::ExpansionVector>
1878 inline const Array<OneD, const boost::shared_ptr<ExpList> >
1890 const Array<
OneD,
const Array<OneD, NekDouble> > &Vec,
1891 const Array<OneD, const NekDouble> &Fwd,
1892 const Array<OneD, const NekDouble> &Bwd,
1893 Array<OneD, NekDouble> &Upwind)
1899 const Array<OneD, const NekDouble> &Vn,
1900 const Array<OneD, const NekDouble> &Fwd,
1901 const Array<OneD, const NekDouble> &Bwd,
1902 Array<OneD, NekDouble> &Upwind)
1923 Array<
OneD, Array<OneD, NekDouble> > &normals)
1929 const Array<OneD, const NekDouble> &Fx,
1930 const Array<OneD, const NekDouble> &Fy,
1931 Array<OneD, NekDouble> &outarray)
1937 const Array<OneD, const NekDouble> &Fn,
1938 Array<OneD, NekDouble> &outarray)
1944 const Array<OneD, const NekDouble> &Fwd,
1945 const Array<OneD, const NekDouble> &Bwd,
1946 Array<OneD, NekDouble> &outarray)
1952 Array<OneD,NekDouble> &Fwd,
1953 Array<OneD,NekDouble> &Bwd)
1959 const Array<OneD,const NekDouble> &field,
1960 Array<OneD,NekDouble> &Fwd,
1961 Array<OneD,NekDouble> &Bwd)
1973 const Array<OneD, const NekDouble> &inarray,
1974 Array<OneD,NekDouble> &outarray)
1979 inline const Array<OneD,const SpatialDomains::BoundaryConditionShPtr>
1986 inline Array<OneD, SpatialDomains::BoundaryConditionShPtr>
1994 const std::string varName,
2032 const Array<OneD,const NekDouble> &inarray,
2033 Array<OneD, NekDouble> &outarray,
2046 Array<OneD,int> &EdgeID)