* Structure keeping the three color
* values in the RGB system.
*/
- struct RgbValues { float red, green, blue; };
+ struct RgbValues
+ {
+ float red;
+ float green;
+ float blue;
+ };
/**
* Definition of a function pointer
<< "Dimension " << arg1 << " not equal to " << arg2);
DeclException3 (ExcIndexRange, int, int, int,
<< "Index " << arg1 << " is not in ["
- << arg2 << "," << arg3 << ")");
+ << arg2 << "," << arg3 << "[");
};
* but egcs1.1.2 chokes on that so
* we need it presently.
*/
- static const unsigned int array_size = (dim>0 ? dim : 1);
+ static const unsigned int array_size = ((dim!=0) ? (dim) : 1);
/**
* Declare an array type which can
* to disallow the creation of such
* an object.
*/
- double values[dim>0 ? dim : 1];
+ double values[(dim!=0) ? (dim) : 1];
/**
* Help function for unroll.
/**
* Field of indices.
*/
- unsigned index[4];
+ unsigned int index[4];
public:
/**
* Constructor taking #rank# indices.
*/
- TensorIndex(unsigned i0, unsigned i1, unsigned i2, unsigned i3)
+ TensorIndex(unsigned int i0, unsigned int i1, unsigned int i2, unsigned int i3)
{
index[0] = i0;
index[1] = i1;
return index[n];
}
- DeclException1(ExcRank, unsigned,
+ DeclException1(ExcRank, unsigned int,
<< "Index " << arg1 << " higher than maximum 3");
};
/**
* Field of indices.
*/
- unsigned index[3];
+ unsigned int index[3];
public:
/**
* Constructor taking #rank# indices.
*/
- TensorIndex(unsigned i0, unsigned i1, unsigned i2)
+ TensorIndex(unsigned int i0, unsigned int i1, unsigned int i2)
{
index[0] = i0;
index[1] = i1;
* in #n#th component
*
*/
- unsigned operator () (unsigned n) const
+ unsigned int operator () (unsigned int n) const
{
Assert(n<3, ExcRank(n));
return index[n];
}
- DeclException1(ExcRank, unsigned,
+ DeclException1(ExcRank, unsigned int,
<< "Index " << arg1 << " higher than maximum 2");
};
/**
* Field of indices.
*/
- unsigned index[4];
+ unsigned int index[4];
public:
/**
* Constructor taking #rank# indices.
*/
- TensorIndex(unsigned i0, unsigned i1)
+ TensorIndex(unsigned int i0, unsigned int i1)
{
index[0] = i0;
index[1] = i1;
* Access operator returning index
* in #n#th component
*/
- unsigned operator () (unsigned n) const
+ unsigned int operator () (unsigned int n) const
{
Assert(n<2, ExcRank(n));
return index[n];
}
- DeclException1(ExcRank, unsigned,
+ DeclException1(ExcRank, unsigned int,
<< "Index " << arg1 << " higher than maximum 1");
};
/**
* Field of indices.
*/
- unsigned index[1];
+ unsigned int index[1];
public:
/**
* Constructor taking #rank# indices.
*/
- TensorIndex(unsigned i0)
+ TensorIndex(unsigned int i0)
{
index[0] = i0;
}
* Access operator returning index
* in #n#th component
*/
- unsigned operator () (unsigned n) const
+ unsigned int operator () (unsigned int n) const
{
Assert(n<1, ExcRank(n));
return index[n];
}
- DeclException1(ExcRank, unsigned,
+ DeclException1(ExcRank, unsigned int,
<< "Index " << arg1 << " higher than maximum 0");
};
template<int rank>
-inline unsigned
+inline unsigned int
TensorIndex<rank>::
-operator() (unsigned n) const
+operator() (unsigned int n) const
{
Assert(n<rank, ExcRank(n));
return index[n];
static void extract_dofs(const DoFHandler<dim>& dof,
const bit_vector& select,
bit_vector& selected_dofs);
+
+ /**
+ * Same as #extract_dofs# for multi-level.
+ */
+ template<int dim>
+ static void extract_level_dofs(unsigned int level,
+ const MGDoFHandler<dim>& dof,
+ const bit_vector& select,
+ bit_vector& selected_dofs);
};
/**
* Auxiliary vector.
*/
- mutable Vector<double> h1, h2;
+ mutable Vector<double> h1;
+ /**
+ * Auxiliary vector.
+ */
+ mutable Vector<double> h2;
};
inline
*/
class MGTransferPrebuilt : public MGTransferBase
{
- const MGSmoother& smoother;
public:
/**
* Preliminary constructor
*/
- MGTransferPrebuilt(const MGSmoother& smoother) :
- smoother(smoother)
+ MGTransferPrebuilt()
{}
/**
* Auxiliary vector.
*/
- mutable Vector<double> h1, h2;
+ mutable Vector<double> h1;
+ /**
+ * Auxiliary vector.
+ */
+ mutable Vector<double> h2;
};
inline
*/
class MGTransferPrebuilt : public MGTransferBase
{
- const MGSmoother& smoother;
public:
/**
* Preliminary constructor
*/
- MGTransferPrebuilt(const MGSmoother& smoother) :
- smoother(smoother)
+ MGTransferPrebuilt()
{}
// Copyright Guido Kanschat, 1999
#include <grid/dof.h>
+#include <grid/mg_dof.h>
#include <grid/dof_accessor.h>
+#include <grid/mg_dof_accessor.h>
#include <grid/tria_iterator.h>
#include <fe/fe.h>
#include <fe/fe_system.h>
}
}
+template<int dim>
+void
+DoFTools::extract_level_dofs(unsigned int level,
+ const MGDoFHandler<dim>& dof,
+ const bit_vector& local_select,
+ bit_vector& selected_dofs)
+{
+ const FiniteElement<dim>& fe = dof.get_fe();
+ Assert(local_select.size() == fe.n_components,
+ ExcDimensionMismatch(local_select.size(), fe.n_components));
+ Assert(selected_dofs.size() == dof.n_dofs(level),
+ ExcDimensionMismatch(selected_dofs.size(), dof.n_dofs(level)));
+
+ vector<int> indices(fe.total_dofs);
+
+ MGDoFHandler<dim>::cell_iterator c;
+ for (c = dof.begin(level) ; c != dof.end(level) ; ++ c)
+ {
+ c->get_mg_dof_indices(indices);
+ for (unsigned int i=0;i<fe.total_dofs;++i)
+ {
+ pair<unsigned int, unsigned int> comp
+ = fe.system_to_component_index(i);
+ selected_dofs[indices[i]] = local_select[comp.first];
+ }
+ }
+}
+
template void DoFTools::extract_dofs(const DoFHandler<deal_II_dimension>& dof,
const bit_vector& local_select,
bit_vector& selected_dofs);
+template void DoFTools::extract_level_dofs(unsigned int level,
+ const MGDoFHandler<deal_II_dimension>& dof,
+ const bit_vector& local_select,
+ bit_vector& selected_dofs);
//template DoFTools<deal_II_dimension>;
{
Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()),
ExcIndexRange (from_level, 1, prolongation_matrices.size()+1));
-// smoother.set_zero_interior_boundary(from_level, src);
prolongation_matrices[from_level-1].Tvmult_add (dst, src);
};
{
Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()),
ExcIndexRange (from_level, 1, prolongation_matrices.size()+1));
-// smoother.set_zero_interior_boundary(from_level, src);
prolongation_matrices[from_level-1].Tvmult_add (dst, src);
};
NAME [_a-zA-Z][_a-zA-Z0-9]*
INT [+-]?[0-9]+
WHITE [ \t\n\f\v]
+ID "$"Id[^\$]*
CLASS (class)|(struct)|(union)
ACCESS (public)|(protected)|(private)
OP \+|\-|\/|\||\^|(==)|(!=)|(<<)|(>>)|(->)|(\+\+)|(\-\-)
/* scan CVS id in file preamble */
-"$Id$]*"$" { cvs_id = string(yytext); }
-<LINECOMMENT>"$Id$]*"$" { cvs_id = string(yytext); }
-<COMMENT>"$Id$]*"$" { cvs_id = string(yytext); }
+{ID} { cvs_id = string(yytext); }
+<LINECOMMENT>{ID} { cvs_id = string(yytext); }
+<COMMENT>{ID} { cvs_id = string(yytext); }
/* Ignore function bodies */
%token TYPEDEF
%token ACCESS
%token IDENTIFIER
-%token FARG
%token CONST
%token STATIC
%token EXTERN
array_dimensions:
'[' ']' { $$ = string("[]"); }
- | '[' identifier ']' { $$ = string("[") + $2 + string("]"); }
+ | '[' expression ']' { $$ = string("[") + $2 + string("]"); }
| '[' INT ']' { $$ = string("[") + $2 + string("]"); }
| array_dimensions array_dimensions { $$ = $1 + $2; }
;
expression:
literal
| identifier
+ | '&' expression { $$ = string("&") + $2; }
| OP expression { $$ = $1 + $2; }
| expression OP expression { $$ = $1 + $2 + $3; }
+ | expression '?' expression ':' expression { $$ = string("Conditional"); }
| expression '*' expression { $$ = $1 + $2 + $3; }
| expression INT { $$ = $1 + $2; }
| identifier argument_declaration { $$ = $1 + $2; }
}
;
-deal_exception_arglist: /* empty */
- | deal_exception_arglist ',' deal_exception_arg
-;
-
-deal_exception_arg:
- vartype
- | deal_exception_output_declaration
- | literal
-;
-
-deal_exception_output_declaration: OP
- | expression
-/* | deal_exception_output_declaration vartype
- | deal_exception_output_declaration literal
- | deal_exception_output_declaration OP */
-;
%%