37 #include <boost/core/ignore_unused.hpp>
80 namespace MultiRegions
110 ::AllocateSharedPtr()),
126 std::enable_shared_from_this<
ExpList>(in),
127 m_expType(in.m_expType),
129 m_session(in.m_session),
131 m_ncoeffs(in.m_ncoeffs),
132 m_npoints(in.m_npoints),
135 m_collections(in.m_collections),
136 m_collectionsDoInit(in.m_collectionsDoInit),
137 m_coll_coeff_offset(in.m_coll_coeff_offset),
138 m_coll_phys_offset(in.m_coll_phys_offset),
139 m_coeff_offset(in.m_coeff_offset),
140 m_phys_offset(in.m_phys_offset),
141 m_blockMat(in.m_blockMat),
156 const std::vector<unsigned int> &eIDs,
157 const bool DeclareCoeffPhysArrays,
159 m_expType(in.m_expType),
161 m_session(in.m_session),
165 ::AllocateSharedPtr()),
169 for (
int i=0; i < eIDs.size(); ++i)
171 (*m_exp).push_back( (*(in.
m_exp))[eIDs[i]]);
204 const bool DeclareCoeffPhysArrays,
205 const std::string &var,
207 m_comm(pSession->GetComm()),
212 ::AllocateSharedPtr()),
218 = graph->GetExpansionInfo(var);
251 const bool DeclareCoeffPhysArrays,
253 m_comm(pSession->GetComm()),
257 ::AllocateSharedPtr()),
281 ::AllocateSharedPtr()),
287 (*m_exp).push_back(Point);
319 const bool DeclareCoeffPhysArrays,
320 const std::string variable,
322 m_comm(pSession->GetComm()),
327 ::AllocateSharedPtr()),
331 boost::ignore_unused(variable,ImpType);
332 int i, j, id, elmtid = 0;
350 for(i = 0; i < bndCond.size(); ++i)
352 if(bndCond[i]->GetBoundaryConditionType() ==
355 for(j = 0; j < bndConstraint[i]->GetExpSize(); ++j)
357 if((exp0D = std::dynamic_pointer_cast<
359 bndConstraint[i]->
GetExp(j))))
363 PointGeom = exp0D->GetGeom()->GetVertex(0);
366 tracesDone.insert(PointGeom->GetVid());
368 else if((exp1D = std::dynamic_pointer_cast<
370 bndConstraint[i]->
GetExp(j))))
375 GetBasis(0)->GetBasisKey();
376 segGeom = exp1D->GetGeom1D();
379 tracesDone.insert(segGeom->GetGlobalID());
382 else if ((exp2D = std::dynamic_pointer_cast
383 <LocalRegions::Expansion2D>(bndConstraint[i]->
388 LibUtilities::BasisKey bkey0 = exp2D
389 ->GetBasis(0)->GetBasisKey();
390 LibUtilities::BasisKey bkey1 = exp2D
391 ->GetBasis(1)->GetBasisKey();
392 FaceGeom = exp2D->GetGeom2D();
395 if((QuadGeom = std::dynamic_pointer_cast<
396 SpatialDomains::QuadGeom>(FaceGeom)))
400 tracesDone.insert(QuadGeom->GetGlobalID());
403 else if((TriGeom = std::dynamic_pointer_cast<
404 SpatialDomains::TriGeom>(FaceGeom)))
408 tracesDone.insert(TriGeom->GetGlobalID());
413 "proper face geometry failed");
417 exp->SetElmtId(elmtid++);
420 (*m_exp).push_back(exp);
426 LibUtilities::BasisKey> > edgeOrders;
429 pair<LibUtilities::BasisKey,
430 LibUtilities::BasisKey> > > faceOrders;
432 for(i = 0; i < locexp.size(); ++i)
435 std::dynamic_pointer_cast<
436 LocalRegions::Expansion1D>(locexp[i])))
440 for(j = 0; j < 2; ++j)
442 PointGeom = (exp1D->GetGeom1D())->GetVertex(j);
443 id = PointGeom->GetVid();
446 if (tracesDone.count(
id) != 0)
453 tracesDone.insert(
id);
454 exp->SetElmtId(elmtid++);
455 (*m_exp).push_back(exp);
459 std::dynamic_pointer_cast<
460 LocalRegions::Expansion2D>(locexp[i])))
463 for(j = 0; j < locexp[i]->GetNtraces(); ++j)
465 segGeom = exp2D->GetGeom2D()->GetEdge(j);
466 id = segGeom->GetGlobalID();
468 if (tracesDone.count(
id) != 0)
473 auto it = edgeOrders.find(
id);
475 if (it == edgeOrders.end())
477 edgeOrders.insert(std::make_pair(
id, std::make_pair(
478 segGeom, locexp[i]->GetTraceBasisKey(j))));
482 LibUtilities::BasisKey edge
483 = locexp[i]->GetTraceBasisKey(j);
484 LibUtilities::BasisKey existing
487 int np1 = edge .GetNumPoints();
488 int np2 = existing.GetNumPoints();
489 int nm1 = edge .GetNumModes ();
490 int nm2 = existing.GetNumModes ();
492 if (np2 >= np1 && nm2 >= nm1)
496 else if (np2 < np1 && nm2 < nm1)
498 it->second.second = edge;
503 "inappropriate number of points/modes (max"
504 "num of points is not set with max order)");
510 dynamic_pointer_cast<
511 LocalRegions::Expansion3D>(locexp[i])))
514 for (j = 0; j < exp3D->GetNtraces(); ++j)
516 FaceGeom = exp3D->GetGeom3D()->GetFace(j);
517 id = FaceGeom->GetGlobalID();
519 if(tracesDone.count(
id) != 0)
523 auto it = faceOrders.find(
id);
525 if (it == faceOrders.end())
527 LibUtilities::BasisKey face_dir0
528 = locexp[i]->GetTraceBasisKey(j,0);
529 LibUtilities::BasisKey face_dir1
530 = locexp[i]->GetTraceBasisKey(j,1);
534 id, std::make_pair(FaceGeom,
535 std::make_pair(face_dir0, face_dir1))));
539 LibUtilities::BasisKey face0 =
540 locexp[i]->GetTraceBasisKey(j,0);
541 LibUtilities::BasisKey face1 =
542 locexp[i]->GetTraceBasisKey(j,1);
543 LibUtilities::BasisKey existing0 =
544 it->second.second.first;
545 LibUtilities::BasisKey existing1 =
546 it->second.second.second;
548 int np11 = face0 .GetNumPoints();
549 int np12 = face1 .GetNumPoints();
550 int np21 = existing0.GetNumPoints();
551 int np22 = existing1.GetNumPoints();
552 int nm11 = face0 .GetNumModes ();
553 int nm12 = face1 .GetNumModes ();
554 int nm21 = existing0.GetNumModes ();
555 int nm22 = existing1.GetNumModes ();
557 if ((np22 >= np12 || np21 >= np11) &&
558 (nm22 >= nm12 || nm21 >= nm11))
562 else if((np22 < np12 || np21 < np11) &&
563 (nm22 < nm12 || nm21 < nm11))
565 it->second.second.first = face0;
566 it->second.second.second = face1;
571 "inappropriate number of points/modes (max"
572 "num of points is not set with max order)");
579 int nproc =
m_comm->GetSize();
580 int tracepr =
m_comm->GetRank();
587 for(i = 0; i < locexp.size(); ++i)
589 tCnt += locexp[i]->GetNtraces();
594 Array<OneD, int> tracesCnt(nproc, 0);
595 tracesCnt[tracepr] = tCnt;
599 int totTraceCnt =
Vmath::Vsum(nproc, tracesCnt, 1);
600 Array<OneD, int> tTotOffsets(nproc,0);
602 for (i = 1; i < nproc; ++i)
604 tTotOffsets[i] = tTotOffsets[i-1] + tracesCnt[i-1];
608 Array<OneD, int> TracesTotID(totTraceCnt, 0);
609 Array<OneD, int> TracesTotNm0(totTraceCnt, 0);
610 Array<OneD, int> TracesTotNm1(totTraceCnt, 0);
611 Array<OneD, int> TracesTotPnts0(totTraceCnt, 0);
612 Array<OneD, int> TracesTotPnts1(totTraceCnt, 0);
614 int cntr = tTotOffsets[tracepr];
616 for(i = 0; i < locexp.size(); ++i)
618 if((exp2D = locexp[i]->as<LocalRegions::Expansion2D>()))
621 int nedges = locexp[i]->GetNtraces();
623 for(j = 0; j < nedges; ++j, ++cntr)
625 LibUtilities::BasisKey bkeyEdge =
626 locexp[i]->GetTraceBasisKey(j);
627 TracesTotID [cntr] = exp2D->GetGeom2D()->GetEid(j);
628 TracesTotNm0 [cntr] = bkeyEdge.GetNumModes();
629 TracesTotPnts0[cntr] = bkeyEdge.GetNumPoints();
632 else if((exp3D = locexp[i]->as<LocalRegions::Expansion3D>()))
634 int nfaces = locexp[i]->GetNtraces();
636 for(j = 0; j < nfaces; ++j, ++cntr)
638 LibUtilities::BasisKey face_dir0
639 = locexp[i]->GetTraceBasisKey(j,0);
640 LibUtilities::BasisKey face_dir1
641 = locexp[i]->GetTraceBasisKey(j,1);
643 TracesTotID[cntr] = exp3D->GetGeom3D()->GetFid(j);
644 TracesTotNm0[cntr] = face_dir0.GetNumModes ();
645 TracesTotNm1[cntr] = face_dir1.GetNumModes ();
646 TracesTotPnts0[cntr] = face_dir0.GetNumPoints();
647 TracesTotPnts1[cntr] = face_dir1.GetNumPoints();
661 if(edgeOrders.size())
663 for (i = 0; i < totTraceCnt; ++i)
665 auto it = edgeOrders.find(TracesTotID[i]);
667 if (it == edgeOrders.end())
672 LibUtilities::BasisKey existing
674 LibUtilities::BasisKey edge(existing.GetBasisType(),
676 LibUtilities::PointsKey(
678 existing.GetPointsType()));
680 int np1 = edge .GetNumPoints();
681 int np2 = existing.GetNumPoints();
682 int nm1 = edge .GetNumModes ();
683 int nm2 = existing.GetNumModes ();
685 if (np2 >= np1 && nm2 >= nm1)
689 else if (np2 < np1 && nm2 < nm1)
691 it->second.second = edge;
696 "inappropriate number of points/modes (max "
697 "num of points is not set with max order)");
701 else if(faceOrders.size())
703 for (i = 0; i < totTraceCnt; ++i)
705 auto it = faceOrders.find(TracesTotID[i]);
707 if (it == faceOrders.end())
712 LibUtilities::BasisKey existing0 =
713 it->second.second.first;
714 LibUtilities::BasisKey existing1 =
715 it->second.second.second;
716 LibUtilities::BasisKey face0(
717 existing0.GetBasisType(), TracesTotNm0[i],
718 LibUtilities::PointsKey(TracesTotPnts0[i],
719 existing0.GetPointsType()));
720 LibUtilities::BasisKey face1(
721 existing1.GetBasisType(), TracesTotNm1[i],
722 LibUtilities::PointsKey(TracesTotPnts1[i],
723 existing1.GetPointsType()));
725 int np11 = face0 .GetNumPoints();
726 int np12 = face1 .GetNumPoints();
727 int np21 = existing0.GetNumPoints();
728 int np22 = existing1.GetNumPoints();
729 int nm11 = face0 .GetNumModes ();
730 int nm12 = face1 .GetNumModes ();
731 int nm21 = existing0.GetNumModes ();
732 int nm22 = existing1.GetNumModes ();
734 if ((np22 >= np12 || np21 >= np11) &&
735 (nm22 >= nm12 || nm21 >= nm11))
739 else if((np22 < np12 || np21 < np11) &&
740 (nm22 < nm12 || nm21 < nm11))
742 it->second.second.first = face0;
743 it->second.second.second = face1;
748 "inappropriate number of points/modes (max "
749 "num of points is not set with max order)");
755 if(edgeOrders.size())
757 for (
auto &it : edgeOrders)
761 exp->SetElmtId(elmtid++);
762 (*m_exp).push_back(exp);
767 for (
auto &it : faceOrders)
769 FaceGeom = it.second.first;
771 if ((QuadGeom = std::dynamic_pointer_cast<
772 SpatialDomains::QuadGeom>(FaceGeom)))
776 it.second.second.second,
779 else if ((TriGeom = std::dynamic_pointer_cast<
780 SpatialDomains::TriGeom>(FaceGeom)))
784 it.second.second.second,
787 exp->SetElmtId(elmtid++);
788 (*m_exp).push_back(exp);
828 const bool DeclareCoeffPhysArrays,
829 const std::string variable,
830 bool SetToOneSpaceDimension,
838 ::AllocateSharedPtr()),
852 int meshdim = graph->GetMeshDimension();
856 = graph->GetExpansionInfo(variable);
860 for(
auto &compIt : domain)
863 for(j = 0; j < compIt.second->m_geomVec.size(); ++j)
865 if((PtGeom = std::dynamic_pointer_cast <
873 else if((SegGeom = std::dynamic_pointer_cast<
883 auto expIt = expansions.find(SegGeom->GetGlobalID());
885 "Failed to find basis key");
886 bkey = expIt->second->m_basisKeyVector[0];
890 bkey = graph->GetEdgeBasisKey(SegGeom, variable);
893 if(SetToOneSpaceDimension)
896 SegGeom->GenerateOneSpaceDimGeom();
908 else if ((TriGeom = std::dynamic_pointer_cast<
914 = graph->GetFaceBasisKey(TriGeom,0,variable);
916 = graph->GetFaceBasisKey(TriGeom,1,variable);
918 if (graph->GetExpansionInfo().begin()->second->
919 m_basisKeyVector[0].GetBasisType() ==
935 else if ((QuadGeom = std::dynamic_pointer_cast<
941 = graph->GetFaceBasisKey(QuadGeom, 0, variable);
943 = graph->GetFaceBasisKey(QuadGeom, 1, variable);
951 "dynamic cast to a Geom (possibly 3D) failed");
954 exp->SetElmtId(elmtid++);
955 (*m_exp).push_back(exp);
991 for(i = 0; i <
m_exp->size(); ++i)
996 m_npoints += (*m_exp)[i]->GetTotPoints();
1000 if(DeclareCoeffPhysArrays)
1008 for (
int i = 0; i <
m_exp->size(); ++i)
1012 int loccoeffs = (*m_exp)[i]->GetNcoeffs();
1014 for(
int j = 0; j < loccoeffs; ++j)
1039 for (
auto &expIt : expmap)
1043 switch(expInfo->m_basisKeyVector.size())
1048 "Cannot mix expansion dimensions in one vector");
1051 if ((SegmentGeom = std::dynamic_pointer_cast<
1056 expInfo->m_basisKeyVector[0];
1064 "dynamic cast to a 1D Geom failed");
1071 "Cannot mix expansion dimensions in one vector");
1077 if ((TriangleGeom = std::dynamic_pointer_cast<SpatialDomains
1078 ::TriGeom>(expInfo->m_geomShPtr)))
1099 else if ((QuadrilateralGeom = std::dynamic_pointer_cast<
1108 "dynamic cast to a 2D Geom failed");
1115 "Cannot mix expansion dimensions in one vector");
1122 if((TetGeom = std::dynamic_pointer_cast<
1130 "LocalRegions::NodalTetExp is not implemented "
1139 else if((PrismGeom =
1140 std::dynamic_pointer_cast<SpatialDomains
1141 ::PrismGeom>(expInfo->m_geomShPtr)))
1146 else if((PyrGeom = std::dynamic_pointer_cast<
1153 else if((HexGeom = std::dynamic_pointer_cast<
1162 "dynamic cast to a Geom failed");
1168 "Dimension of basis key is greater than 3");
1172 exp->SetElmtId(
id++);
1175 (*m_exp).push_back(exp);
1206 int nrows = blockmat->GetRows();
1207 int ncols = blockmat->GetColumns();
1214 out = (*blockmat)*in;
1226 for (
int i = 0; i < (*m_exp).size(); ++i)
1228 (*m_exp)[i]->MultiplyByQuadratureMetric(
1243 for (
int i = 0; i < (*m_exp).size(); ++i)
1245 (*m_exp)[i]->DivideByQuadratureMetric(
1307 for(i = 0; i < (*m_exp).size(); ++i)
1309 (*m_exp)[i]->IProductWRTDerivBase(dir,inarray+
m_phys_offset[i],
1325 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1326 int nq = direction.size()/coordim;
1333 for(
int i = 0; i < (*m_exp).size(); ++i)
1335 npts_e = (*m_exp)[i]->GetTotPoints();
1338 for (
int k = 0; k<coordim; ++k)
1341 &locdir[k*npts_e], 1);
1344 (*m_exp)[i]->IProductWRTDirectionalDerivBase(
1370 ASSERTL1(inarray.size() >= dim,
"inarray is not of sufficient dimension");
1490 e_out_d0 = out_d0 + offset;
1491 e_out_d1 = out_d1 + offset;
1492 e_out_d2 = out_d2 + offset;
1497 e_out_d0,e_out_d1, e_out_d2);
1521 for(i=0; i<(*m_exp).size(); ++i)
1524 (*m_exp)[i]->PhysDeriv_s(inarray+
m_phys_offset[i],e_out_ds);
1530 for(i=0; i<(*m_exp).size(); i++)
1533 (*m_exp)[i]->PhysDeriv_n(inarray+
m_phys_offset[i],e_out_dn);
1550 int intdir= (int)edir;
1556 e_out_d = out_d + offset;
1575 bool halfMode =
false;
1578 m_session->MatchSolverInfo(
"ModeType",
"HalfMode",
1632 ASSERTL0(0,
"Dimension not supported");
1644 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
1645 int nq = direction.size() / coordim;
1651 for(
int i = 0; i < (*m_exp).size(); ++i)
1653 npts_e = (*m_exp)[i]->GetTotPoints();
1656 for (
int k = 0; k<coordim; ++k)
1659 &locdir[k*npts_e], 1);
1662 (*m_exp)[i]->PhysDirectionalDeriv(
1678 for(
int i = 0; i < (*m_exp).size(); ++i)
1680 (*m_exp)[i]->ExponentialFilter(
1705 if(inarray.get() == outarray.get())
1708 out = (*InvMass)*in;
1713 out = (*InvMass)*in;
1753 for(i= 0; i < (*m_exp).size(); ++i)
1755 (*m_exp)[i]->FwdTrans_BndConstrained(inarray+
m_phys_offset[i],
1769 boost::ignore_unused(field);
1782 (*
m_exp)[0]->GetBasisType(0)
1784 "Smoothing is currently not allowed unless you are using "
1785 "a nodal base for efficiency reasons. The implemented "
1786 "smoothing technique requires the mass matrix inversion "
1787 "which is trivial just for GLL_LAGRANGE_SEM and "
1788 "GAUSS_LAGRANGE_SEMexpansions.");
1817 map<int,int> elmt_id;
1822 for(i = 0 ; i < (*m_exp).size(); ++i)
1824 if((*
m_exp)[i]->DetShapeType()
1827 elmt_id[n_exp++] = i;
1833 n_exp = (*m_exp).size();
1834 for(i = 0; i < n_exp; ++i)
1848 for(i = 0; i < n_exp; ++i)
1850 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
1851 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1858 for(i = 0; i < n_exp; ++i)
1860 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1861 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetTotPoints();
1872 for(i = 0; i < n_exp; ++i)
1874 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1875 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1883 for(i = 0; i < n_exp; ++i)
1885 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->GetNcoeffs();
1886 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1894 for(i = 0; i < n_exp; ++i)
1896 nrows[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1897 ncols[i] = (*m_exp)[elmt_id.find(i)->second]->NumDGBndryCoeffs();
1905 "Global Matrix creation not defined for this "
1918 for(i = cnt1 = 0; i < n_exp; ++i)
1934 (*
m_exp)[eid]->DetShapeType(),
1939 loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>((*
m_exp)[elmt_id.find(i)->second])->GetLocMatrix(matkey);
1940 BlkMatrix->SetBlock(i,i,loc_mat);
1957 return matrixIter->second;
2000 for(
int i= 0; i < (*m_exp).size(); ++i)
2015 (*
m_exp)[i]->DetShapeType(),
2020 tmp_outarray = outarray+
2038 int i,j,n,gid1,gid2,cntdim1,cntdim2;
2042 unsigned int glob_rows = 0;
2043 unsigned int glob_cols = 0;
2044 unsigned int loc_rows = 0;
2045 unsigned int loc_cols = 0;
2047 bool assembleFirstDim =
false;
2048 bool assembleSecondDim =
false;
2055 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2057 assembleFirstDim =
false;
2058 assembleSecondDim =
true;
2063 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2066 assembleFirstDim =
true;
2067 assembleSecondDim =
false;
2075 glob_rows = locToGloMap->GetNumGlobalCoeffs();
2076 glob_cols = locToGloMap->GetNumGlobalCoeffs();
2078 assembleFirstDim =
true;
2079 assembleSecondDim =
true;
2085 "Global Matrix creation not defined for this "
2097 for(n = cntdim1 = cntdim2 = 0; n < (*m_exp).size(); ++n)
2112 (*
m_exp)[eid]->DetShapeType(),
2116 loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>((*
m_exp)[n])->GetLocMatrix(matkey);
2118 loc_rows = loc_mat->GetRows();
2119 loc_cols = loc_mat->GetColumns();
2121 for(i = 0; i < loc_rows; ++i)
2123 if(assembleFirstDim)
2125 gid1 = locToGloMap->GetLocalToGlobalMap (cntdim1 + i);
2126 sign1 = locToGloMap->GetLocalToGlobalSign(cntdim1 + i);
2134 for(j = 0; j < loc_cols; ++j)
2136 if(assembleSecondDim)
2139 ->GetLocalToGlobalMap(cntdim2 + j);
2141 ->GetLocalToGlobalSign(cntdim2 + j);
2150 coord = make_pair(gid1,gid2);
2151 if( spcoomat.count(coord) == 0 )
2153 spcoomat[coord] = sign1*sign2*(*loc_mat)(i,j);
2157 spcoomat[coord] += sign1*sign2*(*loc_mat)(i,j);
2161 cntdim1 += loc_rows;
2162 cntdim2 += loc_cols;
2172 int i,j,n,gid1,gid2,loc_lda,eid;
2176 int totDofs = locToGloMap->GetNumGlobalCoeffs();
2177 int NumDirBCs = locToGloMap->GetNumGlobalDirBndCoeffs();
2179 unsigned int rows = totDofs - NumDirBCs;
2180 unsigned int cols = totDofs - NumDirBCs;
2184 int bwidth = locToGloMap->GetFullSystemBandWidth();
2196 if( (2*(bwidth+1)) < rows)
2216 for(n = 0; n < (*m_exp).size(); ++n)
2231 (*
m_exp)[eid]->DetShapeType(),
2235 loc_mat = std::dynamic_pointer_cast<LocalRegions::Expansion>((*
m_exp)[n])->GetLocMatrix(matkey);
2243 int rows = loc_mat->GetRows();
2244 int cols = loc_mat->GetColumns();
2245 const NekDouble *dat = loc_mat->GetRawPtr();
2247 Blas::Dscal(rows*cols,loc_mat->Scale(),new_mat->GetRawPtr(),1);
2252 (*m_exp)[n]->AddRobinMassMatrix(rBC->m_robinID,rBC->m_robinPrimitiveCoeffs,new_mat);
2260 loc_lda = loc_mat->GetColumns();
2262 for(i = 0; i < loc_lda; ++i)
2264 gid1 = locToGloMap->GetLocalToGlobalMap(
m_coeff_offset[n] + i) - NumDirBCs;
2265 sign1 = locToGloMap->GetLocalToGlobalSign(
m_coeff_offset[n] + i);
2268 for(j = 0; j < loc_lda; ++j)
2270 gid2 = locToGloMap->GetLocalToGlobalMap(
m_coeff_offset[n] + j) - NumDirBCs;
2271 sign2 = locToGloMap->GetLocalToGlobalSign(
m_coeff_offset[n] + j);
2278 if((matStorage ==
eFULL)||(gid2 >= gid1))
2280 value = Gmat->GetValue(gid1,gid2) + sign1*sign2*(*loc_mat)(i,j);
2281 Gmat->SetValue(gid1,gid2,value);
2326 vExpList, locToGloMap);
2334 const map<int,RobinBCInfoSharedPtr> vRobinBCInfo =
GetRobinBCInfo();
2345 vExpList,locToGloMap);
2421 bool returnNearestElmt,
2427 return GetExpIndex(gloCoord,Lcoords,tol,returnNearestElmt,cachedId,maxDistance);
2435 bool returnNearestElmt,
2449 for(
int i = (*m_exp).size()-1; i >= 0; --i)
2460 if(cachedId >= 0 && cachedId < (*m_exp).size())
2463 if((*
m_exp)[cachedId]->GetGeom()->MinMaxCheck(gloCoords) &&
2464 (*
m_exp)[cachedId]->GetGeom()->ContainsPoint(gloCoords,
2465 locCoords, tol, nearpt))
2469 else if(returnNearestElmt && (nearpt < nearpt_min))
2474 nearpt_min = nearpt;
2475 Vmath::Vcopy(locCoords.size(),locCoords, 1, savLocCoords, 1);
2479 NekDouble x = (gloCoords.size() > 0 ? gloCoords[0] : 0.0);
2480 NekDouble y = (gloCoords.size() > 1 ? gloCoords[1] : 0.0);
2481 NekDouble z = (gloCoords.size() > 2 ? gloCoords[2] : 0.0);
2488 std::vector<int> elmts =
m_graph->GetElementsContainingPoint(
p);
2491 for (
int i = 0; i < elmts.size(); ++i)
2498 if ((*
m_exp)[
id]->GetGeom()->ContainsPoint(gloCoords,
2499 locCoords, tol, nearpt))
2503 else if(returnNearestElmt && (nearpt < nearpt_min))
2508 nearpt_min = nearpt;
2509 Vmath::Vcopy(locCoords.size(),locCoords, 1, savLocCoords, 1);
2515 if(returnNearestElmt && nearpt_min <= maxDistance)
2518 std::string
msg =
"Failed to find point within element to "
2520 + boost::lexical_cast<std::string>(tol)
2521 +
" using local point ("
2522 + boost::lexical_cast<std::string>(locCoords[0]) +
","
2523 + boost::lexical_cast<std::string>(locCoords[1]) +
","
2524 + boost::lexical_cast<std::string>(locCoords[1])
2526 + boost::lexical_cast<std::string>(min_id);
2529 Vmath::Vcopy(locCoords.size(),savLocCoords, 1, locCoords, 1);
2548 "Invalid coordinate dimension.");
2553 ASSERTL0(elmtIdx > 0,
"Unable to find element containing point.");
2559 return (*
m_exp)[elmtIdx]->StdPhysEvaluate(xi, elmtPhys);
2589 for (
int i = 0; i <
m_exp->size(); ++i)
2591 (*m_exp)[i]->GetGeom()->Reset(
m_graph->GetCurvedEdges(),
2596 for (
int i = 0; i <
m_exp->size(); ++i)
2598 (*m_exp)[i]->Reset();
2615 int coordim =
GetExp(0)->GetCoordim();
2616 char vars[3] = {
'x',
'y',
'z' };
2627 outfile <<
"Variables = x";
2628 for (
int i = 1; i < coordim; ++i)
2630 outfile <<
", " << vars[i];
2635 outfile <<
", " << var;
2638 outfile << std::endl << std::endl;
2651 int nBases = (*m_exp)[0]->GetNumBases();
2656 if (expansion == -1)
2664 GetCoords(coords[0], coords[1], coords[2]);
2666 for (i = 0; i <
m_exp->size(); ++i)
2670 for (j = 0; j < nBases; ++j)
2672 numInt *= (*m_exp)[i]->GetNumPoints(j)-1;
2675 numBlocks += numInt;
2680 nPoints = (*m_exp)[expansion]->GetTotPoints();
2686 (*m_exp)[expansion]->GetCoords(coords[0], coords[1], coords[2]);
2689 for (j = 0; j < nBases; ++j)
2691 numBlocks *= (*m_exp)[expansion]->GetNumPoints(j)-1;
2699 int nPlanes =
GetZIDs().size();
2700 NekDouble tmp = numBlocks * (nPlanes-1.0) / nPlanes;
2701 numBlocks = (int)tmp;
2709 outfile <<
"Zone, N=" << nPoints <<
", E="
2710 << numBlocks <<
", F=FEBlock" ;
2715 outfile <<
", ET=QUADRILATERAL" << std::endl;
2718 outfile <<
", ET=BRICK" << std::endl;
2722 "Not set up for this type of output");
2727 for (j = 0; j < coordim; ++j)
2729 for (i = 0; i < nPoints; ++i)
2731 outfile << coords[j][i] <<
" ";
2732 if (i % 1000 == 0 && i)
2734 outfile << std::endl;
2737 outfile << std::endl;
2745 int nbase = (*m_exp)[0]->GetNumBases();
2748 std::shared_ptr<LocalRegions::ExpansionVector> exp =
m_exp;
2750 if (expansion != -1)
2752 exp = std::shared_ptr<LocalRegions::ExpansionVector>(
2754 (*exp)[0] = (*m_exp)[expansion];
2759 for(i = 0; i < (*exp).size(); ++i)
2761 const int np0 = (*exp)[i]->GetNumPoints(0);
2762 const int np1 = (*exp)[i]->GetNumPoints(1);
2764 for(j = 1; j < np1; ++j)
2766 for(k = 1; k < np0; ++k)
2768 outfile << cnt + (j-1)*np0 + k <<
" ";
2769 outfile << cnt + (j-1)*np0 + k+1 <<
" ";
2770 outfile << cnt + j *np0 + k+1 <<
" ";
2771 outfile << cnt + j *np0 + k << endl;
2778 else if (nbase == 3)
2780 for(i = 0; i < (*exp).size(); ++i)
2782 const int np0 = (*exp)[i]->GetNumPoints(0);
2783 const int np1 = (*exp)[i]->GetNumPoints(1);
2784 const int np2 = (*exp)[i]->GetNumPoints(2);
2785 const int np01 = np0*np1;
2787 for(j = 1; j < np2; ++j)
2789 for(k = 1; k < np1; ++k)
2791 for(l = 1; l < np0; ++l)
2793 outfile << cnt + (j-1)*np01 + (k-1)*np0 + l <<
" ";
2794 outfile << cnt + (j-1)*np01 + (k-1)*np0 + l+1 <<
" ";
2795 outfile << cnt + (j-1)*np01 + k *np0 + l+1 <<
" ";
2796 outfile << cnt + (j-1)*np01 + k *np0 + l <<
" ";
2797 outfile << cnt + j *np01 + (k-1)*np0 + l <<
" ";
2798 outfile << cnt + j *np01 + (k-1)*np0 + l+1 <<
" ";
2799 outfile << cnt + j *np01 + k *np0 + l+1 <<
" ";
2800 outfile << cnt + j *np01 + k *np0 + l << endl;
2820 if (expansion == -1)
2828 for(
int i = 0; i < totpoints; ++i)
2830 outfile <<
m_phys[i] <<
" ";
2831 if(i % 1000 == 0 && i)
2833 outfile << std::endl;
2836 outfile << std::endl;
2841 int nPoints = (*m_exp)[expansion]->GetTotPoints();
2843 for (
int i = 0; i < nPoints; ++i)
2848 outfile << std::endl;
2854 outfile <<
"<?xml version=\"1.0\"?>" << endl;
2855 outfile <<
"<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" "
2856 <<
"byte_order=\"LittleEndian\">" << endl;
2857 outfile <<
" <UnstructuredGrid>" << endl;
2862 outfile <<
" </UnstructuredGrid>" << endl;
2863 outfile <<
"</VTKFile>" << endl;
2868 boost::ignore_unused(istrip);
2870 int nbase = (*m_exp)[expansion]->GetNumBases();
2871 int ntot = (*m_exp)[expansion]->GetTotPoints();
2875 for(i = 0; i < nbase; ++i)
2877 nquad[i] = (*m_exp)[expansion]->GetNumPoints(i);
2878 ntotminus *= (nquad[i]-1);
2885 (*m_exp)[expansion]->GetCoords(coords[0],coords[1],coords[2]);
2887 outfile <<
" <Piece NumberOfPoints=\""
2888 << ntot <<
"\" NumberOfCells=\""
2889 << ntotminus <<
"\">" << endl;
2890 outfile <<
" <Points>" << endl;
2891 outfile <<
" <DataArray type=\"Float64\" "
2892 <<
"NumberOfComponents=\"3\" format=\"ascii\">" << endl;
2894 for (i = 0; i < ntot; ++i)
2896 for (j = 0; j < 3; ++j)
2898 outfile << setprecision(8) << scientific
2899 << (float)coords[j][i] <<
" ";
2904 outfile <<
" </DataArray>" << endl;
2905 outfile <<
" </Points>" << endl;
2906 outfile <<
" <Cells>" << endl;
2907 outfile <<
" <DataArray type=\"Int32\" "
2908 <<
"Name=\"connectivity\" format=\"ascii\">" << endl;
2918 for (i = 0; i < nquad[0]-1; ++i)
2920 outfile << i <<
" " << i+1 << endl;
2928 for (i = 0; i < nquad[0]-1; ++i)
2930 for (j = 0; j < nquad[1]-1; ++j)
2932 outfile << j*nquad[0] + i <<
" "
2933 << j*nquad[0] + i + 1 <<
" "
2934 << (j+1)*nquad[0] + i + 1 <<
" "
2935 << (j+1)*nquad[0] + i << endl;
2944 for (i = 0; i < nquad[0]-1; ++i)
2946 for (j = 0; j < nquad[1]-1; ++j)
2948 for (k = 0; k < nquad[2]-1; ++k)
2950 outfile << k*nquad[0]*nquad[1] + j*nquad[0] + i <<
" "
2951 << k*nquad[0]*nquad[1] + j*nquad[0] + i + 1 <<
" "
2952 << k*nquad[0]*nquad[1] + (j+1)*nquad[0] + i + 1 <<
" "
2953 << k*nquad[0]*nquad[1] + (j+1)*nquad[0] + i <<
" "
2954 << (k+1)*nquad[0]*nquad[1] + j*nquad[0] + i <<
" "
2955 << (k+1)*nquad[0]*nquad[1] + j*nquad[0] + i + 1 <<
" "
2956 << (k+1)*nquad[0]*nquad[1] + (j+1)*nquad[0] + i + 1 <<
" "
2957 << (k+1)*nquad[0]*nquad[1] + (j+1)*nquad[0] + i <<
" " << endl;
2969 outfile <<
" </DataArray>" << endl;
2970 outfile <<
" <DataArray type=\"Int32\" "
2971 <<
"Name=\"offsets\" format=\"ascii\">" << endl;
2972 for (i = 0; i < ntotminus; ++i)
2974 outfile << i*ns+ns <<
" ";
2977 outfile <<
" </DataArray>" << endl;
2978 outfile <<
" <DataArray type=\"UInt8\" "
2979 <<
"Name=\"types\" format=\"ascii\">" << endl;
2980 for (i = 0; i < ntotminus; ++i)
2985 outfile <<
" </DataArray>" << endl;
2986 outfile <<
" </Cells>" << endl;
2987 outfile <<
" <PointData>" << endl;
2993 boost::ignore_unused(expansion);
2994 outfile <<
" </PointData>" << endl;
2995 outfile <<
" </Piece>" << endl;
3002 int nq = (*m_exp)[expansion]->GetTotPoints();
3005 outfile <<
" <DataArray type=\"Float64\" Name=\""
3006 << var <<
"\">" << endl;
3009 for(i = 0; i < nq; ++i)
3014 outfile <<
" </DataArray>" << endl;
3049 err = max(err,
abs(inarray[i] - soln[i]));
3083 for (i = 0; i < (*m_exp).size(); ++i)
3091 for (i = 0; i < (*m_exp).size(); ++i)
3125 for (i = 0; i < (*m_exp).size(); ++i)
3140 for (i = 0; i < (*m_exp).size(); ++i)
3143 for (j = 0; j < inarray.size(); ++j)
3147 flux += (*m_exp)[i]->VectorFlux(tmp);
3156 "This method is not defined or valid for this class type");
3164 "This method is not defined or valid for this class type");
3172 "This method is not defined or valid for this class type");
3179 boost::ignore_unused(lhom);
3181 "This method is not defined or valid for this class type");
3187 "This method is not defined or valid for this class type");
3195 "This method is not defined or valid for this class type");
3204 "This method is not defined or valid for this class type");
3208 const std::string &fileName,
3210 const std::string &varName,
3211 const std::shared_ptr<ExpList> locExpList)
3213 string varString = fileName.substr(0, fileName.find_last_of(
"."));
3214 int j, k, len = varString.length();
3215 varString = varString.substr(len-1, len);
3217 std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef;
3218 std::vector<std::vector<NekDouble> > FieldData;
3224 f->Import(fileName, FieldDef, FieldData);
3227 for (j = 0; j < FieldDef.size(); ++j)
3229 for (k = 0; k < FieldDef[j]->m_fields.size(); ++k)
3231 if (FieldDef[j]->m_fields[k] == varName)
3234 locExpList->ExtractDataToCoeffs(
3235 FieldDef[j], FieldData[j],
3236 FieldDef[j]->m_fields[k],
3237 locExpList->UpdateCoeffs());
3243 ASSERTL0(found,
"Could not find variable '"+varName+
3244 "' in file boundary condition "+fileName);
3245 locExpList->BwdTrans_IterPerExp(
3246 locExpList->GetCoeffs(),
3247 locExpList->UpdatePhys());
3274 for (i = 0; i < (*m_exp).size(); ++i)
3289 std::vector<NekDouble> &HomoLen,
3291 std::vector<unsigned int> &HomoSIDs,
3292 std::vector<unsigned int> &HomoZIDs,
3293 std::vector<unsigned int> &HomoYIDs)
3300 ASSERTL1(NumHomoDir == HomoBasis.size(),
"Homogeneous basis is not the same length as NumHomoDir");
3301 ASSERTL1(NumHomoDir == HomoLen.size(),
"Homogeneous length vector is not the same length as NumHomDir");
3320 for(s = startenum; s <= endenum; ++s)
3322 std::vector<unsigned int> elementIDs;
3323 std::vector<LibUtilities::BasisType> basis;
3324 std::vector<unsigned int> numModes;
3325 std::vector<std::string> fields;
3328 bool UniOrder =
true;
3333 for(
int i = 0; i < (*m_exp).size(); ++i)
3335 if((*
m_exp)[i]->GetGeom()->GetShapeType() == shape)
3337 elementIDs.push_back((*
m_exp)[i]->GetGeom()->GetGlobalID());
3340 for(
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3342 basis.push_back((*
m_exp)[i]->GetBasis(j)->GetBasisType());
3343 numModes.push_back((*
m_exp)[i]->GetBasis(j)->GetNumModes());
3347 for(n = 0 ; n < NumHomoDir; ++n)
3349 basis.push_back(HomoBasis[n]->GetBasisType());
3350 numModes.push_back(HomoBasis[n]->GetNumModes());
3357 ASSERTL0((*
m_exp)[i]->GetBasis(0)->GetBasisType() == basis[0],
"Routine is not set up for multiple bases definitions");
3359 for(
int j = 0; j < (*m_exp)[i]->GetNumBases(); ++j)
3361 numModes.push_back((*
m_exp)[i]->GetBasis(j)->GetNumModes());
3362 if(numModes[j] != (*
m_exp)[i]->GetBasis(j)->GetNumModes())
3368 for(n = 0 ; n < NumHomoDir; ++n)
3370 numModes.push_back(HomoBasis[n]->GetNumModes());
3377 if(elementIDs.size() > 0)
3382 UniOrder, numModes,fields,
3383 NumHomoDir, HomoLen, homoStrips,
3384 HomoSIDs, HomoZIDs, HomoYIDs);
3385 fielddef.push_back(fdef);
3395 std::vector<LibUtilities::FieldDefinitionsSharedPtr> returnval;
3419 map<int, int> ElmtID_to_ExpID;
3420 for(i = 0; i < (*m_exp).size(); ++i)
3422 ElmtID_to_ExpID[(*m_exp)[i]->GetGeom()->GetGlobalID()] = i;
3425 for(i = 0; i < fielddef->m_elementIDs.size(); ++i)
3427 int eid = ElmtID_to_ExpID[fielddef->m_elementIDs[i]];
3428 int datalen = (*m_exp)[eid]->GetNcoeffs();
3437 std::vector<NekDouble> &fielddata,
3459 std::vector<NekDouble> &fielddata,
3465 int modes_offset = 0;
3466 int datalen = fielddata.size()/fielddef->m_fields.size();
3469 for(i = 0; i < fielddef->m_fields.size(); ++i)
3471 if(fielddef->m_fields[i] == field)
3478 ASSERTL0(i != fielddef->m_fields.size(),
3479 "Field (" + field +
") not found in file.");
3486 for(i = (*m_exp).size()-1; i >= 0; --i)
3492 for (i = 0; i < fielddef->m_elementIDs.size(); ++i)
3496 if (fielddef->m_uniOrder ==
true)
3502 fielddef->m_shapeType, fielddef->m_numModes, modes_offset);
3504 const int elmtId = fielddef->m_elementIDs[i];
3510 modes_offset += (*m_exp)[0]->GetNumBases();
3514 expId = eIt->second;
3516 bool sameBasis =
true;
3517 for (
int j = 0; j < fielddef->m_basis.size(); ++j)
3519 if (fielddef->m_basis[j] != (*
m_exp)[expId]->GetBasisType(j))
3533 (*m_exp)[expId]->ExtractDataToCoeffs(
3534 &fielddata[offset], fielddef->m_numModes,
3540 modes_offset += (*m_exp)[0]->GetNumBases();
3551 for(i = 0; i < (*m_exp).size(); ++i)
3553 std::vector<unsigned int> nummodes;
3554 vector<LibUtilities::BasisType> basisTypes;
3555 for(
int j= 0; j < fromExpList->GetExp(i)->GetNumBases(); ++j)
3557 nummodes.push_back(fromExpList->GetExp(i)->GetBasisNumModes(j));
3558 basisTypes.push_back(fromExpList->GetExp(i)->GetBasisType(j));
3561 (*m_exp)[i]->ExtractDataToCoeffs(&fromCoeffs[offset], nummodes,0,
3565 offset += fromExpList->GetExp(i)->GetNcoeffs();
3576 size_t nTracePts = weightAver.size();
3578 for(
int i = 0; i < nTracePts; ++i)
3580 weightAver[i] = 0.5;
3581 weightJump[i] = 1.0;
3594 int nq = outarray[0].size()/MFdim;
3597 int coordim = (*m_exp)[0]->GetGeom()->GetCoordim();
3601 for(
int i = 0; i <
m_exp->size(); ++i)
3603 npts = (*m_exp)[i]->GetTotPoints();
3605 for (
int j=0; j< MFdim*coordim; ++j)
3611 (*m_exp)[i]->GetMetricInfo()->GetMovingFrames(
3612 (*
m_exp)[i]->GetPointsKeys(),
3618 for (
int j = 0; j < MFdim; ++j)
3620 for (
int k = 0; k < coordim; ++k)
3623 &MFloc[j*coordim+k][0], 1,
3639 const int ElementID,
3649 for(
int i = 0 ; i < (*m_exp).size(); ++i)
3651 npoints_e = (*m_exp)[i]->GetTotPoints();
3672 "This method is not defined or valid for this class type");
3679 boost::ignore_unused(i);
3681 "This method is not defined or valid for this class type");
3682 static std::shared_ptr<ExpList> result;
3706 int i,j,k,e_npoints,offset;
3714 "Input vector does not have sufficient dimensions to "
3718 for(i = 0; i <
m_exp->size(); ++i)
3721 e_npoints = (*m_exp)[i]->GetNumPoints(0);
3722 normals = (*m_exp)[i]->GetPhysNormals();
3728 for(j = 0; j < e_npoints; ++j)
3732 for(k = 0; k < coordim; ++k)
3734 Vn += Vec[k][offset+j]*normals[k*e_npoints + j];
3740 Upwind[offset + j] = Fwd[offset + j];
3744 Upwind[offset + j] = Bwd[offset + j];
3752 "This method is not defined or valid for this class type");
3780 "Upwind is not of sufficient length");
3800 "This method is not defined or valid for this class type");
3801 static std::shared_ptr<ExpList> returnVal;
3808 "This method is not defined or valid for this class type");
3809 static std::shared_ptr<AssemblyMapDG> result;
3815 return GetTraceMap()->GetBndCondIDToGlobalTraceID();
3833 for (
int i = 0; i < nquad2; ++i)
3835 for (
int j = 0; j < nquad1; ++j)
3837 out[i*nquad1 + j] = in[j*nquad2 + i];
3843 for (
int i = 0; i < nquad2; ++i)
3845 for (
int j = 0; j < nquad1; ++j)
3847 out[i*nquad1 + j] = in[i*nquad1 + j];
3858 for (
int i = 0; i < nquad2; ++i)
3860 for (
int j = 0; j < nquad1/2; ++j)
3862 swap(out[i*nquad1 + j],
3863 out[i*nquad1 + nquad1-j-1]);
3874 for (
int j = 0; j < nquad1; ++j)
3876 for (
int i = 0; i < nquad2/2; ++i)
3878 swap(out[i*nquad1 + j],
3879 out[(nquad2-i-1)*nquad1 + j]);
3896 int i,j,k,e_npoints,offset;
3902 ASSERTL1(normals.size() >= coordim,
3903 "Output vector does not have sufficient dimensions to "
3911 for(i = 0; i <
m_exp->size(); ++i)
3916 loc_exp->GetLeftAdjacentElementExp();
3920 locnormals = loc_elmt->GetTraceNormal(loc_exp->
3921 GetLeftAdjacentElementTrace());
3927 for(j = 0; j < e_npoints; ++j)
3931 for(k = 0; k < coordim; ++k)
3933 normals[k][offset] = locnormals[k][0];
3945 for (i = 0; i <
m_exp->size(); ++i)
3950 loc_exp->GetLeftAdjacentElementExp();
3952 int edgeNumber = loc_exp->GetLeftAdjacentElementTrace();
3955 e_npoints = (*m_exp)[i]->GetNumPoints(0);
3957 locnormals = loc_elmt->GetTraceNormal(edgeNumber);
3958 int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
3959 int loc_nmodes = loc_elmt->GetBasis(0)->GetNumModes();
3961 if (e_nmodes != loc_nmodes)
3963 if (loc_exp->GetRightAdjacentElementTrace() >= 0)
3966 loc_exp->GetRightAdjacentElementExp();
3968 int EdgeNumber = loc_exp->
3969 GetRightAdjacentElementTrace();
3973 locnormals = loc_elmt->GetTraceNormal(EdgeNumber);
3978 for (j = 0; j < e_npoints; ++j)
3983 for (k = 0; k < coordim; ++k)
3985 normals[k][offset + j] = -locnormals[k][j];
3994 for (
int p = 0;
p < coordim; ++
p)
3998 loc_exp->GetBasis(0)->GetPointsKey();
4000 loc_elmt->GetBasis(0)->GetPointsKey();
4010 for (j = 0; j < e_npoints; ++j)
4014 for (k = 0; k < coordim; ++k)
4016 normals[k][offset + j] = normal[k][j];
4027 for (j = 0; j < e_npoints; ++j)
4031 for (k = 0; k < coordim; ++k)
4033 normals[k][offset + j] = locnormals[k][j];
4045 for (i = 0; i <
m_exp->size(); ++i)
4049 traceExp->GetLeftAdjacentElementExp();
4052 int faceNum = traceExp->GetLeftAdjacentElementTrace();
4056 = exp3D->GetTraceNormal(faceNum);
4061 GetTraceOrient(faceNum);
4063 int fromid0,fromid1;
4077 = exp3D->GetTraceBasisKey(faceNum, fromid0);
4079 = exp3D->GetTraceBasisKey(faceNum, fromid1);
4081 = traceExp->GetBasis(0)->GetBasisKey();
4083 = traceExp->GetBasis(1)->GetBasisKey();
4089 exp3D->ReOrientTracePhysMap(orient,faceids,faceNq0,faceNq1);
4093 for (j = 0; j < coordim; ++j)
4103 tmp = normals[j]+offset);
4111 "This method is not defined or valid for this class type");
4127 lengLR[0] = lengthsFwd;
4128 lengLR[1] = lengthsBwd;
4132 int e_npoints0 = -1;
4135 for (
int i = 0; i <
m_exp->size(); ++i)
4137 loc_exp = (*m_exp)[i];
4140 int e_nmodes = loc_exp->GetBasis(0)->GetNumModes();
4141 e_npoints = (*m_exp)[i]->GetNumPoints(0);
4142 if ( e_npoints0 < e_npoints)
4145 e_npoints0 = e_npoints;
4148 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4149 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4151 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4152 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4153 for (
int nlr = 0; nlr < 2; ++nlr)
4157 int bndNumber = LRbndnumbs[nlr];
4158 loc_elmt = LRelmts[nlr];
4161 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(
4165 int loc_nmodes = loc_elmt->GetBasis(0)->
4167 if (e_nmodes != loc_nmodes)
4171 loc_exp->GetBasis(0)->GetPointsKey();
4173 loc_elmt->GetBasis(0)->GetPointsKey();
4179 for (
int j = 0; j < e_npoints; ++j)
4181 lengLR[nlr][offset + j] = lengAdd[j];
4188 for (
int i = 0; i <
m_exp->size(); ++i)
4190 loc_exp = (*m_exp)[i];
4194 = loc_exp->GetBasis(0)->GetBasisKey();
4196 = loc_exp->GetBasis(1)->GetBasisKey();
4199 e_npoints = TraceNq0*TraceNq1;
4200 if (e_npoints0 < e_npoints)
4204 e_npoints0 = e_npoints;
4207 LRelmts[0] = loc_exp->GetLeftAdjacentElementExp();
4208 LRelmts[1] = loc_exp->GetRightAdjacentElementExp();
4210 LRbndnumbs[0] = loc_exp->GetLeftAdjacentElementTrace();
4211 LRbndnumbs[1] = loc_exp->GetRightAdjacentElementTrace();
4212 for (
int nlr = 0; nlr < 2; ++nlr)
4215 int bndNumber = LRbndnumbs[nlr];
4216 loc_elmt = LRelmts[nlr];
4219 locLeng = loc_elmt->GetElmtBndNormDirElmtLen(
4224 GetTraceOrient(bndNumber);
4226 int fromid0,fromid1;
4239 = loc_elmt->GetTraceBasisKey(bndNumber, fromid0);
4241 = loc_elmt->GetTraceBasisKey(bndNumber, fromid1);
4247 locLeng, alignedLeng);
4255 for (
int j = 0; j < e_npoints; ++j)
4257 lengLR[nlr][offset + j] = lengintp[j];
4269 boost::ignore_unused(Fx, Fy, outarray);
4271 "This method is not defined or valid for this class type");
4278 boost::ignore_unused(Fn, outarray);
4280 "This method is not defined or valid for this class type");
4288 boost::ignore_unused(Fwd, Bwd, outarray);
4290 "This method is not defined or valid for this class type");
4296 boost::ignore_unused(Fwd, Bwd);
4298 "This method is not defined or valid for this class type");
4306 bool PutFwdInBwdOnBCs,
4309 boost::ignore_unused(field, Fwd, Bwd, FillBnd,
4310 PutFwdInBwdOnBCs, DoExchange);
4312 "This method is not defined or valid for this class type");
4318 bool PutFwdInBwdOnBCs)
4320 boost::ignore_unused(Fwd, Bwd, PutFwdInBwdOnBCs);
4322 "This method is not defined or valid for this class type");
4330 boost::ignore_unused(field, Fwd, Bwd);
4332 "v_AddTraceQuadPhysToField is not defined for this class type");
4340 boost::ignore_unused(field, Fwd, Bwd);
4342 "v_AddTraceQuadPhysToOffDiag is not defined for this class");
4351 boost::ignore_unused(Fwd,Bwd,locTraceFwd,locTraceBwd);
4353 "v_GetLocTraceFromTracePts is not defined for this class");
4360 "v_GetBndCondBwdWeight is not defined for this class type");
4369 boost::ignore_unused(index, value);
4371 "v_setBndCondBwdWeight is not defined for this class type");
4377 "This method is not defined or valid for this class type");
4378 static vector<bool> tmp;
4385 boost::ignore_unused(outarray);
4387 "This method is not defined or valid for this class type");
4394 boost::ignore_unused(inarray, outarray);
4396 "This method is not defined or valid for this class type");
4403 boost::ignore_unused(inarray, outarray);
4405 "This method is not defined or valid for this class type");
4415 const bool PhysSpaceForcing)
4417 boost::ignore_unused(inarray, outarray, factors, varcoeff,
4418 varfactors, dirForcing, PhysSpaceForcing);
4429 boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4431 "This method is not defined or valid for this class type");
4441 boost::ignore_unused(velocity, inarray, outarray, lambda, dirForcing);
4443 "This method is not defined or valid for this class type");
4451 boost::ignore_unused(inarray, outarray, Shuff, UnShuff);
4453 "This method is not defined or valid for this class type");
4461 boost::ignore_unused(inarray, outarray, Shuff, UnShuff);
4463 "This method is not defined or valid for this class type");
4470 boost::ignore_unused(inarray1, inarray2, outarray);
4472 "This method is not defined or valid for this class type");
4480 boost::ignore_unused(inarray1, inarray2, outarray);
4482 "This method is not defined or valid for this class type");
4489 boost::ignore_unused(BndVals, TotField, BndID);
4491 "This method is not defined or valid for this class type");
4499 boost::ignore_unused(V1, V2, outarray, BndID);
4501 "This method is not defined or valid for this class type");
4515 (*m_exp)[i]->NormVectorIProductWRTBase(
4525 (*m_exp)[i]->NormVectorIProductWRTBase(
4536 (*m_exp)[i]->NormVectorIProductWRTBase(
4552 boost::ignore_unused(outarray);
4554 "This method is not defined or valid for this class type");
4562 "This method is not defined or valid for this class type");
4569 boost::ignore_unused(nreg);
4571 "This method is not defined or valid for this class type");
4576 boost::ignore_unused(useComm);
4578 "This method is not defined or valid for this class type");
4586 boost::ignore_unused(inarray, outarray, useComm);
4588 "This method is not defined or valid for this class type");
4595 "This method is not defined or valid for this class type");
4602 boost::ignore_unused(inarray, outarray);
4604 "This method is not defined or valid for this class type");
4680 for(i= 0; i < (*m_exp).size(); ++i)
4683 (*m_exp)[i]->GetCoords(e_coord_0);
4688 "output coord_1 is not defined");
4690 for(i= 0; i < (*m_exp).size(); ++i)
4694 (*m_exp)[i]->GetCoords(e_coord_0,e_coord_1);
4699 "output coord_1 is not defined");
4701 "output coord_2 is not defined");
4703 for(i= 0; i < (*m_exp).size(); ++i)
4708 (*m_exp)[i]->GetCoords(e_coord_0,e_coord_1,e_coord_2);
4718 for (
int i = 0; i <
m_exp->size(); ++i)
4720 for (
int j = 0; j < (*m_exp)[i]->GetNtraces(); ++j)
4722 (*m_exp)[i]->ComputeTraceNormal(j);
4730 std::shared_ptr<ExpList> &result,
4731 const bool DeclareCoeffPhysArrays)
4733 boost::ignore_unused(i, result, DeclareCoeffPhysArrays);
4735 "This method is not defined or valid for this class type");
4756 for (cnt = n = 0; n < i; ++n)
4767 elmt =
GetExp(ElmtID[cnt+n]);
4768 elmt->GetTracePhysVals(EdgeID[cnt+n],
4770 tmp1 = element + offsetElmt,
4771 tmp2 = boundary + offsetBnd);
4773 offsetElmt += elmt->GetTotPoints();
4789 for (cnt = n = 0; n < i; ++n)
4798 npoints +=
GetExp(ElmtID[cnt+n])->GetTotPoints();
4809 nq =
GetExp(ElmtID[cnt+n])->GetTotPoints();
4812 &bndElmt[offsetElmt], 1);
4835 for (cnt = n = 0; n < i; ++n)
4847 elmt =
GetExp(ElmtID[cnt+n]);
4848 elmt->GetTracePhysVals(EdgeID[cnt+n],
4851 tmp1 = bnd + offsetBnd);
4870 for (j = 0; j < coordim; ++j)
4877 for (cnt = n = 0; n < i; ++n)
4888 elmt =
GetExp(ElmtID[cnt+n]);
4890 = elmt->GetTraceNormal(EdgeID[cnt+n]);
4892 for (j = 0; j < coordim; ++j)
4895 tmp = normals[j] + offset, 1);
4905 boost::ignore_unused(ElmtID, EdgeID);
4907 "This method is not defined or valid for this class type");
4914 boost::ignore_unused(weightave, weightjmp);
4922 boost::ignore_unused(Fwd, Bwd);
4932 "This method is not defined or valid for this class type");
4943 "This method is not defined or valid for this class type");
4952 const std::string varName,
4956 boost::ignore_unused(time, varName, x2_in, x3_in);
4958 "This method is not defined or valid for this class type");
4966 "This method is not defined or valid for this class type");
4967 static map<int,RobinBCInfoSharedPtr> result;
4978 boost::ignore_unused(periodicVerts, periodicEdges, periodicFaces);
4980 "This method is not defined or valid for this class type");
4985 unsigned int regionId,
4986 const std::string& variable)
4988 auto collectionIter = collection.find(regionId);
4989 ASSERTL1(collectionIter != collection.end(),
4990 "Unable to locate collection " +
4991 boost::lexical_cast<string>(regionId));
4994 = (*collectionIter).second;
4995 auto conditionMapIter = bndCondMap->find(variable);
4996 ASSERTL1(conditionMapIter != bndCondMap->end(),
4997 "Unable to locate condition map.");
5000 = (*conditionMapIter).second;
5002 return boundaryCondition;
5007 boost::ignore_unused(n);
5009 "This method is not defined or valid for this class type");
5020 vector<std::pair<LocalRegions::ExpansionSharedPtr,int> > >
5032 bool verbose = (
m_session->DefinesCmdLineArgument(
"verbose")) &&
5033 (
m_comm->GetRank() == 0);
5044 for (
int i = 0; i <
m_exp->size(); ++i)
5046 collections[(*m_exp)[i]->DetShapeType()].push_back(
5047 std::pair<LocalRegions::ExpansionSharedPtr,int>((*
m_exp)[i],i));
5050 for (
auto &it : collections)
5055 vector<StdRegions::StdExpansionSharedPtr> collExp;
5064 if(it.second.size() == 1)
5066 collExp.push_back(it.second[0].first);
5083 collExp.push_back(it.second[0].first);
5084 int prevnCoeff = it.second[0].first->GetNcoeffs();
5085 int prevnPhys = it.second[0].first->GetTotPoints();
5086 bool prevDeformed = it.second[0].first->GetMetricInfo()->GetGtype()
5090 for (
int i = 1; i < it.second.size(); ++i)
5092 int nCoeffs = it.second[i].first->GetNcoeffs();
5093 int nPhys = it.second[i].first->GetTotPoints();
5094 bool Deformed = it.second[i].first->GetMetricInfo()->GetGtype()
5102 if(prevCoeffOffset + nCoeffs != coeffOffset ||
5103 prevnCoeff != nCoeffs ||
5104 prevPhysOffset + nPhys != physOffset ||
5105 prevDeformed != Deformed ||
5106 prevnPhys != nPhys || collcnt >= collmax)
5127 collExp.push_back(it.second[i].first);
5132 collExp.push_back(it.second[i].first);
5137 if (i == it.second.size() - 1)
5155 prevCoeffOffset = coeffOffset;
5156 prevPhysOffset = physOffset;
5157 prevDeformed = Deformed;
5158 prevnCoeff = nCoeffs;
5186 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5187 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5188 int npt0 = (int) pt0*scale;
5189 int npt1 = (int) pt1*scale;
5192 (*
m_exp)[i]->GetPointsType(0));
5194 (*
m_exp)[i]->GetPointsType(1));
5198 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
5199 &inarray[cnt],newPointsKey0,
5200 newPointsKey1,&outarray[cnt1]);
5212 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5213 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5214 int pt2 = (*m_exp)[i]->GetNumPoints(2);
5215 int npt0 = (int) pt0*scale;
5216 int npt1 = (int) pt1*scale;
5217 int npt2 = (int) pt2*scale;
5225 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
5226 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(),
5227 &inarray[cnt], newPointsKey0,
5228 newPointsKey1, newPointsKey2,
5232 cnt1 += npt0*npt1*npt2;
5249 boost::ignore_unused(FwdFlux, BwdFlux, outarray);
5258 int nTotElmt = (*m_exp).size();
5259 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5260 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5266 for(
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5268 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5269 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5271 if (tmpPhys.size()!=nElmtPnt||tmpCoef.size()!=nElmtCoef)
5277 for(
int ncl = 0; ncl < nElmtPnt; ncl++)
5279 tmpPhys[ncl] = inarray[nelmt][ncl];
5281 (*m_exp)[nelmt]->IProductWRTDerivBase(nDirctn,tmpPhys,
5284 for(
int nrw = 0; nrw < nElmtCoef; nrw++)
5286 (*mtxPerVar[nelmt])(nrw,ncl) = tmpCoef[nrw];
5298 int nTotElmt = (*m_exp).size();
5300 int nspacedim =
m_graph->GetSpaceDimension();
5310 int nElmtPntPrevious = 0;
5311 int nElmtCoefPrevious = 0;
5313 int nElmtPnt,nElmtCoef;
5314 for(
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5316 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5317 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5319 (*m_exp)[nelmt]->DetShapeType();
5321 if (nElmtPntPrevious!=nElmtPnt||nElmtCoefPrevious!=nElmtCoef||
5322 (ElmtTypeNow!=ElmtTypePrevious))
5324 if(nElmtPntPrevious!=nElmtPnt)
5326 for(
int ndir =0;ndir<nspacedim;ndir++)
5328 projectedpnts[ndir] =
5335 stdExp = (*m_exp)[nelmt]->GetStdExp();
5337 stdExp->DetShapeType(), *stdExp);
5339 ArrayStdMat[0] = stdExp->GetStdMatrix(matkey);
5340 ArrayStdMat_data[0] = ArrayStdMat[0]->GetPtr();
5345 stdExp->DetShapeType(), *stdExp);
5347 ArrayStdMat[1] = stdExp->GetStdMatrix(matkey);
5348 ArrayStdMat_data[1] = ArrayStdMat[1]->GetPtr();
5354 stdExp->DetShapeType(), *stdExp);
5356 ArrayStdMat[2] = stdExp->GetStdMatrix(matkey);
5357 ArrayStdMat_data[2] = ArrayStdMat[2]->GetPtr();
5361 ElmtTypePrevious = ElmtTypeNow;
5362 nElmtPntPrevious = nElmtPnt;
5363 nElmtCoefPrevious = nElmtCoef;
5367 for(
int ndir =0;ndir<nspacedim;ndir++)
5373 for(
int ndir =0;ndir<nspacedim;ndir++)
5375 (*m_exp)[nelmt]->AlignVectorToCollapsedDir(
5376 ndir,inarray[ndir][nelmt],tmppnts);
5377 for(
int n =0;n<nspacedim;n++)
5379 Vmath::Vadd(nElmtPnt,tmppnts[n],1,projectedpnts[n],1,
5380 projectedpnts[n],1);
5384 for(
int ndir =0;ndir<nspacedim;ndir++)
5387 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(
5388 projectedpnts[ndir],projectedpnts[ndir]);
5390 mtxPerVar[nelmt]->GetPtr();
5392 for(
int np=0;np<nElmtPnt;np++)
5394 NekDouble factor = projectedpnts[ndir][np];
5395 clmnArray = MatDataArray + np*nElmtCoef;
5396 clmnStdMatArray = ArrayStdMat_data[ndir] + np*nElmtCoef;
5398 clmnArray,1,clmnArray,1);
5411 int nElmtPntPrevious = 0;
5412 int nElmtCoefPrevious = 0;
5413 int nTotElmt = (*m_exp).size();
5414 int nElmtPnt = (*m_exp)[0]->GetTotPoints();
5415 int nElmtCoef = (*m_exp)[0]->GetNcoeffs();
5421 for(
int nelmt = 0; nelmt < nTotElmt; nelmt++)
5423 nElmtCoef = (*m_exp)[nelmt]->GetNcoeffs();
5424 nElmtPnt = (*m_exp)[nelmt]->GetTotPoints();
5426 (*m_exp)[nelmt]->DetShapeType();
5428 if (nElmtPntPrevious!=nElmtPnt||nElmtCoefPrevious!=nElmtCoef||
5429 (ElmtTypeNow!=ElmtTypePrevious))
5432 stdExp = (*m_exp)[nelmt]->GetStdExp();
5434 stdExp->DetShapeType(), *stdExp);
5437 stdMat_data = BwdMat->GetPtr();
5439 if (nElmtPntPrevious!=nElmtPnt)
5444 ElmtTypePrevious = ElmtTypeNow;
5445 nElmtPntPrevious = nElmtPnt;
5446 nElmtCoefPrevious = nElmtCoef;
5449 (*m_exp)[nelmt]->MultiplyByQuadratureMetric(inarray[nelmt],
5453 mtxPerVar[nelmt]->GetPtr();
5455 for(
int np=0;np<nElmtPnt;np++)
5458 clmnArray = MatDataArray + np*nElmtCoef;
5459 clmnStdMatArray = stdMat_data + np*nElmtCoef;
5460 Vmath::Smul(nElmtCoef,factor,clmnStdMatArray,1,clmnArray,1);
5483 std::shared_ptr<LocalRegions::ExpansionVector> traceExp=
5484 tracelist->GetExp();
5485 int ntotTrace = (*traceExp).size();
5486 int nTracePnt,nTraceCoef;
5488 std::shared_ptr<LocalRegions::ExpansionVector> fieldExp=
GetExp();
5494 locTraceToTraceMap->GetLeftRightAdjacentExpId();
5496 locTraceToTraceMap->GetLeftRightAdjacentExpFlag();
5499 = locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffMap();
5501 = locTraceToTraceMap->GetTraceCoeffToLeftRightExpCoeffSign();
5509 int nTracePntsTtl = tracelist->GetTotPoints();
5510 int nlocTracePts = locTraceToTraceMap->GetNLocTracePts();
5511 int nlocTracePtsFwd = locTraceToTraceMap->GetNFwdLocTracePts();
5512 int nlocTracePtsBwd = nlocTracePts-nlocTracePtsFwd;
5515 nlocTracePtsLR[0] = nlocTracePtsFwd;
5516 nlocTracePtsLR[1] = nlocTracePtsBwd;
5518 size_t nFwdBwdNonZero = 0;
5520 for (
int i = 0; i < 2; ++i)
5522 if (nlocTracePtsLR[i] > 0)
5524 tmpIndex[nFwdBwdNonZero] = i;
5530 for (
int i = 0; i < nFwdBwdNonZero; ++i)
5532 nlocTracePtsNonZeroIndex[i] = tmpIndex[i];
5538 for (
int k = 0; k < 2; ++k)
5543 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5545 size_t i = nlocTracePtsNonZeroIndex[k];
5549 int nNumbElmt = fieldMat.size();
5552 for(
int i=0;i<nNumbElmt;i++)
5554 ElmtMatDataArray[i] = fieldMat[i]->GetPtr();
5558 int nTraceCoefMax = 0;
5559 int nTraceCoefMin = std::numeric_limits<int>::max();
5565 for(
int nt = 0; nt < ntotTrace; nt++)
5567 nTraceCoef = (*traceExp)[nt]->GetNcoeffs();
5568 nTracePnt = tracelist->GetTotPoints(nt);
5569 int noffset = tracelist->GetPhys_Offset(nt);
5570 TraceCoefArray[nt] = nTraceCoef;
5571 TracePntArray[nt] = nTracePnt;
5572 TraceOffArray[nt] = noffset;
5573 FwdMatData[nt] = FwdMat[nt]->GetPtr();
5574 BwdMatData[nt] = BwdMat[nt]->GetPtr();
5575 if(nTraceCoef>nTraceCoefMax)
5577 nTraceCoefMax = nTraceCoef;
5579 if(nTraceCoef<nTraceCoefMin)
5581 nTraceCoefMin = nTraceCoef;
5585 "nTraceCoefMax!=nTraceCoefMin: Effeciency may be low ");
5587 int traceID, nfieldPnts, ElmtId, noffset;
5589 = locTraceToTraceMap->GetLocTracephysToTraceIDMap();
5591 locTraceToTraceMap->GetfieldToLocTraceMap();
5594 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5596 size_t i = nlocTracePtsNonZeroIndex[k];
5599 &fieldToLocTraceMap[0]+noffset,1,
5600 &fieldToLocTraceMapLR[i][0],1);
5601 noffset += nlocTracePtsLR[i];
5605 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5607 size_t nlr = nlocTracePtsNonZeroIndex[k];
5609 for(
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5611 traceID = LocTracephysToTraceIDMap[nlr][nloc];
5612 nTraceCoef = TraceCoefArray[traceID];
5613 ElmtId = LRAdjExpid[nlr][traceID];
5615 nElmtCoef = ElmtCoefArray[ElmtId];
5616 nfieldPnts = fieldToLocTraceMapLR[nlr][nloc];
5617 nPnts = nfieldPnts - noffset;
5619 MatIndexArray[nlr][nloc] = nPnts*nElmtCoef;
5623 for(
int nc=0;nc<nTraceCoefMin;nc++)
5625 for(
int nt = 0; nt < ntotTrace; nt++)
5627 nTraceCoef = TraceCoefArray[nt];
5628 nTracePnt = TracePntArray[nt] ;
5629 noffset = TraceOffArray[nt] ;
5631 &FwdMatData[nt][nc], nTraceCoef,
5632 &TraceFwdPhy[noffset],1);
5634 &BwdMatData[nt][nc],nTraceCoef,
5635 &TraceBwdPhy[noffset],1);
5638 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5640 size_t i = nlocTracePtsNonZeroIndex[k];
5647 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5649 size_t nlr = nlocTracePtsNonZeroIndex[k];
5650 for(
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5652 traceID = LocTracephysToTraceIDMap[nlr][nloc];
5653 nTraceCoef = TraceCoefArray[traceID];
5654 ElmtId = LRAdjExpid[nlr][traceID];
5655 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
5656 sign = elmtLRSign[nlr][traceID][nc];
5657 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
5659 ElmtMatDataArray[ElmtId][MatIndex] -=
5660 sign*tmplocTrace[nlr][nloc];
5665 for(
int nc=nTraceCoefMin;nc<nTraceCoefMax;nc++)
5667 for(
int nt = 0; nt < ntotTrace; nt++)
5669 nTraceCoef = TraceCoefArray[nt];
5670 nTracePnt = TracePntArray[nt] ;
5671 noffset = TraceOffArray[nt] ;
5675 &FwdMatData[nt][nc],nTraceCoef,
5676 &TraceFwdPhy[noffset],1);
5678 &BwdMatData[nt][nc],nTraceCoef,
5679 &TraceBwdPhy[noffset],1);
5688 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5690 size_t i = nlocTracePtsNonZeroIndex[k];
5696 for (
int k = 0; k < nFwdBwdNonZero; ++k)
5698 size_t nlr = nlocTracePtsNonZeroIndex[k];
5699 for(
int nloc = 0; nloc < nlocTracePtsLR[nlr]; nloc++)
5701 traceID = LocTracephysToTraceIDMap[nlr][nloc];
5702 nTraceCoef = TraceCoefArray[traceID];
5705 ElmtId = LRAdjExpid[nlr][traceID];
5706 nrwAdjExp = elmtLRMap[nlr][traceID][nc];
5707 sign =-elmtLRSign[nlr][traceID][nc];
5708 MatIndex = MatIndexArray[nlr][nloc] + nrwAdjExp;
5710 ElmtMatDataArray[ElmtId][MatIndex] +=
5711 sign*tmplocTrace[nlr][nloc];
5724 int nelmtcoef, nelmtpnts,nelmtcoef0, nelmtpnts0;
5737 nelmtcoef0 = nelmtcoef;
5738 nelmtpnts0 = nelmtpnts;
5740 for(nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
5745 tmpMatQ = ElmtJacQuad[nelmt];
5746 tmpMatC = ElmtJacCoef[nelmt];
5748 MatQ_data = tmpMatQ->GetPtr();
5749 MatC_data = tmpMatC->GetPtr();
5751 if(nelmtcoef!=nelmtcoef0)
5754 nelmtcoef0 = nelmtcoef;
5757 if(nelmtpnts!=nelmtpnts0)
5760 nelmtpnts0 = nelmtpnts;
5763 for(
int np=0; np<nelmtcoef;np++)
5765 Vmath::Vcopy(nelmtpnts,&MatQ_data[0]+np,nelmtcoef,&innarray[0],1);
5766 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray,innarray);
5767 (*m_exp)[nelmt]->IProductWRTDerivBase(dir,innarray,outarray);
5769 Vmath::Vadd(nelmtcoef,&outarray[0],1,&MatC_data[0]+np,nelmtcoef,&MatC_data[0]+np,nelmtcoef);
5780 int nelmtcoef, nelmtpnts,nelmtcoef0, nelmtpnts0;
5793 nelmtcoef0 = nelmtcoef;
5794 nelmtpnts0 = nelmtpnts;
5796 for(nelmt = 0; nelmt < (*m_exp).size(); ++nelmt)
5801 tmpMatQ = ElmtJacQuad[nelmt];
5802 tmpMatC = ElmtJacCoef[nelmt];
5804 MatQ_data = tmpMatQ->GetPtr();
5805 MatC_data = tmpMatC->GetPtr();
5807 if(nelmtcoef!=nelmtcoef0)
5810 nelmtcoef0 = nelmtcoef;
5813 if(nelmtpnts!=nelmtpnts0)
5816 nelmtpnts0 = nelmtpnts;
5819 for(
int np=0; np<nelmtcoef;np++)
5823 (*m_exp)[nelmt]->DivideByQuadratureMetric(innarray,innarray);
5824 (*m_exp)[nelmt]->IProductWRTBase(innarray,outarray);
5827 &MatC_data[0]+np,nelmtcoef,
5828 &MatC_data[0]+np,nelmtcoef);
5849 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5850 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5851 int npt0 = (int) pt0*scale;
5852 int npt1 = (int) pt1*scale;
5855 (*
m_exp)[i]->GetPointsType(0));
5857 (*
m_exp)[i]->GetPointsType(1));
5863 (*
m_exp)[i]->GetBasis(0)->GetPointsKey(),
5864 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
5877 int pt0 = (*m_exp)[i]->GetNumPoints(0);
5878 int pt1 = (*m_exp)[i]->GetNumPoints(1);
5879 int pt2 = (*m_exp)[i]->GetNumPoints(2);
5880 int npt0 = (int) pt0*scale;
5881 int npt1 = (int) pt1*scale;
5882 int npt2 = (int) pt2*scale;
5885 (*
m_exp)[i]->GetPointsType(0));
5887 (*
m_exp)[i]->GetPointsType(1));
5889 (*
m_exp)[i]->GetPointsType(2));
5896 (*
m_exp)[i]->GetBasis(0)->GetPointsKey(),
5897 (*
m_exp)[i]->GetBasis(1)->GetPointsKey(),
5898 (*
m_exp)[i]->GetBasis(2)->GetPointsKey(),
5901 cnt += npt0*npt1*npt2;
5902 cnt1 += pt0*pt1*pt2;
#define WARNINGL1(condition, msg)
#define ASSERTL0(condition, msg)
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define LIKWID_MARKER_START(regionTag)
#define LIKWID_MARKER_STOP(regionTag)
#define sign(a, b)
return the sign(b)*a
COLLECTIONS_EXPORT OperatorImpMap SetWithTimings(std::vector< StdRegions::StdExpansionSharedPtr > pGeom, OperatorImpMap &impTypes, bool verbose=true)
unsigned int GetMaxCollectionSize()
ImplementationType GetDefaultImplementationType()
COLLECTIONS_EXPORT OperatorImpMap GetOperatorImpMap(StdRegions::StdExpansionSharedPtr pExp)
Get Operator Implementation Map from XMl or using default;.
Describes the specification for a Basis.
int GetNumPoints() const
Return points order at which basis is defined.
BasisType GetBasisType() const
Return type of expansion basis.
PointsKey GetPointsKey() const
Return distribution of points.
int GetNumModes() const
Returns the order of the basis.
static const std::string GetFileType(const std::string &filename, CommSharedPtr comm)
Determine file type of given input file.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Defines a specification for a set of points.
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
Base class for all multi-elemental spectral/hp expansions.
virtual void v_Reset()
Reset geometry information, metrics, matrix managers and geometry information.
Array< OneD, NekDouble > m_coeffs
Concatenation of all local expansion coefficients.
void AddTraceJacToElmtJac(const Array< OneD, const DNekMatSharedPtr > &FwdMat, const Array< OneD, const DNekMatSharedPtr > &BwdMat, Array< OneD, DNekMatSharedPtr > &fieldMat)
inverse process of v_GetFwdBwdTracePhys. Given Trace integration of Fwd and Bwd Jacobian,...
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
void IProductWRTBase_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to all local expansion modes .
std::shared_ptr< ExpList > & GetTrace()
int GetNcoeffs(void) const
Returns the total number of local degrees of freedom .
virtual void v_ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
const DNekScalBlkMatSharedPtr & GetBlockMatrix(const GlobalMatrixKey &gkey)
virtual void v_AddFwdBwdTraceIntegral(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &outarray)
ExpList(const ExpansionType Type=eNoType)
The default constructor using a type.
void ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs)
Extract the data in fielddata into the coeffs.
void CreateCollections(Collections::ImplementationType ImpType=Collections::eNoImpType)
Construct collections of elements containing a single element type and polynomial order from the list...
virtual void v_FwdTrans_BndConstrained(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
void ExponentialFilter(Array< OneD, NekDouble > &array, const NekDouble alpha, const NekDouble exponent, const NekDouble cutoff)
virtual void v_HomogeneousBwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
std::shared_ptr< GlobalMatrix > GenGlobalMatrix(const GlobalMatrixKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
Generates a global matrix from the given key and map.
virtual void v_HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
virtual void v_IProductWRTBase(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void AddRightIPTPhysDerivBase(const int dir, const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
virtual void v_ExtractTracePhys(Array< OneD, NekDouble > &outarray)
int GetExpIndex(const Array< OneD, const NekDouble > &gloCoord, NekDouble tol=0.0, bool returnNearestElmt=false, int cachedId=-1, NekDouble maxDistance=1e6)
This function returns the index of the local elemental expansion containing the arbitrary point given...
virtual void v_WriteTecplotConnectivity(std::ostream &outfile, int expansion)
BlockMatrixMapShPtr m_blockMat
virtual Array< OneD, const unsigned int > v_GetYIDs(void)
void MultiplyByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
multiply the metric jacobi and quadrature weights
virtual void v_LinearAdvectionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
void WriteVtkPieceFooter(std::ostream &outfile, int expansion)
virtual void v_ExtractPhysToBnd(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bnd)
void GetBwdWeight(Array< OneD, NekDouble > &weightAver, Array< OneD, NekDouble > &weightJump)
Get the weight value for boundary conditions for boundary average and jump calculations.
virtual void v_AddTraceIntegralToOffDiag(const Array< OneD, const NekDouble > &FwdFlux, const Array< OneD, const NekDouble > &BwdFlux, Array< OneD, NekDouble > &outarray)
void InitialiseExpVector(const SpatialDomains::ExpansionInfoMap &expmap)
Define a list of elements using the geometry and basis key information in expmap;.
void SetupCoeffPhys(bool DeclareCoeffPhysArrays=true, bool SetupOffsets=true)
Definition of the total number of degrees of freedom and quadrature points and offsets to access data...
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
virtual void v_PhysDirectionalDeriv(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
virtual void v_GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
virtual void v_WriteTecplotHeader(std::ostream &outfile, std::string var="")
virtual std::shared_ptr< ExpList > & v_GetPlane(int n)
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n.
int GetExpSize(void)
This function returns the number of elements in the expansion.
virtual void v_AddTraceQuadPhysToOffDiag(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
virtual void v_ClearGlobalLinSysManager(void)
void GeneralGetFieldDefinitions(std::vector< LibUtilities::FieldDefinitionsSharedPtr > &fielddef, int NumHomoDir=0, Array< OneD, LibUtilities::BasisSharedPtr > &HomoBasis=LibUtilities::NullBasisSharedPtr1DArray, std::vector< NekDouble > &HomoLen=LibUtilities::NullNekDoubleVector, bool homoStrips=false, std::vector< unsigned int > &HomoSIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoZIDs=LibUtilities::NullUnsignedIntVector, std::vector< unsigned int > &HomoYIDs=LibUtilities::NullUnsignedIntVector)
virtual void v_GetPeriodicEntities(PeriodicMap &periodicVerts, PeriodicMap &periodicEdges, PeriodicMap &periodicFaces)
void IProductWRTDerivBase(const int dir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function calculates the inner product of a function with respect to the derivative (in directio...
virtual void v_CurlCurl(Array< OneD, Array< OneD, NekDouble > > &Vel, Array< OneD, Array< OneD, NekDouble > > &Q)
virtual void v_LocalToGlobal(bool UseComm)
int GetNumElmts(void)
This function returns the number of elements in the expansion which may be different for a homogeoeno...
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions()
virtual ~ExpList()
The default destructor.
virtual void v_FillBndCondFromField()
virtual void v_ImposeDirichletConditions(Array< OneD, NekDouble > &outarray)
virtual void v_EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble x2_in=NekConstants::kNekUnsetDouble, const NekDouble x3_in=NekConstants::kNekUnsetDouble)
void ClearGlobalLinSysManager(void)
virtual const std::vector< bool > & v_GetLeftAdjacentFaces(void) const
Array< OneD, int > m_coeff_offset
Offset of elemental data into the array m_coeffs.
std::shared_ptr< AssemblyMapDG > & GetTraceMap(void)
virtual void v_GetMovingFrames(const SpatialDomains::GeomMMF MMFdir, const Array< OneD, const NekDouble > &CircCentre, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual std::shared_ptr< AssemblyMapDG > & v_GetTraceMap()
Array< OneD, std::pair< int, int > > m_coeffsToElmt
m_coeffs to elemental value map
virtual void v_GetFwdBwdTracePhys(Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
NekDouble PhysEvaluate(const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &phys)
virtual NekDouble v_Integral(const Array< OneD, const NekDouble > &inarray)
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo(void)
virtual const Array< OneD, const int > & v_GetTraceBndMap()
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
virtual void v_LinearAdvectionDiffusionReactionSolve(const Array< OneD, Array< OneD, NekDouble > > &velocity, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const NekDouble lambda, const Array< OneD, const NekDouble > &dirForcing=NullNekDouble1DArray)
virtual Array< OneD, const NekDouble > v_HomogeneousEnergy(void)
virtual NekDouble v_GetHomoLen(void)
void ExtractFileBCs(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
const LocTraceToTraceMapSharedPtr & GetLocTraceToTraceMap() const
virtual Array< OneD, const unsigned int > v_GetZIDs(void)
void ExtractCoeffsToCoeffs(const std::shared_ptr< ExpList > &fromExpList, const Array< OneD, const NekDouble > &fromCoeffs, Array< OneD, NekDouble > &toCoeffs)
Extract the data from fromField using fromExpList the coeffs using the basic ExpList Elemental expans...
void GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1=NullNekDouble1DArray, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
This function calculates the coordinates of all the elemental quadrature points .
std::shared_ptr< GlobalLinSys > GenGlobalBndLinSys(const GlobalLinSysKey &mkey, const AssemblyMapSharedPtr &locToGloMap)
Generate a GlobalLinSys from information provided by the key "mkey" and the mapping provided in LocTo...
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value)
virtual void v_SmoothField(Array< OneD, NekDouble > &field)
virtual void v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata)
std::vector< bool > m_collectionsDoInit
Vector of bools to act as an initialise on first call flag.
virtual void v_FwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
bool m_physState
The state of the array m_phys.
void AddRightIPTBaseMatrix(const Array< OneD, const DNekMatSharedPtr > ElmtJacQuad, Array< OneD, DNekMatSharedPtr > ElmtJacCoef)
void GetLocTraceFromTracePts(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &locTraceFwd, Array< OneD, NekDouble > &locTraceBwd)
virtual void v_GeneralMatrixOp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_WriteVtkPieceData(std::ostream &outfile, int expansion, std::string var)
virtual void v_WriteVtkPieceHeader(std::ostream &outfile, int expansion, int istrip)
virtual void v_BwdTrans_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
int GetShapeDimension()
This function returns the dimension of the shape of the element eid.
NekDouble H1(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
Calculates the error of the global spectral/hp element approximation.
std::vector< int > m_coll_phys_offset
Offset of elemental data into the array m_phys.
LibUtilities::CommSharedPtr m_comm
Communicator.
std::shared_ptr< GlobalLinSys > GenGlobalLinSys(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
This operation constructs the global linear system of type mkey.
void WriteVtkHeader(std::ostream &outfile)
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
virtual void v_GetCoords(Array< OneD, NekDouble > &coord_0, Array< OneD, NekDouble > &coord_1, Array< OneD, NekDouble > &coord_2=NullNekDouble1DArray)
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
void GenerateElementVector(const int ElementID, const NekDouble scalar1, const NekDouble scalar2, Array< OneD, NekDouble > &outarray)
Generate vector v such that v[i] = scalar1 if i is in the element < ElementID. Otherwise,...
std::shared_ptr< DNekMat > GenGlobalMatrixFull(const GlobalLinSysKey &mkey, const std::shared_ptr< AssemblyMapCG > &locToGloMap)
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
virtual void v_ExtractElmtToBndPhys(const int i, const Array< OneD, NekDouble > &elmt, Array< OneD, NekDouble > &boundary)
virtual void v_ExtractPhysToBndElmt(const int i, const Array< OneD, const NekDouble > &phys, Array< OneD, NekDouble > &bndElmt)
virtual 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)
virtual void v_AddTraceIntegral(const Array< OneD, const NekDouble > &Fx, const Array< OneD, const NekDouble > &Fy, Array< OneD, NekDouble > &outarray)
virtual void v_FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
virtual void v_PhysGalerkinProjection1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_SetUpPhysNormals()
virtual void v_GlobalToLocal(void)
virtual LibUtilities::TranspositionSharedPtr v_GetTransposition(void)
void GeneralMatrixOp_IterPerExp(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
SpatialDomains::MeshGraphSharedPtr m_graph
Mesh associated with this expansion list.
virtual void v_MultiplyByInvMassMatrix(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_AddTraceQuadPhysToField(const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &field)
virtual const Array< OneD, const NekDouble > & v_GetBndCondBwdWeight()
virtual NekDouble v_L2(const Array< OneD, const NekDouble > &phys, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
void WriteVtkFooter(std::ostream &outfile)
void MultiplyByBlockMatrix(const GlobalMatrixKey &gkey, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual std::shared_ptr< ExpList > & v_GetTrace()
void GetElmtNormalLength(Array< OneD, NekDouble > &lengthsFwd, Array< OneD, NekDouble > &lengthsBwd)
Get the length of elements in boundary normal direction.
virtual NekDouble v_VectorFlux(const Array< OneD, Array< OneD, NekDouble > > &inarray)
virtual std::vector< LibUtilities::FieldDefinitionsSharedPtr > v_GetFieldDefinitions(void)
std::vector< int > m_coll_coeff_offset
Offset of elemental data into the array m_coeffs.
void IProductWRTDirectionalDerivBase(const Array< OneD, const NekDouble > &direction, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Directional derivative along a given direction.
void FillBwdWithBwdWeight(Array< OneD, NekDouble > &weightave, Array< OneD, NekDouble > &weightjmp)
Fill Bwd with boundary conditions.
virtual void v_BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
void GetMatIpwrtDeriveBase(const Array< OneD, const Array< OneD, NekDouble > > &inarray, const int nDirctn, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
virtual void v_WriteTecplotField(std::ostream &outfile, int expansion)
std::shared_ptr< ExpList > GetSharedThisPtr()
Returns a shared pointer to the current object.
Collections::CollectionVector m_collections
virtual void v_PhysInterp1DScaled(const NekDouble scale, const Array< OneD, NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void ApplyGeomInfo()
Apply geometry information to each expansion.
Array< OneD, const unsigned int > GetZIDs(void)
This function returns a vector containing the wave numbers in z-direction associated with the 3D homo...
virtual void v_PhysDeriv(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d0, Array< OneD, NekDouble > &out_d1, Array< OneD, NekDouble > &out_d2)
std::unordered_map< int, int > m_elmtToExpId
Mapping from geometry ID of element to index inside m_exp.
virtual void v_WriteTecplotZone(std::ostream &outfile, int expansion)
LibUtilities::SessionReaderSharedPtr m_session
Session.
virtual void v_DealiasedDotProd(const Array< OneD, Array< OneD, NekDouble > > &inarray1, const Array< OneD, Array< OneD, NekDouble > > &inarray2, Array< OneD, Array< OneD, NekDouble > > &outarray)
virtual void v_PeriodicBwdCopy(const Array< OneD, const NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd)
std::map< int, RobinBCInfoSharedPtr > GetRobinBCInfo()
virtual void v_FillBwdWithBoundCond(const Array< OneD, NekDouble > &Fwd, Array< OneD, NekDouble > &Bwd, bool PutFwdInBwdOnBCs)
void DivideByQuadratureMetric(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Divided by the metric jacobi and quadrature weights.
virtual const Array< OneD, const std::shared_ptr< ExpList > > & v_GetBndCondExpansions(void)
Array< OneD, int > m_phys_offset
Offset of elemental data into the array m_phys.
virtual void v_SetHomoLen(const NekDouble lhom)
void Upwind(const Array< OneD, const NekDouble > &Vn, const Array< OneD, const NekDouble > &Fwd, const Array< OneD, const NekDouble > &Bwd, Array< OneD, NekDouble > &Upwind)
virtual void v_GetNormals(Array< OneD, Array< OneD, NekDouble > > &normals)
Populate normals with the normals of all expansions.
const DNekScalBlkMatSharedPtr GenBlockMatrix(const GlobalMatrixKey &gkey)
This function assembles the block diagonal matrix of local matrices of the type mtype.
virtual void v_IProductWRTBase_IterPerExp(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
void PhysDeriv(Direction edir, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &out_d)
void MultiplyByElmtInvMass(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This function elementally mulplies the coefficient space of Sin my the elemental inverse of the mass ...
void BwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
virtual void v_FwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n.
virtual const std::shared_ptr< LocTraceToTraceMap > & v_GetLocTraceToTraceMap(void) const
virtual void v_ExtractDataToCoeffs(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector< NekDouble > &fielddata, std::string &field, Array< OneD, NekDouble > &coeffs)
Extract data from raw field data into expansion list.
ExpansionType m_expType
Exapnsion type.
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
ExpansionType GetExpType(void)
Returns the type of the expansion.
NekDouble Linf(const Array< OneD, const NekDouble > &inarray, const Array< OneD, const NekDouble > &soln=NullNekDouble1DArray)
This function calculates the error of the global spectral/hp element approximation.
virtual void v_DealiasedProd(const Array< OneD, NekDouble > &inarray1, const Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
void GetDiagMatIpwrtBase(const Array< OneD, const Array< OneD, NekDouble > > &inarray, Array< OneD, DNekMatSharedPtr > &mtxPerVar)
Describe a linear system.
GlobalSysSolnType GetGlobalSysSolnType() const
Return the associated solution type.
Describes a matrix with ordering defined by a local to global map.
const StdRegions::ConstFactorMap & GetConstFactors() const
Returns all the constants.
int GetNVarCoeffs() const
LibUtilities::ShapeType GetShapeType() const
Return the expansion type associated with key.
const StdRegions::VarCoeffMap & GetVarCoeffs() const
StdRegions::MatrixType GetMatrixType() const
Return the matrix type.
static void Dscal(const int &n, const double &alpha, double *x, const int &incx)
BLAS level 1: x = alpha x.
std::map< OperatorType, ImplementationType > OperatorImpMap
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)
std::shared_ptr< FieldIO > FieldIOSharedPtr
static const BasisKey NullBasisKey(eNoBasisType, 0, NullPointsKey)
Defines a null basis with no type or points.
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 ...
std::shared_ptr< SessionReader > SessionReaderSharedPtr
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,...
std::shared_ptr< FieldDefinitions > FieldDefinitionsSharedPtr
void Interp2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
this function interpolates a 2D function evaluated at the quadrature points of the 2D basis,...
FieldIOFactory & GetFieldIOFactory()
Returns the FieldIO factory.
std::shared_ptr< Transposition > TranspositionSharedPtr
@ eNodalTriElec
2D Nodal Electrostatic Points on a Triangle
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
void PhysGalerkinProject2D(const BasisKey &fbasis0, const BasisKey &fbasis1, const Array< OneD, const NekDouble > &from, const BasisKey &tbasis0, const BasisKey &tbasis1, Array< OneD, NekDouble > &to)
int GetNumberOfCoefficients(ShapeType shape, std::vector< unsigned int > &modes, int offset)
@ eGauss_Lagrange
Lagrange Polynomials using the Gauss points .
@ eOrtho_A
Principle Orthogonal Functions .
@ eGLL_Lagrange
Lagrange for SEM basis .
std::shared_ptr< PointExp > PointExpSharedPtr
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< Expansion2D > Expansion2DSharedPtr
std::shared_ptr< Expansion0D > Expansion0DSharedPtr
std::vector< ExpansionSharedPtr > ExpansionVector
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
std::shared_ptr< Expansion3D > Expansion3DSharedPtr
MultiRegions::Direction const DirCartesianMap[]
@ eSIZE_GlobalSysSolnType
void AlignFace(const StdRegions::Orientation orient, const int nquad1, const int nquad2, const Array< OneD, const NekDouble > &in, Array< OneD, NekDouble > &out)
Helper function to re-align face to a given orientation.
static ExpListSharedPtr NullExpListSharedPtr
std::shared_ptr< AssemblyMapCG > AssemblyMapCGSharedPtr
std::shared_ptr< RobinBCInfo > RobinBCInfoSharedPtr
const char *const GlobalSysSolnTypeMap[]
std::shared_ptr< GlobalLinSys > GlobalLinSysSharedPtr
Pointer to a GlobalLinSys object.
std::shared_ptr< GlobalMatrix > GlobalMatrixSharedPtr
Shared pointer to a GlobalMatrix object.
GlobalLinSysFactory & GetGlobalLinSysFactory()
static LocTraceToTraceMapSharedPtr NullLocTraceToTraceMapSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< LocTraceToTraceMap > LocTraceToTraceMapSharedPtr
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::shared_ptr< AssemblyMap > AssemblyMapSharedPtr
std::map< int, std::vector< PeriodicEntity > > PeriodicMap
std::map< GlobalMatrixKey, DNekScalBlkMatSharedPtr > BlockMatrixMap
A map between global matrix keys and their associated block matrices.
static const NekDouble kNekZeroTol
std::shared_ptr< QuadGeom > QuadGeomSharedPtr
GeomMMF
Principle direction for MMF.
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
std::shared_ptr< PrismGeom > PrismGeomSharedPtr
std::map< int, CompositeSharedPtr > CompositeMap
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
@ eDeformed
Geometry is curved or has non-constant factors.
std::shared_ptr< SegGeom > SegGeomSharedPtr
std::shared_ptr< PyrGeom > PyrGeomSharedPtr
std::shared_ptr< ExpansionInfo > ExpansionInfoShPtr
std::shared_ptr< TetGeom > TetGeomSharedPtr
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
std::shared_ptr< HexGeom > HexGeomSharedPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::shared_ptr< Geometry2D > Geometry2DSharedPtr
std::shared_ptr< TriGeom > TriGeomSharedPtr
std::shared_ptr< Geometry1D > Geometry1DSharedPtr
std::map< int, ExpansionInfoShPtr > ExpansionInfoMap
std::shared_ptr< StdExpansion > StdExpansionSharedPtr
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
std::map< ConstFactorType, NekDouble > ConstFactorMap
@ eDir1BwdDir2_Dir2BwdDir1
@ eDir1BwdDir1_Dir2BwdDir2
@ eDir1BwdDir2_Dir2FwdDir1
@ eDir1FwdDir1_Dir2BwdDir2
@ eDir1BwdDir1_Dir2FwdDir2
@ eDir1FwdDir2_Dir2FwdDir1
@ eDir1FwdDir2_Dir2BwdDir1
The above copyright notice and this permission notice shall be included.
NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag > DNekScalMat
std::shared_ptr< DNekScalMat > DNekScalMatSharedPtr
std::pair< IndexType, IndexType > CoordType
std::shared_ptr< DNekScalBlkMat > DNekScalBlkMatSharedPtr
@ ePOSITIVE_DEFINITE_SYMMETRIC_BANDED
@ ePOSITIVE_DEFINITE_SYMMETRIC
std::map< CoordType, NekDouble > COOMatType
static Array< OneD, NekDouble > NullNekDouble1DArray
NekMatrix< NekMatrix< NekMatrix< NekDouble, StandardMatrixTag >, ScaledMatrixTag >, BlockMatrixTag > DNekScalBlkMat
std::shared_ptr< DNekMat > DNekMatSharedPtr
void Svtvp(int n, const T alpha, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
svtvp (scalar times vector plus vector): z = alpha*x + y
void Neg(int n, T *x, const int incx)
Negate x = -x.
T Vsum(int n, const T *x, const int incx)
Subtract return sum(x)
void Scatr(int n, const T *x, const int *y, T *z)
Scatter vector z[y[i]] = x[i].
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*x.
void Zero(int n, T *x, const int incx)
Zero vector.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
void Vsub(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Subtract vector z = x-y.
scalarT< T > abs(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)
Used to lookup the create function in NekManager.
std::shared_ptr< RobinBCInfo > next