NeoPZ
tpzprinteg.h
Go to the documentation of this file.
1 
6 #ifndef TPZPRINTEG_H
7 #define TPZPRINTEG_H
8 
9 #include "pzreal.h"
10 #include "pzvec.h"
11 
12 class TPZIntPoints;
13 
14 #include "tpzintrulelist.h"
15 #include "tpzgaussrule.h"
16 
22 template< class TFather>
23 class TPZPrInteg : public TFather
24 {
25 public:
26  enum {Dim = TFather::Dim+1};
27  int fOrdKsi;
29 public:
30  TPZPrInteg(int order) : TFather(order)
31  {
32  if(order>0)
33  {
35  fOrdKsi = order;
36  }
37  else
38  {
39  fOrdKsi = 0;
40  fIntP = 0;
41  }
42  }
43  TPZPrInteg(TPZVec<int> &order) : TFather()
44  {
45  SetOrder(order);
46  }
47 
48  TPZPrInteg(const TPZPrInteg &copy ) : TFather(copy), fOrdKsi(copy.fOrdKsi), fIntP(copy.fIntP)
49  {
50  }
51  virtual ~TPZPrInteg();
52 
53  int NPoints() const
54  {
55  return TFather::NPoints()*fIntP->NInt();
56  }
57  void Point(int ip, TPZVec<REAL> &pos, REAL &w) const
58  {
59  int ipf = ip/fIntP->NInt();
60  int iploc = ip%(fIntP->NInt());
61  TFather::Point(ipf,pos,w);
62  pos[Dim-1] = fIntP->Loc(iploc);
63  w *= fIntP->W(iploc);
64  }
65  void SetOrder(TPZVec<int> &ord, int type = 0)
66  {
67 #ifndef NODEBUG
68  if(ord.NElements() < Dim) {
69  std::cout << "TPZPrInteg::SetOrder: number of integration points specified smaller than dimension\n";
70  return;
71  }
72 #endif
73  TFather::SetOrder(ord,type);
74  fOrdKsi = ord[Dim-1];
76  }
77  void GetOrder(TPZVec<int> &ord) const
78  {
79 #ifndef NODEBUG
80  if(ord.NElements() < Dim) {
81  std::cout << "TPZPrInteg::GetOrder: number of integration points specified smaller than dimension\n";
82  return;
83  }
84 #endif
85  TFather::GetOrder(ord);
86  ord[Dim-1] = fOrdKsi;
87  }
88 
89  int Dimension() const
90  {
91  return Dim;
92  }
93 
94  virtual TPZIntPoints *PrismExtend(int order);
95 
96  int GetMaxOrder() const
97  {
98  int fatmax = TFather::GetMaxOrder();
99  return (fatmax > fOrdKsi) ? fatmax : fOrdKsi;
100 
101  }
102  virtual TPZIntPoints *Clone() const
103  {
104  return new TPZPrInteg<TFather>(*this);
105  }
106 
108  void Name(std::string &name) const {
109  name = "TPZPrInteg";
110  }
111 };
112 
113 #endif
int NPoints() const
Definition: tpzprinteg.h:53
void GetOrder(TPZVec< int > &ord) const
Definition: tpzprinteg.h:77
long double W(int i) const
Returns weight for the ith point.
TPZGaussRule * fIntP
Definition: tpzprinteg.h:28
Templated vector implementation.
int GetMaxOrder() const
Definition: tpzprinteg.h:96
int Dimension() const
Definition: tpzprinteg.h:89
void Point(int ip, TPZVec< REAL > &pos, REAL &w) const
Definition: tpzprinteg.h:57
void Name(std::string &name) const
Returns the name of the cubature rule.
Definition: tpzprinteg.h:108
int fOrdKsi
Definition: tpzprinteg.h:27
Abstract class defining integration rules. Numerical Integration.
Definition: tpzintpoints.h:19
TPZGaussRule * GetRule(int order, int type=0)
Returns a pointer to an gaussian integration rule with numint points. This method computes the number...
void SetOrder(TPZVec< int > &ord, int type=0)
Definition: tpzprinteg.h:65
virtual TPZIntPoints * PrismExtend(int order)
Definition: tpzprinteg.cpp:15
TPZPrInteg(TPZVec< int > &order)
Definition: tpzprinteg.h:43
virtual ~TPZPrInteg()
Definition: tpzprinteg.cpp:10
int NInt() const
Returns number of integration points.
Definition: tpzgaussrule.h:70
virtual TPZIntPoints * Clone() const
Definition: tpzprinteg.h:102
static TPZIntRuleList gIntRuleList
Static variable with list of all integration rules.
TPZPrInteg(int order)
Definition: tpzprinteg.h:30
Contains the TPZIntRuleList class which creates instances of all integration rules for rapid selectio...
TPZPrInteg(const TPZPrInteg &copy)
Definition: tpzprinteg.h:48
int64_t NElements() const
Returns the number of elements of the vector.
Definition: pzvec.h:190
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
Contains the TPZGaussRule class which implements the Gaussian quadrature.
Prismatic extension of an integration rule. Numerical Integration.
Definition: tpzprinteg.h:23
long double Loc(int i) const
Returns location of the ith point.
Implements the Gaussian quadrature. Numerical Integration Abstract class.
Definition: tpzgaussrule.h:19