]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New n_tensor_product_polynomials function. Small changes.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 10 Jan 2001 17:05:19 +0000 (17:05 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Wed, 10 Jan 2001 17:05:19 +0000 (17:05 +0000)
git-svn-id: https://svn.dealii.org/trunk@3635 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/source/tensor_product_polynomials.cc

index 4c58f8cf973d9e95412d9173f618c8dd2956cc1d..b47a29b0cbc6103aa75b89f95ac04e2ebdb78a41 100644 (file)
 
 
 
+template<typename number> static
+number power(number x, unsigned int y)
+{
+  number value=1;
+  for (unsigned int i=0; i<y; ++i)
+    value*=x;
+  return value;
+}
+
+
+
 template <int dim>
 TensorProductPolynomials<dim>::TensorProductPolynomials(
   const vector<SmartPointer<Polynomial> > &pols):
-               polynomials(pols)
+               polynomials(pols),
+               n_tensor_pols(power(polynomials.size(), dim))
 {}
 
 
@@ -36,7 +48,7 @@ void TensorProductPolynomials<dim>::compute(
   n_pols_to[0]=1;
   for (unsigned int i=0; i<dim; ++i)
     n_pols_to[i+1]=n_pols_to[i]*n_pols;
-  unsigned int n_tensor_pols=n_pols_to[dim];
+  Assert(n_pols_to[dim]==n_tensor_pols, ExcInternalError());
   
   Assert(values.size()==n_tensor_pols || values.size()==0,
         ExcDimensionMismatch2(values.size(), n_tensor_pols, 0));
@@ -123,6 +135,12 @@ void TensorProductPolynomials<dim>::compute(
 }
 
 
+template<int dim> inline
+unsigned int
+TensorProductPolynomials<dim>::n_tensor_product_polynomials() const
+{
+  return n_tensor_pols;
+}
 
   
 template class TensorProductPolynomials<1>;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.