37 #ifndef NEKTAR_LIB_STDREGIONS_STANDARDEXPANSION_H
38 #define NEKTAR_LIB_STDREGIONS_STANDARDEXPANSION_H
49 #include <boost/enable_shared_from_this.hpp>
50 namespace Nektar {
namespace LocalRegions {
class MatrixKey;
class Expansion; } }
61 typedef Array<OneD, Array<OneD, NekDouble> >
NormalVector;
69 class StdExpansion :
public boost::enable_shared_from_this<StdExpansion>
100 return m_base.num_elements();
107 inline const Array<OneD, const LibUtilities::BasisSharedPtr>&
GetBase()
const
121 "dir is larger than number of bases");
146 for(i=0; i <
m_base.num_elements(); ++i)
148 nqtot *=
m_base[i]->GetNumPoints();
167 ASSERTL1(dir <
m_base.num_elements(),
"dir is larger than m_numbases");
180 ASSERTL1(dir <
m_base.num_elements(),
"dir is larger than m_numbases");
181 return(
m_base[dir]->GetNumModes());
196 for(i = 0; i <
m_base.num_elements(); ++i)
198 returnval = max(returnval,
m_base[i]->GetNumModes());
218 ASSERTL1(dir <
m_base.num_elements(),
"dir is larger than m_numbases");
232 "dir is larger than m_numbases");
233 return(
m_base.num_elements() > 0 ?
m_base[dir]->GetNumPoints() : 1);
243 inline const Array<OneD, const NekDouble>&
GetPoints(
const int dir)
const
245 return m_base[dir]->GetZ();
471 void BwdTrans (
const Array<OneD, const NekDouble>& inarray,
472 Array<OneD, NekDouble> &outarray)
481 inline void FwdTrans (
const Array<OneD, const NekDouble>& inarray,
482 Array<OneD, NekDouble> &outarray);
485 Array<OneD, NekDouble> &outarray)
538 void FillMode(
const int mode, Array<OneD, NekDouble> &outarray)
576 Array<OneD, NekDouble> &outarray)
582 const Array<OneD, const NekDouble>& base,
583 const Array<OneD, const NekDouble>& inarray,
584 Array<OneD, NekDouble> &outarray,
592 const Array<OneD, const NekDouble>& inarray,
593 Array<OneD, NekDouble> &outarray)
640 void GetCoord(
const Array<OneD, const NekDouble>& Lcoord,
641 Array<OneD, NekDouble> &coord)
673 void NormVectorIProductWRTBase(
const Array<OneD, const NekDouble> &Fx,
const Array<OneD, const NekDouble> &Fy, Array< OneD, NekDouble> &outarray)
678 void NormVectorIProductWRTBase(
const Array<OneD, const NekDouble> &Fx,
const Array<OneD, const NekDouble> &Fy,
const Array<OneD, const NekDouble> &Fz, Array< OneD, NekDouble> &outarray)
714 Array<OneD, NekDouble> &coeffs,
722 Array<OneD, const NekDouble> &inarray,
723 Array<OneD, NekDouble> &outarray)
734 const std::vector<unsigned int > &nummodes,
735 const int nmodes_offset,
743 const Array<OneD, const NekDouble> &Lcoord,
744 const Array<OneD, const NekDouble> &physvals);
748 boost::shared_ptr<StdExpansion> &EdgeExp,
749 const Array<OneD, const NekDouble> &Fx,
750 const Array<OneD, const NekDouble> &Fy,
751 Array<OneD, NekDouble> &outarray);
754 boost::shared_ptr<StdExpansion> &EdgeExp,
755 const Array<OneD, const NekDouble> &Fn,
756 Array<OneD, NekDouble> &outarray);
759 boost::shared_ptr<StdExpansion> &EdgeExp,
760 const Array<OneD, const NekDouble> &Fwd,
761 const Array<OneD, const NekDouble> &Bwd,
762 Array<OneD, NekDouble> &outarray);
765 boost::shared_ptr<StdExpansion> &FaceExp,
766 const Array<OneD, const NekDouble> &Fn,
767 Array<OneD, NekDouble> &outarray);
785 bool useCoeffPacking =
false)
791 Array<OneD, unsigned int> &maparray,
792 Array<OneD, int> &signarray)
798 Array<OneD, unsigned int> &maparray,
799 Array<OneD, int> &signarray)
805 Array<OneD, unsigned int> &maparray,
806 Array<OneD, int> &signarray)
812 Array<OneD, unsigned int> &maparray,
813 Array<OneD, int> &signarray,
814 int nummodesA = -1,
int nummodesB = -1)
817 nummodesA,nummodesB);
829 Array<OneD,NekDouble> &outarray)
835 const boost::shared_ptr<StdExpansion> &EdgeExp,
836 const Array<OneD, const NekDouble> &inarray,
837 Array<OneD,NekDouble> &outarray)
842 void GetTracePhysVals(
const int edge,
const boost::shared_ptr<StdExpansion> &EdgeExp,
const Array<OneD, const NekDouble> &inarray, Array<OneD,NekDouble> &outarray)
848 const Array<OneD, const NekDouble> &inarray,
856 Array<OneD,NekDouble> &outarray)
869 Array<OneD, NekDouble> &outarray)
878 const boost::shared_ptr<StdExpansion> &FaceExp,
879 const Array<OneD, const NekDouble> &inarray,
880 Array<OneD, NekDouble> &outarray,
887 const Array<OneD, const NekDouble> &inarray,
888 Array<OneD, NekDouble> &outarray)
894 const Array<OneD, const NekDouble> &inarray,
895 Array<OneD, NekDouble> & outarray)
912 Array<OneD,NekDouble> &outarray,
916 Array<OneD,NekDouble> &outarray,
923 Array<OneD,NekDouble> &outarray,
930 const Array<OneD, const NekDouble> &inarray,
931 Array<OneD,NekDouble> &outarray)
943 const Array<OneD, const NekDouble> &inarray,
944 Array<OneD,NekDouble> &outarray,
951 const Array<OneD, const NekDouble> &inarray,
952 Array<OneD,NekDouble> &outarray,
959 Array<OneD,NekDouble> &outarray,
966 Array<OneD,NekDouble> &outarray,
973 Array<OneD,NekDouble> &outarray,
975 bool addDiffusionTerm =
true)
987 Array<OneD,NekDouble> &outarray,
998 void PhysDeriv (
const Array<OneD, const NekDouble>& inarray,
999 Array<OneD, NekDouble> &out_d0,
1007 const Array<OneD, const NekDouble>& inarray,
1008 Array<OneD, NekDouble> &outarray)
1014 Array<OneD, NekDouble> &out_ds)
1020 Array<OneD, NekDouble>& out_dn)
1026 const Array<OneD, const NekDouble>& direction,
1027 Array<OneD, NekDouble> &outarray)
1033 Array<OneD, NekDouble> &out_d0,
1041 const Array<OneD, const NekDouble>& inarray,
1042 Array<OneD, NekDouble> &outarray)
1058 const Array<OneD, const NekDouble>& inarray,
1059 Array<
OneD, boost::shared_ptr< StdExpansion > > &EdgeExp,
1060 Array<
OneD, Array<OneD, NekDouble> > &coeffs,
1061 Array<OneD, NekDouble> &outarray)
1063 v_DGDeriv (dir, inarray, EdgeExp, coeffs, outarray);
1090 const Array<OneD, const NekDouble>& physvals)
1117 const Array<OneD, const NekDouble >& physvals)
1128 Array<OneD, NekDouble>& eta)
1156 const std::vector<unsigned int > &nummodes,
1157 const int nmode_offset,
1273 for (
int i = 0; i <
m_base.num_elements(); ++i)
1275 p.push_back(
m_base[i]->GetPointsKey());
1296 m_transformationmatrix);
1300 boost::shared_ptr<T>
as()
1302 #if defined __INTEL_COMPILER && BOOST_VERSION > 105200
1303 typedef typename boost::shared_ptr<T>::element_type E;
1304 E * p =
dynamic_cast< E*
>( shared_from_this().get() );
1305 ASSERTL1(p,
"Cannot perform cast");
1306 return boost::shared_ptr<T>( shared_from_this(), p );
1308 return boost::dynamic_pointer_cast<T>( shared_from_this() );
1313 Array<OneD, LibUtilities::BasisSharedPtr>
m_base;
1349 Array<OneD, NekDouble> &outarray);
1352 Array<OneD, NekDouble> &outarray)
1358 Array<OneD, NekDouble> &outarray)
1364 const Array<OneD, const NekDouble>& inarray,
1365 Array<OneD, NekDouble> &outarray)
1378 Array<OneD,NekDouble> &outarray,
1382 Array<OneD,NekDouble> &outarray,
1386 Array<OneD,NekDouble> &outarray,
1393 const Array<OneD, const NekDouble> &inarray,
1394 Array<OneD, NekDouble> &outarray,
1395 Array<OneD, NekDouble> &wsp)
1401 Array<OneD,NekDouble> &outarray,
1405 const Array<OneD, const NekDouble> &inarray,
1406 Array<OneD,NekDouble> &outarray,
1410 const Array<OneD, const NekDouble> &inarray,
1411 Array<OneD,NekDouble> &outarray,
1415 Array<OneD,NekDouble> &outarray,
1419 Array<OneD,NekDouble> &outarray,
1423 Array<OneD,NekDouble> &outarray,
1425 bool addDiffusionTerm =
true);
1428 Array<OneD,NekDouble> &outarray,
1435 Array<OneD,NekDouble> &outarray,
1439 Array<OneD, const NekDouble> &inarray,
1440 Array<OneD, NekDouble> &outarray);
1443 Array<OneD, NekDouble> &coeffs,
1447 const Array<OneD, const NekDouble> &Lcoord,
1448 const Array<OneD, const NekDouble> &physvals);
1451 boost::shared_ptr<StdExpansion> &EdgeExp,
1452 const Array<OneD, const NekDouble> &Fx,
1453 const Array<OneD, const NekDouble> &Fy,
1454 Array<OneD, NekDouble> &outarray);
1457 boost::shared_ptr<StdExpansion> &EdgeExp,
1458 const Array<OneD, const NekDouble> &Fn,
1459 Array<OneD, NekDouble> &outarray);
1462 boost::shared_ptr<StdExpansion> &FaceExp,
1463 const Array<OneD, const NekDouble> &Fn,
1464 Array<OneD, NekDouble> &outarray);
1508 Array<OneD, NekDouble> &outarray) = 0;
1516 const Array<OneD, const NekDouble>& inarray,
1517 Array<OneD, NekDouble> &outarray) = 0;
1524 const Array<OneD, const NekDouble>& inarray,
1525 Array<OneD, NekDouble> &outarray) = 0;
1528 const Array<OneD, const NekDouble>& base,
1529 const Array<OneD, const NekDouble>& inarray,
1530 Array<OneD, NekDouble>& outarray,
1533 ASSERTL0(
false,
"StdExpansion::v_IProductWRTBase has no (and should have no) implementation");
1537 const Array<OneD, const NekDouble>& inarray,
1538 Array<OneD, NekDouble> &outarray);
1541 Array<OneD, NekDouble> &outarray);
1546 Array<OneD, NekDouble> &out_d1,
1547 Array<OneD, NekDouble> &out_d2,
1548 Array<OneD, NekDouble> &out_d3);
1551 Array<OneD, NekDouble> &out_ds);
1554 Array<OneD, NekDouble>& out_dn);
1556 const Array<OneD, const NekDouble>& inarray,
1557 Array<OneD, NekDouble> &out_d0);
1560 const Array<OneD, const NekDouble>& direction,
1561 Array<OneD, NekDouble> &outarray);
1564 Array<OneD, NekDouble> &out_d1,
1565 Array<OneD, NekDouble> &out_d2,
1566 Array<OneD, NekDouble> &out_d3);
1569 const Array<OneD, const NekDouble>& inarray,
1570 Array<OneD, NekDouble> &outarray);
1578 const Array<OneD, const NekDouble>& inarray,
1579 Array<
OneD, boost::shared_ptr<StdExpansion> > &EdgeExp,
1580 Array<
OneD, Array<OneD, NekDouble> > &coeffs,
1581 Array<OneD, NekDouble> &outarray);
1588 const Array<OneD, const NekDouble>& xi,
1589 Array<OneD, NekDouble>& eta);
1599 Array<OneD, NekDouble> &coords_1,
1600 Array<OneD, NekDouble> &coords_2);
1603 Array<OneD, NekDouble> &coord);
1612 bool useCoeffPacking =
false);
1615 Array<OneD, unsigned int> &maparray,
1616 Array<OneD, int> &signarray);
1619 Array<OneD, unsigned int> &maparray,
1620 Array<OneD, int> &signarray);
1623 Array<OneD, unsigned int> &maparray,
1624 Array<OneD, int> &signarray);
1627 Array<OneD, unsigned int> &maparray,
1628 Array<OneD, int> &signarray,
1629 int nummodesA = -1,
int nummodesB = -1);
1638 STD_REGIONS_EXPORT virtual void v_GetEdgePhysVals(
const int edge,
const boost::shared_ptr<StdExpansion> &EdgeExp,
const Array<OneD, const NekDouble> &inarray, Array<OneD,NekDouble> &outarray);
1645 const Array<OneD, const NekDouble> &inarray,Array<OneD,NekDouble> &outarray);
1649 Array<OneD, NekDouble> &outarray);
1653 const boost::shared_ptr<StdExpansion> &FaceExp,
1654 const Array<OneD, const NekDouble> &inarray,
1655 Array<OneD, NekDouble> &outarray,
1659 const Array<OneD, const NekDouble> &inarray,
1660 Array<OneD, NekDouble> &outarray);
1663 const Array<OneD, const NekDouble> &inarray,
1664 Array<OneD, NekDouble> &outarray);
1669 Array<OneD, NekDouble> &outarray);
1672 Array<OneD, NekDouble> &outarray);
1675 const Array<OneD, const NekDouble>& inarray,
1676 Array<OneD, NekDouble> &outarray);
1679 Array<OneD,NekDouble> &outarray,
1683 Array<OneD,NekDouble> &outarray,
1691 const Array<OneD, const NekDouble> &inarray,
1692 Array<OneD,NekDouble> &outarray);
1695 const Array<OneD, const NekDouble> &inarray,
1696 Array<OneD,NekDouble> &outarray,
1700 const Array<OneD, const NekDouble> &inarray,
1701 Array<OneD,NekDouble> &outarray,
1705 Array<OneD,NekDouble> &outarray,
1709 Array<OneD,NekDouble> &outarray,
1714 Array<OneD,NekDouble> &outarray,
1716 bool addDiffusionTerm=
true);
1719 Array<OneD,NekDouble> &outarray,
1723 Array<OneD,NekDouble> &outarray,
1727 const Array<OneD, const NekDouble> &inarray,
1728 Array<OneD, NekDouble> &outarray,
1729 Array<OneD, NekDouble> &wsp);
1732 Array<OneD,NekDouble> &outarray,
1800 Array<OneD, NekDouble> &outarray)
1808 #endif //STANDARDDEXPANSION_H