Think about the determinant function in the tensor package. Is it
useful, can it be generalized?
+
+Put Tensor<1,dim>::array_size directly into the array type. At
+ present, egcs 1.1.2 chokes on that.
* all functions are provided in the #quadrature.cc# file, but they will
* throw exceptions if actually called. The only function which is allowed
* to be called is the constructor taking one integer, which in this case
- * ignores its parameter, and of course the destructor.
+ * ignores its parameter, and of course the destructor. Besides this, it is
+ * necessary to provide a class #Point<0># to make the compiler happy. This
+ * class also does nothing.
*
* @author Wolfgang Bangerth, 1998
*/
/**
* Help function for unroll.
*/
- void unroll_recursion(Vector<double> & result, unsigned int& start_index) const;
-
- template<>
- friend void Tensor<rank_+1,dim>::unroll_recursion(Vector<double> &, unsigned&) const;
+ void unroll_recursion(Vector<double> &result,
+ unsigned int &start_index) const;
+
+ // make the following class a
+ // friend to this class. in principle,
+ // it would suffice if otherrank==rank+1,
+ // but then the compiler complains
+ // that this be an explicit specialization
+ // which is not what we want
+ //
+ // also, it would be sufficient to make
+ // the function unroll_loops a friend,
+ // but that seems to be impossible as well.
+ template<int otherrank, int otherdim> friend class Tensor;
};
*/
static const unsigned int rank = 1;
+ /**
+ * Unnecessary variable, only used in
+ * the declaration of #array_type#.
+ * This variable should be omitted,
+ * but egcs1.1.2 chokes on that so
+ * we need it presently.
+ */
+ static const unsigned int array_size = (dim>0 ? dim : 1);
+
/**
* Declare an array type which can
* be used to initialize statically
* an object of this type.
+ *
+ * Use the same condition for #dim==0#
+ * as in the #TensorBase<1,dim># class.
*/
- typedef double array_type[dim];
+ typedef double array_type[array_size];
/**
* Constructor. Initialize all entries
* index marches fastest.
*/
void unroll (Vector<double> &result) const;
-
+
protected:
/**
- * Store the values in a simple array.
+ * Store the values in a simple array.
+ * For #dim==0# store one element, because
+ * otherways the compiler would choke.
+ * We catch this case in the constructor
+ * to disallow the creation of such
+ * an object.
*/
- double values[dim];
+ double values[dim>0 ? dim : 1];
/**
* Help function for unroll.
*/
- void unroll_recursion (Vector<double> & result,
- unsigned int& start_index) const;
-
- template<>
- friend void Tensor<2,dim>::unroll_recursion(Vector<double> &,
- unsigned&) const;
+ void unroll_recursion (Vector<double> &result,
+ unsigned int &start_index) const;
+
+ // make the following classes
+ // friends to this class. in principle,
+ // it would suffice if otherrank==2,
+ // but then the compiler complains
+ // that this be an explicit specialization
+ // which is not what we want
+ //
+ // also, it would be sufficient to make
+ // the function unroll_loops a friend,
+ // but that seems to be impossible as well.
+ template<int otherrank, int otherdim> friend class Tensor;
};
/**
CXX = c++
INCLUDE = -I$D/deal.II/include -I$D/lac/include \
-I$D/base/include
-CXXFLAGS.g= -ansi -DDEBUG -ggdb -Wall -W -pedantic -Wconversion \
+CXXFLAGS.g= -ansi -DDEBUG -ggdb -Wall -W -Wconversion \
-Winline -Woverloaded-virtual -fno-builtin\
-fno-vtable-thunks \
$(INCLUDE)
# we look for declarations, where after the name comes a colon
# or an open-brace, maybe also a semicolon or just nothing
- if (($rest =~ /^\s*[:\{;]/) || ($rest =~ /^\s*$/)) {
+ #
+ # the colon might be of an inheritance list, but we do not
+ # want it to come from a nested class declaration
+ if (($rest =~ /^\s*([\{;]|:[^:])/) || ($rest =~ /^\s*$/)) {
$declaration = $basepart . " " . $name;
# strip double spaces etc.
$declaration =~ s/\s\s+/ /g;
The hypercube is fixed, however.
-Let DoFHandler be derived from Subscriptor and let the DataOut object
- subscribe to it. Same for FEValues and maybe some more classes.
-
-
Change the vector<int> in 'void DoFQuadAccessor::get_dof_indices(
vector<int> &dof_indices) const' in a vector<unsigned int> and
catch the Error dof_index==-1 inside of this function
Remove that pseudo-template clutter in the lower parts of
- dof_accessor.cc marked by comments.
+ dof_accessor.[templates.]cc marked by comments.
Remove the flag -fno-vtable-thunks if egcs's bug is removed someday.
* Exception for child classes
*/
DeclException0 (ExcInvalidObject);
- /**
- * Exception for child classes
- */
- DeclException3 (ExcInvalidIndex,
- int,
- int,
- int,
- << "Invalid index " << arg1
- << ", index must be between " << arg2
- << " and " << arg3 << ".");
/**
* Exception
*/
* class expects to get passed from the
* iterator classes.
*/
- typedef typename DoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
+ typedef DoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
/**
* Constructor
* class expects to get passed from the
* iterator classes.
*/
- typedef typename DoFQuadAccessor<2,CellAccessor<2> >::AccessorData AccessorData;
+ typedef DoFQuadAccessor<2,CellAccessor<2> >::AccessorData AccessorData;
/**
* Constructor
* class expects to get passed from the
* iterator classes.
*/
- typedef typename DoFQuadAccessor<3,CellAccessor<3> >::AccessorData AccessorData;
+ typedef DoFQuadAccessor<3,CellAccessor<3> >::AccessorData AccessorData;
/**
* Constructor
// and enough room was reserved
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (i<dof_handler->selected_fe->dofs_per_line,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_line));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_line));
return dof_handler->levels[present_level]
->line_dofs[present_index*dof_handler->selected_fe->dofs_per_line+i];
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
- Assert (vertex<2, ExcInvalidIndex (i,0,2));
+ Assert (vertex<2, ExcIndexRange (i,0,2));
Assert (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
const unsigned int dof_number = (vertex_index(vertex) *
dof_handler->selected_fe->dofs_per_vertex +
// and enough room was reserved
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (i<dof_handler->selected_fe->dofs_per_quad,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_quad));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_quad));
return dof_handler->levels[present_level]
->quad_dofs[present_index*dof_handler->selected_fe->dofs_per_quad+i];
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
- Assert (vertex<4, ExcInvalidIndex (i,0,4));
+ Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
const unsigned int dof_number = (vertex_index(vertex) *
dof_handler->selected_fe->dofs_per_vertex +
inline
TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
DoFQuadAccessor<dim,BaseClass>::line (const unsigned int i) const {
- Assert (i<4, ExcInvalidIndex (i, 0, 4));
+ Assert (i<4, ExcIndexRange (i, 0, 4));
return TriaIterator<dim,DoFLineAccessor<dim,LineAccessor<dim> > >
(
// and enough room was reserved
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (i<dof_handler->selected_fe->dofs_per_hex,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_hex));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_hex));
return dof_handler->levels[present_level]
->hex_dofs[present_index*dof_handler->selected_fe->dofs_per_hex+i];
const unsigned int i) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
- Assert (vertex<8, ExcInvalidIndex (i,0,8));
+ Assert (vertex<8, ExcIndexRange (i,0,8));
Assert (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
const unsigned int dof_number = (vertex_index(vertex) *
dof_handler->selected_fe->dofs_per_vertex +
inline
TriaIterator<dim,DoFQuadAccessor<dim,QuadAccessor<dim> > >
DoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
- Assert (i<6, ExcInvalidIndex (i, 0, 6));
+ Assert (i<6, ExcIndexRange (i, 0, 6));
return TriaIterator<dim,DoFQuadAccessor<dim,QuadAccessor<dim> > >
(
*
* @author Wolfgang Bangerth, 1998 */
template <int dim>
-class DoFHandler
- :
- public Subscriptor,
- public DoFDimensionInfo<dim>
+class DoFHandler : public Subscriptor,
+ public DoFDimensionInfo<dim>
{
public:
typedef typename DoFDimensionInfo<dim>::raw_line_iterator raw_line_iterator;
*/
const Triangulation<dim> & get_tria () const;
- /**
- * Exception
- */
- DeclException0 (ExcNotImplemented);
/**
* Exception
*/
* class expects to get passed from the
* iterator classes.
*/
- typedef typename MGDoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
+ typedef MGDoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
/**
* Constructor
/**
* Exception
*/
- DeclException0 (ExcNotImplemented);
- /**
- * Exception
- */
DeclException0 (ExcBoundaryFaceUsed);
/**
* Exception
* about.
*/
const FullMatrix<double> & restrict (const unsigned int) const;
-
- /**
- * Exception
- */
- DeclException0 (ExcNotImplemented);
};
template <int dim>
template <class FE>
FESystem<dim>::FESystem (const FE &fe, const unsigned int n_elements) :
- FiniteElement (multiply_dof_numbers(fe, n_elements)),
+ FiniteElement<dim> (multiply_dof_numbers(fe, n_elements)),
base_elements(1),
component_to_base_table(n_components)
{
FESystem<dim>::FESystem (const FE1 &fe1, const unsigned int n1,
const FE2 &fe2, const unsigned int n2)
:
- FiniteElement (multiply_dof_numbers(fe1, n1, fe2, n2)),
+ FiniteElement<dim> (multiply_dof_numbers(fe1, n1, fe2, n2)),
base_elements(2),
component_to_base_table(n_components)
{
const FE2 &fe2, const unsigned int n2,
const FE3 &fe3, const unsigned int n3)
:
- FiniteElement (multiply_dof_numbers(fe1, n1,
- fe2, n2,
- fe3, n3)),
+ FiniteElement<dim> (multiply_dof_numbers(fe1, n1,
+ fe2, n2,
+ fe3, n3)),
base_elements(3),
component_to_base_table(n_components)
{
/**
* Exception
*/
- DeclException0 (ExcNotImplemented);
- /**
- * Exception
- */
DeclException0 (ExcInvalidUpdateFlag);
protected:
*/
Triangulation<dim> *tria;
- template <int dim, typename Accessor> friend class TriaRawIterator<dim,Accessor>;
- template <int dim, typename Accessor> friend class TriaIterator<dim,Accessor>;
- template <int dim, typename Accessor> friend class TriaActiveIterator<dim,Accessor>;
+ template <int anydim, typename Accessor> friend class TriaRawIterator;
+ template <int anydim, typename Accessor> friend class TriaIterator;
+ template <int anydim, typename Accessor> friend class TriaActiveIterator;
};
/**
* Declare some friends.
*/
- template <int dim> friend class TriaRawIterator<dim,LineAccessor<dim> >;
- template <> friend class TriaRawIterator<1,CellAccessor<1> >;
+ template <int anydim, typename AnyAccessor> friend class TriaRawIterator;
};
/**
* Declare some friends.
*/
- template <int dim> friend class TriaRawIterator<dim,QuadAccessor<dim> >;
- template <> friend class TriaRawIterator<2,CellAccessor<2> >;
+ template <int anydim, typename AnyAccessor> friend class TriaRawIterator;
};
/**
* Declare some friends.
*/
- template <int dim> friend class TriaRawIterator<dim,HexAccessor<dim> >;
- template <> friend class TriaRawIterator<3,CellAccessor<3> >;
+ template <int anydim, typename AnyAccessor> friend class TriaRawIterator;
};
* Propagate the AccessorData type
* into the present class.
*/
- typedef typename LineAccessor<1>::AccessorData AccessorData;
+ typedef LineAccessor<1>::AccessorData AccessorData;
/**
* Constructor
*/
* Propagate the AccessorData type
* into the present class.
*/
- typedef typename QuadAccessor<2>::AccessorData AccessorData;
+ typedef QuadAccessor<2>::AccessorData AccessorData;
/**
* Constructor
*/
* Propagate the AccessorData type
* into the present class.
*/
- typedef typename HexAccessor<3>::AccessorData AccessorData;
+ typedef HexAccessor<3>::AccessorData AccessorData;
/**
* Constructor
inline
TriaIterator<dim,LineAccessor<dim> >
LineAccessor<dim>::child (const unsigned int i) const {
- Assert (i<2, ExcInvalidIndex(i,0,1));
+ Assert (i<2, ExcIndexRange(i,0,2));
TriaIterator<dim,LineAccessor<dim> > q (tria, present_level+1, child_index (i));
inline
int
LineAccessor<dim>::child_index (unsigned int i) const {
- Assert (i<2, ExcInvalidIndex(i,0,1));
+ Assert (i<2, ExcIndexRange(i,0,2));
return tria->levels[present_level]->lines.children[present_index]+i;
};
inline
unsigned int
QuadAccessor<dim>::line_index (unsigned int i) const {
- Assert (i<4, ExcInvalidIndex(i,0,3));
+ Assert (i<4, ExcIndexRange(i,0,4));
return tria->levels[present_level]->quads.quads[present_index].line(i);
};
inline
TriaIterator<dim,QuadAccessor<dim> >
QuadAccessor<dim>::child (const unsigned int i) const {
- Assert (i<4, ExcInvalidIndex(i,0,3));
+ Assert (i<4, ExcIndexRange(i,0,4));
TriaIterator<dim,QuadAccessor<dim> > q (tria, present_level+1, child_index (i));
template <int dim>
inline
int QuadAccessor<dim>::child_index (unsigned int i) const {
- Assert (i<4, ExcInvalidIndex(i,0,3));
+ Assert (i<4, ExcIndexRange(i,0,4));
return tria->levels[present_level]->quads.children[present_index]+i;
};
TriaIterator<dim,LineAccessor<dim> >
HexAccessor<dim>::line (const unsigned int i) const {
Assert (used(), ExcCellNotUsed());
- Assert (i<12, ExcInvalidIndex (i,0,11));
+ Assert (i<12, ExcIndexRange (i,0,12));
if (i<4)
return quad(0)->line(i);
case 11:
return quad(4)->line(3);
};
- Assert (false, ExcInvalidIndex(i,0,11));
+ Assert (false, ExcIndexRange(i,0,12));
return TriaIterator<dim,LineAccessor<dim> >(tria, -1, -1, 0);
};
inline
unsigned int
HexAccessor<dim>::line_index (unsigned int i) const {
- Assert (i<12, ExcInvalidIndex(i,0,11));
+ Assert (i<12, ExcIndexRange(i,0,12));
if (i<4)
return quad(0)->line_index(i);
case 11:
return quad(4)->line_index(3);
};
- Assert (false, ExcInvalidIndex(i,0,11));
+ Assert (false, ExcIndexRange(i,0,12));
return 0;
};
inline
unsigned int
HexAccessor<dim>::quad_index (unsigned int i) const {
- Assert (i<6, ExcInvalidIndex(i,0,5));
+ Assert (i<6, ExcIndexRange(i,0,6));
return tria->levels[present_level]->hexes.hexes[present_index].quad(i);
};
inline
TriaIterator<dim,HexAccessor<dim> >
HexAccessor<dim>::child (const unsigned int i) const {
- Assert (i<6, ExcInvalidIndex(i,0,5));
+ Assert (i<6, ExcIndexRange(i,0,6));
TriaIterator<dim,HexAccessor<dim> > q (tria, present_level+1, child_index (i));
template <int dim>
inline
int HexAccessor<dim>::child_index (unsigned int i) const {
- Assert (i<8, ExcInvalidIndex(i,0,7));
+ Assert (i<8, ExcIndexRange(i,0,8));
return tria->levels[present_level]->hexes.children[present_index]+i;
};
* friends of this class. This is
* necessary for the implementation of
* conversion constructors.
+ *
+ * In fact, we would not need them to
+ * be friends if they were for different
+ * dimensions, but the compiler dislikes
+ * giving a fixed dimension and variable
+ * accessor since then it says that would
+ * be a artial specialization.
*/
- template <typename SomeAccessor>
- friend class TriaRawIterator<dim,SomeAccessor>;
-
- template <typename SomeAccessor>
- friend class TriaIterator<dim,SomeAccessor>;
-
- template <typename SomeAccessor>
- friend class TriaActiveIterator<dim,SomeAccessor>;
+ template <int anydim, typename SomeAccessor> friend class TriaRawIterator;
+ template <int anydim, typename SomeAccessor> friend class TriaIterator;
+ template <int anydim, typename SomeAccessor> friend class TriaActiveIterator;
};
* class expects to get passed from the
* iterator classes.
*/
- typedef typename MGDoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
+ typedef MGDoFLineAccessor<1,CellAccessor<1> >::AccessorData AccessorData;
/**
* Constructor
*/
void read_ucd (istream &);
- /**
- * Exception
- */
- DeclException0 (ExcNotImplemented);
/**
* Exception
*/
/**
* Exception
*/
- DeclException0 (ExcNotImplemented);
- /**
- * Exception
- */
DeclException0 (ExcNoDoFHandlerSelected);
/**
* Exception
Vector<float> &error,
const Function<dim> *coefficient = 0,
const unsigned int selected_component = 0);
-
- /**
- * Exception
- */
- DeclException0 (ExcNotImplemented);
- /**
- * Exception
- */
- DeclException0 (ExcInternalError);
/**
* Exception
*/
static void create_interpolation_matrix(const FiniteElement<dim> &high,
const FiniteElement<dim> &low,
FullMatrix<double>& result);
-
-
- /**
- * Exception
- */
- DeclException0 (ExcNotImplemented);
- /**
- * Exception
- */
- DeclException0 (ExcInternalError);
};
int, int,
<< "The size of the vector is " << arg1
<< "although it should be " << arg2 << ".");
-
- /**
- * Exception
- */
- DeclException0(ExcInternalError);
private:
*/
double get_forward_timestep () const;
- /**
- * Exception
- */
- DeclException0 (ExcInternalError);
/**
* Exception
*/
DeclException1 (ExcInvalidParameter,
int,
<< "The parameter " << arg1 << " has an invalid value.");
- /**
- * Exception
- */
- DeclException0 (ExcInternalError);
};
const NormType &norm);
- /**
- * Exception
- */
- DeclException0 (ExcNotImplemented);
/**
* Exception
*/
// and enough room was reserved
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (i<dof_handler->selected_fe->dofs_per_line,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_line));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_line));
dof_handler->levels[present_level]
->line_dofs[present_index*dof_handler->selected_fe->dofs_per_line+i] = index;
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
- Assert (vertex<2, ExcInvalidIndex (i,0,2));
+ Assert (vertex<2, ExcIndexRange (i,0,2));
Assert (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
const unsigned int dof_number = (vertex_index(vertex) *
dof_handler->selected_fe->dofs_per_vertex +
// and enough room was reserved
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (i<dof_handler->selected_fe->dofs_per_quad,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_quad));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_quad));
dof_handler->levels[present_level]
->quad_dofs[present_index*dof_handler->selected_fe->dofs_per_quad+i] = index;
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
- Assert (vertex<4, ExcInvalidIndex (i,0,4));
+ Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
const unsigned int dof_number = (vertex_index(vertex) *
dof_handler->selected_fe->dofs_per_vertex +
// and enough room was reserved
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
Assert (i<dof_handler->selected_fe->dofs_per_hex,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_hex));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_hex));
dof_handler->levels[present_level]
->hex_dofs[present_index*dof_handler->selected_fe->dofs_per_hex+i] = index;
const int index) const {
Assert (dof_handler != 0, ExcInvalidObject());
Assert (dof_handler->selected_fe != 0, ExcInvalidObject());
- Assert (vertex<8, ExcInvalidIndex (i,0,8));
+ Assert (vertex<8, ExcIndexRange (i,0,8));
Assert (i<dof_handler->selected_fe->dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->selected_fe->dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->selected_fe->dofs_per_vertex));
const unsigned int dof_number = (vertex_index(vertex) *
dof_handler->selected_fe->dofs_per_vertex +
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFLineAccessor(tria,level,index,local_data) {};
+ DoFLineAccessor<dim,BaseClass>(tria,level,index,local_data) {};
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_line,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_line));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_line));
return mg_dof_handler->mg_levels[present_level]
->line_dofs[present_index*dof_handler->get_fe().dofs_per_line+i];
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_line,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_line));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_line));
mg_dof_handler->mg_levels[present_level]
->line_dofs[present_index*dof_handler->get_fe().dofs_per_line+i] = index;
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<2, ExcInvalidIndex (i,0,2));
+ Assert (vertex<2, ExcIndexRange (i,0,2));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
return (mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.get_index (present_level, i, dof_handler->get_fe().dofs_per_vertex));
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<2, ExcInvalidIndex (i,0,2));
+ Assert (vertex<2, ExcIndexRange (i,0,2));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.set_index (present_level, i, dof_handler->get_fe().dofs_per_vertex, index);
template <int dim, typename BaseClass>
void
MGDoFLineAccessor<dim,BaseClass>::copy_from (const MGDoFLineAccessor<dim,BaseClass> &a) {
- DoFLineAccessor::copy_from (a);
+ DoFLineAccessor<dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFQuadAccessor(tria,level,index,local_data) {};
+ DoFQuadAccessor<dim,BaseClass>(tria,level,index,local_data) {};
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_quad,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_quad));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_quad));
return mg_dof_handler->mg_levels[present_level]
->quad_dofs[present_index*dof_handler->get_fe().dofs_per_quad+i];
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_quad,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_quad));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_quad));
mg_dof_handler->mg_levels[present_level]
->quad_dofs[present_index*dof_handler->get_fe().dofs_per_quad+i] = index;
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<4, ExcInvalidIndex (i,0,4));
+ Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
return (mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.get_index (present_level, i, dof_handler->get_fe().dofs_per_vertex));
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<4, ExcInvalidIndex (i,0,4));
+ Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.set_index (present_level, i, dof_handler->get_fe().dofs_per_vertex, index);
template <int dim, typename BaseClass>
TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
MGDoFQuadAccessor<dim,BaseClass>::line (const unsigned int i) const {
- Assert (i<4, ExcInvalidIndex (i, 0, 4));
+ Assert (i<4, ExcIndexRange (i, 0, 4));
return TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
(
template <int dim, typename BaseClass>
void
MGDoFQuadAccessor<dim,BaseClass>::copy_from (const MGDoFQuadAccessor<dim,BaseClass> &a) {
- DoFQuadAccessor::copy_from (a);
+ DoFQuadAccessor<dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFHexAccessor(tria,level,index,local_data) {};
+ DoFHexAccessor<dim,BaseClass>(tria,level,index,local_data) {};
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_hex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_hex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_hex));
return mg_dof_handler->mg_levels[present_level]
->hex_dofs[present_index*dof_handler->get_fe().dofs_per_hex+i];
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_hex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_hex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_hex));
mg_dof_handler->mg_levels[present_level]
->hex_dofs[present_index*dof_handler->get_fe().dofs_per_hex+i] = index;
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<8, ExcInvalidIndex (i,0,8));
+ Assert (vertex<8, ExcIndexRange (i,0,8));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
return (mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.get_index (present_level, i, dof_handler->get_fe().dofs_per_vertex));
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<4, ExcInvalidIndex (i,0,4));
+ Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.set_index (present_level, i, dof_handler->get_fe().dofs_per_vertex, index);
template <int dim, typename BaseClass>
TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
MGDoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
- Assert (i<12, ExcInvalidIndex (i, 0, 12));
+ Assert (i<12, ExcIndexRange (i, 0, 12));
return TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
(
template <int dim, typename BaseClass>
TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
MGDoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
- Assert (i<12, ExcInvalidIndex (i, 0, 6));
+ Assert (i<12, ExcIndexRange (i, 0, 6));
return TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
(
template <int dim, typename BaseClass>
void
MGDoFHexAccessor<dim,BaseClass>::copy_from (const MGDoFHexAccessor<dim,BaseClass> &a) {
- DoFHexAccessor::copy_from (a);
+ DoFHexAccessor<dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
template <>
-void FEQ3<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell,
- vector<Point<1> > &support_points) const {
+void FEQ3<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell,
+ vector<Point<1> > &support_points) const {
FiniteElement<1>::get_support_points (cell, support_points);
};
template <>
-void FEQ3<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- vector<Point<1> > &) const {
+void FEQ3<1>::get_face_support_points (const DoFHandler<1>::face_iterator &,
+ vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <>
void FEQ3<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
- FullMatrix<double> &local_mass_matrix) const {
+ FullMatrix<double> &local_mass_matrix) const {
Assert (local_mass_matrix.n() == total_dofs,
ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
Assert (local_mass_matrix.m() == total_dofs,
template <>
-void FEQ3<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell,
- vector<Point<2> > &support_points) const {
+void FEQ3<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell,
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
-void FEQ3<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face,
- vector<Point<2> > &support_points) const {
+void FEQ3<2>::get_face_support_points (const DoFHandler<2>::face_iterator &face,
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
template <>
void
-FEDG_Q0<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- vector<Point<1> > &) const {
+FEDG_Q0<1>::get_face_support_points (const DoFHandler<1>::face_iterator &,
+ vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
FEDG_Q0<dim>::shape_value (const unsigned int i,
const Point<dim>&) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
return 1.;
};
FEDG_Q0<dim>::shape_grad (const unsigned int i,
const Point<dim>&) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
return Tensor<1,dim> ();
};
FEDG_Q0<dim>::shape_grad_grad (const unsigned int i,
const Point<dim> &) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
return Tensor<2,dim>();
};
template <>
-void FEQ1<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell,
- vector<Point<1> > &support_points) const {
+void FEQ1<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell,
+ vector<Point<1> > &support_points) const {
FiniteElement<1>::get_support_points (cell, support_points);
};
template <>
-void FEQ1<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- vector<Point<1> > &) const {
+void FEQ1<1>::get_face_support_points (const DoFHandler<1>::face_iterator &,
+ vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <>
-void FEQ2<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell,
- vector<Point<1> > &support_points) const {
+void FEQ2<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell,
+ vector<Point<1> > &support_points) const {
FiniteElement<1>::get_support_points (cell, support_points);
};
template <>
-void FEQ2<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- vector<Point<1> > &) const {
+void FEQ2<1>::get_face_support_points (const DoFHandler<1>::face_iterator &,
+ vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <>
-void FEQ2<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell,
- vector<Point<2> > &support_points) const {
+void FEQ2<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell,
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
-void FEQ2<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face,
- vector<Point<2> > &support_points) const {
+void FEQ2<2>::get_face_support_points (const DoFHandler<2>::face_iterator &face,
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
template <>
-void FEQ2<3>::get_support_points (const typename DoFHandler<3>::cell_iterator &cell,
- vector<Point<3> > &support_points) const {
+void FEQ2<3>::get_support_points (const DoFHandler<3>::cell_iterator &cell,
+ vector<Point<3> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
-void FEQ2<3>::get_face_support_points (const typename DoFHandler<3>::face_iterator &face,
- vector<Point<3> > &support_points) const {
+void FEQ2<3>::get_face_support_points (const DoFHandler<3>::face_iterator &face,
+ vector<Point<3> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
template <>
-void FEQ4<1>::get_support_points (const typename DoFHandler<1>::cell_iterator &cell,
- vector<Point<1> > &support_points) const {
+void FEQ4<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell,
+ vector<Point<1> > &support_points) const {
FiniteElement<1>::get_support_points (cell, support_points);
};
template <>
-void FEQ4<1>::get_face_support_points (const typename DoFHandler<1>::face_iterator &,
- vector<Point<1> > &) const {
+void FEQ4<1>::get_face_support_points (const DoFHandler<1>::face_iterator &,
+ vector<Point<1> > &) const {
Assert (false, ExcInternalError());
};
template <>
-void FEQ4<2>::get_support_points (const typename DoFHandler<2>::cell_iterator &cell,
- vector<Point<2> > &support_points) const {
+void FEQ4<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell,
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == total_dofs,
ExcWrongFieldDimension (support_points.size(), total_dofs));
template <>
-void FEQ4<2>::get_face_support_points (const typename DoFHandler<2>::face_iterator &face,
- vector<Point<2> > &support_points) const {
+void FEQ4<2>::get_face_support_points (const DoFHandler<2>::face_iterator &face,
+ vector<Point<2> > &support_points) const {
Assert (support_points.size() == dofs_per_face,
ExcWrongFieldDimension (support_points.size(), dofs_per_face));
FESystem<dim>::shape_value (const unsigned int i,
const Point<dim> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
pair<unsigned,unsigned> comp = system_to_component_index(i);
FESystem<dim>::shape_grad (const unsigned int i,
const Point<dim> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
pair<unsigned,unsigned> comp = system_to_component_index(i);
FESystem<dim>::shape_grad_grad (const unsigned int i,
const Point<dim> &p) const
{
- Assert((i<total_dofs), ExcInvalidIndex(i));
+ Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
pair<unsigned,unsigned> comp = system_to_component_index(i);
double FEValuesBase<dim>::shape_value (const unsigned int i,
const unsigned int j) const {
Assert (selected_dataset<shape_values.size(),
- ExcInvalidIndex (selected_dataset, shape_values.size()));
+ ExcIndexRange (selected_dataset, 0, shape_values.size()));
Assert (i<shape_values[selected_dataset].m(),
- ExcInvalidIndex (i, shape_values[selected_dataset].m()));
+ ExcIndexRange (i, 0, shape_values[selected_dataset].m()));
Assert (j<shape_values[selected_dataset].n(),
- ExcInvalidIndex (j, shape_values[selected_dataset].n()));
+ ExcIndexRange (j, 0, shape_values[selected_dataset].n()));
return shape_values[selected_dataset](i,j);
};
template <int dim>
const Point<dim> &
FEFaceValuesBase<dim>::normal_vector (const unsigned int i) const {
- Assert (i<normal_vectors.size(), ExcInvalidIndex(i, normal_vectors.size()));
+ Assert (i<normal_vectors.size(), ExcIndexRange(i, 0, normal_vectors.size()));
Assert (update_flags & update_normal_vectors,
ExcAccessToUninitializedField());
--- /dev/null
+/* $Id$ */
+
+#include <grid/geometry_info.h>
+
+
+// enable these lines for gcc2.95
+//
+//const unsigned int GeometryInfo<deal_II_dimension>::vertices_per_cell;
+//const unsigned int GeometryInfo<deal_II_dimension>::lines_per_cell;
+//const unsigned int GeometryInfo<deal_II_dimension>::quads_per_cell;
+//const unsigned int GeometryInfo<deal_II_dimension>::hexes_per_cell;
+//const unsigned int GeometryInfo<deal_II_dimension>::children_per_cell;
+
+
+
template <int dim>
int LineAccessor<dim>::vertex_index (const unsigned int i) const {
- Assert (i<2, ExcInvalidIndex(i,0,1));
+ Assert (i<2, ExcIndexRange(i,0,2));
return tria->levels[present_level]->lines.lines[present_index].vertex (i);
};
template <int dim>
int QuadAccessor<dim>::vertex_index (const unsigned int corner) const {
- Assert (corner<4, ExcInvalidIndex(corner,0,3));
+ Assert (corner<4, ExcIndexRange(corner,0,4));
const int corner_convention[4] = { 0,0,1,1 };
return line(corner)->vertex_index(corner_convention[corner]);
template <int dim>
int HexAccessor<dim>::vertex_index (const unsigned int corner) const {
- Assert (corner<8, ExcInvalidIndex(corner,0,7));
+ Assert (corner<8, ExcIndexRange(corner,0,8));
// get the corner indices by asking
// either the front or the back face
template <>
unsigned char CellAccessor<1>::material_id () const {
- Assert (used(),
- typename TriaSubstructAccessor<1>::ExcCellNotUsed());
+ Assert (used(), TriaSubstructAccessor<1>::ExcCellNotUsed());
return tria->levels[present_level]->lines.material_id[present_index];
};
template <>
void CellAccessor<1>::set_material_id (const unsigned char mat_id) const {
- Assert (used(),
- typename TriaSubstructAccessor<1>::ExcCellNotUsed());
+ Assert (used(), TriaSubstructAccessor<1>::ExcCellNotUsed());
tria->levels[present_level]->lines.material_id[present_index]
= mat_id;
};
template <>
unsigned char CellAccessor<2>::material_id () const {
- Assert (used(),
- typename TriaSubstructAccessor<2>::ExcCellNotUsed());
+ Assert (used(), TriaSubstructAccessor<2>::ExcCellNotUsed());
return tria->levels[present_level]->quads.material_id[present_index];
};
template <>
void CellAccessor<2>::set_material_id (const unsigned char mat_id) const {
- Assert (used(),
- typename TriaSubstructAccessor<2>::ExcCellNotUsed());
+ Assert (used(), TriaSubstructAccessor<2>::ExcCellNotUsed());
tria->levels[present_level]->quads.material_id[present_index]
= mat_id;
};
template <>
unsigned char CellAccessor<3>::material_id () const {
- Assert (used(),
- typename TriaSubstructAccessor<3>::ExcCellNotUsed());
+ Assert (used(), TriaSubstructAccessor<3>::ExcCellNotUsed());
return tria->levels[present_level]->hexes.material_id[present_index];
};
template <>
void CellAccessor<3>::set_material_id (const unsigned char mat_id) const {
- Assert (used(),
- typename TriaSubstructAccessor<3>::ExcCellNotUsed());
+ Assert (used(), TriaSubstructAccessor<3>::ExcCellNotUsed());
tria->levels[present_level]->hexes.material_id[present_index]
= mat_id;
};
bool CellAccessor<dim>::at_boundary (const unsigned int i) const {
Assert (used(), typename TriaSubstructAccessor<dim>::ExcCellNotUsed());
Assert (i<GeometryInfo<dim>::faces_per_cell,
- typename TriaSubstructAccessor<dim>::
- ExcInvalidIndex (i,0,GeometryInfo<dim>::faces_per_cell-1));
+ ExcIndexRange (i,0,GeometryInfo<dim>::faces_per_cell));
return (neighbor_index(i) == -1);
};
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFLineAccessor(tria,level,index,local_data) {};
+ DoFLineAccessor<dim,BaseClass>(tria,level,index,local_data) {};
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_line,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_line));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_line));
return mg_dof_handler->mg_levels[present_level]
->line_dofs[present_index*dof_handler->get_fe().dofs_per_line+i];
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_line,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_line));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_line));
mg_dof_handler->mg_levels[present_level]
->line_dofs[present_index*dof_handler->get_fe().dofs_per_line+i] = index;
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<2, ExcInvalidIndex (i,0,2));
+ Assert (vertex<2, ExcIndexRange (i,0,2));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
return (mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.get_index (present_level, i, dof_handler->get_fe().dofs_per_vertex));
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<2, ExcInvalidIndex (i,0,2));
+ Assert (vertex<2, ExcIndexRange (i,0,2));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.set_index (present_level, i, dof_handler->get_fe().dofs_per_vertex, index);
template <int dim, typename BaseClass>
void
MGDoFLineAccessor<dim,BaseClass>::copy_from (const MGDoFLineAccessor<dim,BaseClass> &a) {
- DoFLineAccessor::copy_from (a);
+ DoFLineAccessor<dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFQuadAccessor(tria,level,index,local_data) {};
+ DoFQuadAccessor<dim,BaseClass>(tria,level,index,local_data) {};
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_quad,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_quad));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_quad));
return mg_dof_handler->mg_levels[present_level]
->quad_dofs[present_index*dof_handler->get_fe().dofs_per_quad+i];
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_quad,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_quad));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_quad));
mg_dof_handler->mg_levels[present_level]
->quad_dofs[present_index*dof_handler->get_fe().dofs_per_quad+i] = index;
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<4, ExcInvalidIndex (i,0,4));
+ Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
return (mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.get_index (present_level, i, dof_handler->get_fe().dofs_per_vertex));
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<4, ExcInvalidIndex (i,0,4));
+ Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.set_index (present_level, i, dof_handler->get_fe().dofs_per_vertex, index);
template <int dim, typename BaseClass>
TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
MGDoFQuadAccessor<dim,BaseClass>::line (const unsigned int i) const {
- Assert (i<4, ExcInvalidIndex (i, 0, 4));
+ Assert (i<4, ExcIndexRange (i, 0, 4));
return TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
(
template <int dim, typename BaseClass>
void
MGDoFQuadAccessor<dim,BaseClass>::copy_from (const MGDoFQuadAccessor<dim,BaseClass> &a) {
- DoFQuadAccessor::copy_from (a);
+ DoFQuadAccessor<dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
const int index,
const AccessorData *local_data) :
MGDoFAccessor<dim> (local_data),
- DoFHexAccessor(tria,level,index,local_data) {};
+ DoFHexAccessor<dim,BaseClass>(tria,level,index,local_data) {};
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_hex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_hex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_hex));
return mg_dof_handler->mg_levels[present_level]
->hex_dofs[present_index*dof_handler->get_fe().dofs_per_hex+i];
// and enough room was reserved
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
Assert (i<dof_handler->get_fe().dofs_per_hex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_hex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_hex));
mg_dof_handler->mg_levels[present_level]
->hex_dofs[present_index*dof_handler->get_fe().dofs_per_hex+i] = index;
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<8, ExcInvalidIndex (i,0,8));
+ Assert (vertex<8, ExcIndexRange (i,0,8));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
return (mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.get_index (present_level, i, dof_handler->get_fe().dofs_per_vertex));
Assert (dof_handler != 0, ExcInvalidObject());
Assert (mg_dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (vertex<4, ExcInvalidIndex (i,0,4));
+ Assert (vertex<4, ExcIndexRange (i,0,4));
Assert (i<dof_handler->get_fe().dofs_per_vertex,
- ExcInvalidIndex (i, 0, dof_handler->get_fe().dofs_per_vertex));
+ ExcIndexRange (i, 0, dof_handler->get_fe().dofs_per_vertex));
mg_dof_handler->mg_vertex_dofs[vertex_index(vertex)]
.set_index (present_level, i, dof_handler->get_fe().dofs_per_vertex, index);
template <int dim, typename BaseClass>
TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
MGDoFHexAccessor<dim,BaseClass>::line (const unsigned int i) const {
- Assert (i<12, ExcInvalidIndex (i, 0, 12));
+ Assert (i<12, ExcIndexRange (i, 0, 12));
return TriaIterator<dim,MGDoFLineAccessor<dim,LineAccessor<dim> > >
(
template <int dim, typename BaseClass>
TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
MGDoFHexAccessor<dim,BaseClass>::quad (const unsigned int i) const {
- Assert (i<12, ExcInvalidIndex (i, 0, 6));
+ Assert (i<12, ExcIndexRange (i, 0, 6));
return TriaIterator<dim,MGDoFQuadAccessor<dim,QuadAccessor<dim> > >
(
template <int dim, typename BaseClass>
void
MGDoFHexAccessor<dim,BaseClass>::copy_from (const MGDoFHexAccessor<dim,BaseClass> &a) {
- DoFHexAccessor::copy_from (a);
+ DoFHexAccessor<dim,BaseClass>::copy_from (a);
set_mg_dof_handler (a.mg_dof_handler);
};
float cell_vector_min=cells.begin()->red;
float cell_vector_max=cell_vector_min;
- for(typename multiset<DataOut<2>::EpsCellData>::iterator c=cells.begin();
+ for(multiset<DataOut<2>::EpsCellData>::iterator c=cells.begin();
c!=cells.end(); ++c, ++cell_index)
{
for (unsigned int i=0; i<4; ++i)
double light_norm, normal_norm;
float color;
- for (typename multiset<DataOut<2>::EpsCellData>::iterator c=cells.begin();c!=cells.end();++c)
+ for (multiset<DataOut<2>::EpsCellData>::iterator c=cells.begin();c!=cells.end();++c)
{
EpsCellData cd(*c);
const double scale = 300 / (xmax-xmin > ymax-ymin ? xmax-xmin : ymax-ymin);
- for (typename multiset<DataOut<2>::EpsCellData>::iterator c=cells2.begin();
+ for (multiset<DataOut<2>::EpsCellData>::iterator c=cells2.begin();
c!=cells2.end(); ++c)
{
EpsCellData cd (*c);
// Now we are ready to output...
- for (typename multiset<DataOut<2>::EpsCellData>::iterator c=cells.begin();
+ for (multiset<DataOut<2>::EpsCellData>::iterator c=cells.begin();
c!=cells.end(); ++c)
{
if (cell_data_p || cell_shade_p)
case logarithmic:
min_value = *min_element(values[0].begin(),
values[0].end(),
+ // for gcc2.95
+// &Histogram::template logarithmic_less<number>);
+ // for egcs1.1.2
&logarithmic_less<number>);
max_value = *max_element(values[0].begin(),
values[0].end(),
+ // for gcc2.95
+// &Histogram::template logarithmic_less<number>);
+ // for egcs1.1.2
&logarithmic_less<number>);
for (unsigned int i=1; i<values.size(); ++i)
min_value = min (min_value,
*min_element(values[i].begin(),
values[i].end(),
+ // for gcc2.95
+// &Histogram::template logarithmic_less<number>);
+ // for egcs1.1.2
&logarithmic_less<number>),
+ // for gcc2.95
+// &Histogram::template logarithmic_less<number>);
+ // for egcs1.1.2
&logarithmic_less<number>);
max_value = max (max_value,
*max_element(values[i].begin(),
values[i].end(),
- &logarithmic_less<number>));
+ // for gcc2.95
+// &Histogram::template logarithmic_less<number>);
+ // for egcs1.1.2
+ &logarithmic_less<number>),
+ // for gcc2.95
+// &Histogram::template logarithmic_less<number>);
+ // for egcs1.1.2
+ &logarithmic_less<number>);
};
break;
n_q_points = fe_values.n_quadrature_points;
Assert (cell_matrix.n() == total_dofs,
- ExcWrongSize(cell_matrix.n(), total_dofs));
+ Equation<dim>::ExcWrongSize(cell_matrix.n(), total_dofs));
Assert (cell_matrix.m() == total_dofs,
- ExcWrongSize(cell_matrix.m(), total_dofs));
- Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
+ Equation<dim>::ExcWrongSize(cell_matrix.m(), total_dofs));
+ Assert (cell_matrix.all_zero(),
+ Equation<dim>::ExcObjectNotEmpty());
const FullMatrix<double> &values = fe_values.get_shape_values ();
const vector<double> &weights = fe_values.get_JxW_values ();
n_q_points = fe_values.n_quadrature_points;
Assert (cell_matrix.n() == total_dofs,
- ExcWrongSize(cell_matrix.n(), total_dofs));
+ Equation<dim>::ExcWrongSize(cell_matrix.n(), total_dofs));
Assert (cell_matrix.m() == total_dofs,
- ExcWrongSize(cell_matrix.m(), total_dofs));
+ Equation<dim>::ExcWrongSize(cell_matrix.m(), total_dofs));
Assert (rhs.size() == total_dofs,
- ExcWrongSize(rhs.size(), total_dofs));
- Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
- Assert (rhs.all_zero(), ExcObjectNotEmpty());
+ Equation<dim>::ExcWrongSize(rhs.size(), total_dofs));
+ Assert (cell_matrix.all_zero(),
+ Equation<dim>::ExcObjectNotEmpty());
+ Assert (rhs.all_zero(),
+ Equation<dim>::ExcObjectNotEmpty());
const FullMatrix<double> &values = fe_values.get_shape_values ();
const vector<double> &weights = fe_values.get_JxW_values ();
const unsigned int total_dofs = fe_values.total_dofs,
n_q_points = fe_values.n_quadrature_points;
- Assert (rhs.size() == total_dofs, ExcWrongSize(rhs.size(), total_dofs));
- Assert (rhs.all_zero(), ExcObjectNotEmpty());
+ Assert (rhs.size() == total_dofs,
+ Equation<dim>::ExcWrongSize(rhs.size(), total_dofs));
+ Assert (rhs.all_zero(),
+ Equation<dim>::ExcObjectNotEmpty());
const FullMatrix<double> &values = fe_values.get_shape_values ();
const vector<double> &weights = fe_values.get_JxW_values ();
n_q_points = fe_values.n_quadrature_points;
Assert (cell_matrix.n() == total_dofs,
- ExcWrongSize(cell_matrix.n(), total_dofs));
+ Equation<dim>::ExcWrongSize(cell_matrix.n(), total_dofs));
Assert (cell_matrix.m() == total_dofs,
- ExcWrongSize(cell_matrix.m(), total_dofs));
+ Equation<dim>::ExcWrongSize(cell_matrix.m(), total_dofs));
Assert (rhs.size() == total_dofs,
- ExcWrongSize(rhs.size(), total_dofs));
- Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
- Assert (rhs.all_zero(), ExcObjectNotEmpty());
+ Equation<dim>::ExcWrongSize(rhs.size(), total_dofs));
+ Assert (cell_matrix.all_zero(),
+ Equation<dim>::ExcObjectNotEmpty());
+ Assert (rhs.all_zero(),
+ Equation<dim>::ExcObjectNotEmpty());
const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
const FullMatrix<double> &values = fe_values.get_shape_values ();
n_q_points = fe_values.n_quadrature_points;
Assert (cell_matrix.n() == total_dofs,
- ExcWrongSize(cell_matrix.n(), total_dofs));
+ Equation<dim>::ExcWrongSize(cell_matrix.n(), total_dofs));
Assert (cell_matrix.m() == total_dofs,
- ExcWrongSize(cell_matrix.m(), total_dofs));
- Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
+ Equation<dim>::ExcWrongSize(cell_matrix.m(), total_dofs));
+ Assert (cell_matrix.all_zero(),
+ Equation<dim>::ExcObjectNotEmpty());
const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
const vector<double> &weights = fe_values.get_JxW_values ();
const unsigned int total_dofs = fe_values.total_dofs,
n_q_points = fe_values.n_quadrature_points;
- Assert (rhs.size() == total_dofs, ExcWrongSize(rhs.size(), total_dofs));
- Assert (rhs.all_zero(), ExcObjectNotEmpty());
+ Assert (rhs.size() == total_dofs,
+ Equation<dim>::ExcWrongSize(rhs.size(), total_dofs));
+ Assert (rhs.all_zero(),
+ Equation<dim>::ExcObjectNotEmpty());
const FullMatrix<double> &values = fe_values.get_shape_values ();
const vector<double> &weights = fe_values.get_JxW_values ();
* Solve the original problem
* $Ax=b$.
*/
- ReturnState solve (const Matrix &A,
- Vector &x,
- const Vector &b) = 0;
+ typename Solver<Matrix,Vector>::ReturnState solve (const Matrix &A,
+ Vector &x,
+ const Vector &b) = 0;
/**
* Solve the two problems
* $Ax=b1$ and $A^Tz=b2$ simultanously.
*/
- ReturnState solve (const Matrix &A,
- Vector &x,
- const Vector &b1,
- Vector &z,
- const Vector &b2) = 0;
+ typename Solver<Matrix,Vector>::ReturnState solve (const Matrix &A,
+ Vector &x,
+ const Vector &b1,
+ Vector &z,
+ const Vector &b2) = 0;
};
* Solve primal problem only.
*/
template<class Preconditioner>
- ReturnState solve (const Matrix &A,
- Vector &x,
- const Vector &b,
- const Preconditioner& precondition);
+ typename Solver<Matrix,Vector>::ReturnState solve (const Matrix &A,
+ Vector &x,
+ const Vector &b,
+ const Preconditioner& precondition);
protected:
/**
return state;
}
+
+
template<class Matrix, class Vector>
template<class Preconditioner>
-Solver<Matrix,Vector>::ReturnState
+typename Solver<Matrix,Vector>::ReturnState
SolverBicgstab<Matrix, Vector>::iterate(const Preconditioner& precondition)
{
SolverControl::State state = SolverControl::iterate;
* Solver method.
*/
template<class Preconditioner>
- ReturnState solve (const Matrix &A,
+ typename Solver<Matrix,Vector>::ReturnState
+ solve (const Matrix &A,
Vector &x,
const Vector &b,
const Preconditioner& precondition);
template<class Matrix, class Vector>
template<class Preconditioner>
-Solver<Matrix,Vector>::ReturnState
+typename Solver<Matrix,Vector>::ReturnState
SolverCG<Matrix,Vector>::solve (const Matrix &A,
- Vector &x,
- const Vector &b,
- const Preconditioner& precondition)
+ Vector &x,
+ const Vector &b,
+ const Preconditioner& precondition)
{
SolverControl::State conv=SolverControl::iterate;
* Solver method.
*/
template<class Preconditioner>
- ReturnState solve (const Matrix &A,
- Vector &x,
- const Vector &b,
- const Preconditioner& precondition);
+ typename Solver<Matrix,Vector>::ReturnState solve (const Matrix &A,
+ Vector &x,
+ const Vector &b,
+ const Preconditioner& precondition);
DeclException1 (ExcTooFewTmpVectors,
int,
template<class Matrix, class Vector>
template<class Preconditioner>
-Solver<Matrix,Vector>::ReturnState
+typename Solver<Matrix,Vector>::ReturnState
SolverGMRES<Matrix,Vector>::solve (const Matrix& A,
Vector & x,
const Vector& b,
* Solve $Ax=b$ for $x$.
*/
template<class Preconditioner>
- ReturnState solve (const Matrix &A,
- Vector &x,
- const Vector &b,
- const Preconditioner& precondition);
+ typename Solver<Matrix,Vector>::ReturnState solve (const Matrix &A,
+ Vector &x,
+ const Vector &b,
+ const Preconditioner& precondition);
/**
* Set the damping-coefficient.
template<class Matrix,class Vector>
template<class Preconditioner>
-Solver<Matrix,Vector>::ReturnState
+typename Solver<Matrix,Vector>::ReturnState
SolverRichardson<Matrix,Vector>::solve (const Matrix &A,
Vector &x,
const Vector &b,
*
*/
template<class Preconditioner>
- Solver<Matrix,Vector>::ReturnState solve(const Matrix &A,
- Vector &x,
- const Vector &b,
- const Preconditioner &precond) const;
+ typename Solver<Matrix,Vector>::ReturnState solve(const Matrix &A,
+ Vector &x,
+ const Vector &b,
+ const Preconditioner &precond) const;
/**
* Set the additional data. For more
template <class Matrix, class Vector>
template<class Preconditioner>
-Solver<Matrix,Vector>::ReturnState
+typename Solver<Matrix,Vector>::ReturnState
SolverSelector<Matrix, Vector>::solve(const Matrix &A,
Vector &x,
const Vector &b,
// make all other sparse matrices
// friends
- template <typename somenumber> friend class SparseMatrix<somenumber>;
-
+ template <typename somenumber> friend class SparseMatrix;
};