//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+// Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
/**
* The number of quadrature
- * points in #quadrature_values.
+ * points in quadrature_values().
*/
unsigned int n_quadrature_points() const;
/**
* The number of values in each
* quadrature point in
- * #quadrature_values.
+ * quadrature_values().
*/
unsigned int n_quadrature_values() const;
*/
const MatrixBlock<FullMatrix<number> >& matrix(unsigned int i, bool external = false) const;
+ /**
+ * Access to the vector
+ * #quadrature_data of data
+ * in quadrature points,
+ * organized such that there is
+ * a vector for each point,
+ * containing one entry for
+ * each component.
+ */
+ Table<2, number>& quadrature_values();
+
/**
* Access the <i>i</i>th value
* at quadrature point <i>k</i>
*
* Values in quadrature points.
*/
- std::vector<std::vector<number> > quadrature_values;
+ Table<2, number> quadrature_data;
};
//----------------------------------------------------------------------//
inline void
LocalResults<number>::initialize_quadrature(unsigned int np, unsigned int nv)
{
- quadrature_values.resize(np, std::vector<number>(nv));
+ quadrature_data.reinit(np, nv);
}
unsigned int
LocalResults<number>::n_quadrature_points() const
{
- return quadrature_values.size();
+ return quadrature_data.n_rows();
}
unsigned int
LocalResults<number>::n_quadrature_values() const
{
- Assert(quadrature_values.size() != 0, ExcNotInitialized());
- return quadrature_values[0].size();
+ return quadrature_data.n_cols();
}
number&
LocalResults<number>::quadrature_value(unsigned int k, unsigned int i)
{
- AssertIndexRange(k,quadrature_values.size());
- AssertIndexRange(i,quadrature_values[0].size());
- return quadrature_values[k][i];
+ return quadrature_data(k,i);
+ }
+
+
+ template <typename number>
+ inline
+ Table<2, number>&
+ LocalResults<number>::quadrature_values()
+ {
+ return quadrature_data;
}
number
LocalResults<number>::quadrature_value(unsigned int k, unsigned int i) const
{
- AssertIndexRange(k,quadrature_values.size());
- AssertIndexRange(i,quadrature_values[0].size());
- return quadrature_values[k][i];
+ return quadrature_data(k,i);
}
}
for (unsigned int i=0;i<M2.size();++i)
M2[i].matrix.reinit(bi.block_size(M2[i].row),
bi.block_size(M2[i].column));
- for (unsigned int k=0;k<quadrature_values.size();++k)
- for (unsigned int i=0;i<quadrature_values[k].size();++i)
- quadrature_values[k][i] = 0.;
+ quadrature_data.reset_values();
}
+ MemoryConsumption::memory_consumption(R)
+ MemoryConsumption::memory_consumption(M1)
+ MemoryConsumption::memory_consumption(M2)
- + MemoryConsumption::memory_consumption(quadrature_values);
+ + MemoryConsumption::memory_consumption(quadrature_data);
return mem;
}