double d1 = 17.;
-void fill(AnyData& data)
+void fill(AnyData &data)
{
int i = 7;
data.add(i, " i 7");
data.add<double>(d1, " d 17.");
- data.add<double*>(&d1, " d* 17.");
- data.add<const double*>(&d1, "cd* 17.");
+ data.add<double *>(&d1, " d* 17.");
+ data.add<const double *>(&d1, "cd* 17.");
d1 = 18.;
}
-void extract(const AnyData& data)
+void extract(const AnyData &data)
{
// This set of tests with old functionality. Remove when deprecating
// index access
- for (unsigned int i=0;i<data.size();++i)
+ for (unsigned int i=0; i<data.size(); ++i)
deallog << i << '\t' << data.name(i) << std::endl;
deallog << data.name(0)
- << '\t' << data.entry<int>(0) << std::endl;
+ << '\t' << data.entry<int>(0) << std::endl;
deallog << data.name(1)
- << '\t' << data.entry<double>(1) << std::endl;
+ << '\t' << data.entry<double>(1) << std::endl;
deallog << data.name(2)
- << '\t' << *data.entry<double*>(2) << std::endl;
+ << '\t' << *data.entry<double *>(2) << std::endl;
deallog << data.name(3)
- << '\t' << *data.entry<const double*>(3) << std::endl;
+ << '\t' << *data.entry<const double *>(3) << std::endl;
// From here on keep after deprecation
int i1 = data.entry<int>(" i 7");
const int i2 = data.entry<const int>(" i 7");
double d = data.entry<double>(" d 17.");
- double* p2 = data.entry<double*>(" d* 17.");
- const double * p3 = data.entry<const double*>("cd* 17.");
-
+ double *p2 = data.entry<double *>(" d* 17.");
+ const double *p3 = data.entry<const double *>("cd* 17.");
+
deallog << i1 << std::endl
- << i2 << std::endl
- << d << std::endl
- << *p2 << std::endl
- << *p3 << std::endl;
+ << i2 << std::endl
+ << d << std::endl
+ << *p2 << std::endl
+ << *p3 << std::endl;
deallog << *data.try_read<double>(" d 17.") << std::endl;
deallog << "(nil)" << std::endl;
else
AssertThrow (false, ExcInternalError());
-
+
// try
// {
// double* p3a = data.entry<double*>("cd* 17.");
int main()
{
deal_II_exceptions::disable_abort_on_exception();
-
+
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
-
+
AnyData data;
fill(data);
extract(data);
void SquareRoot::residual (AnyData &out, const AnyData &in)
{
- Vector<double>& v = *out.entry<Vector<double>*>(0);
+ Vector<double> &v = *out.entry<Vector<double>*>(0);
//residuum = 0
v(0) = 0.;
const Vector<double> &x = *in.entry<const Vector<double>*>("Newton iterate");
void SquareRoot::solve (AnyData &out, const AnyData &in)
{
- Vector<double>& v = *out.entry<Vector<double>*>(0);
+ Vector<double> &v = *out.entry<Vector<double>*>(0);
v(0) = 0;
const Vector<double> &x = *in.entry<const Vector<double>*>("Newton iterate");
const Vector<double> &r = *in.entry<const Vector<double>*>("Newton residual");
solver.notify(Events::initial);
solver(outdata, indata);
deallog << "Result: " << value(0) << ' ' << value(1)
- << " Norm " << value.l2_norm() << std::endl;
+ << " Norm " << value.l2_norm() << std::endl;
}
void
Explicit::operator() (AnyData &out, const AnyData &in)
{
- const double* step = in.read_ptr<double>("Timestep");
-
+ const double *step = in.read_ptr<double>("Timestep");
+
if (this->notifications.test(Events::initial) || this->notifications.test(Events::new_timestep_size))
{
m.equ(-*step, *matrix);
void
Implicit::operator() (AnyData &out, const AnyData &in)
{
- const double * step = in.read_ptr<double>("Timestep");
-
+ const double *step = in.read_ptr<double>("Timestep");
+
if (this->notifications.test(Events::initial) || this->notifications.test(Events::new_timestep_size))
{
m.equ(*step, *matrix);
{
switch (Testing::rand()%4)
{
- /// If a randomly drawn
- /// number is 0 or 1 we
- /// cut x or y, resp.
+ /// If a randomly drawn
+ /// number is 0 or 1 we
+ /// cut x or y, resp.
case 0:
cell->set_refine_flag( RefinementCase<2>::cut_axis(0) );
break;
deallog << "\t3rd\t";
for (unsigned int d1=0; d1<dim; ++d1)
for (unsigned int d2=0; d2<dim; ++d2)
- for (unsigned int d3=0; d3<dim; ++d3)
- deallog << third1[k][d1][d2][d3] << '\t';
+ for (unsigned int d3=0; d3<dim; ++d3)
+ deallog << third1[k][d1][d2][d3] << '\t';
deallog << "\t4th\t";
for (unsigned int d1=0; d1<dim; ++d1)
for (unsigned int d2=0; d2<dim; ++d2)
- for (unsigned int d3=0; d3<dim; ++d3)
- for (unsigned int d4=0; d4<dim; ++d4)
- deallog << fourth1[k][d1][d2][d3][d4] << '\t';
+ for (unsigned int d3=0; d3<dim; ++d3)
+ for (unsigned int d4=0; d4<dim; ++d4)
+ deallog << fourth1[k][d1][d2][d3][d4] << '\t';
deallog << std::endl;
}
deallog << std::endl;
// make sure that we got here just fine but that there is nothing else
AssertThrow (in, ExcIO());
in >> i;
- AssertThrow (!in, ExcIO());
+ AssertThrow (!in, ExcIO());
}
// Compute the derivative of F: R^dim -> R^spacedim
// We construct the function F_i, i=[0,spacedim)
-// and we compute the first and second derivatives using
+// and we compute the first and second derivatives using
// Sacado
typedef typename Sacado::Fad::DFad<double> Sdouble;
typedef typename Sacado::Fad::DFad<Sdouble> SSdouble;
template<int dim, int spacedim>
-void test() {
+void test()
+{
Tensor<1,dim,SSdouble> x;
- for(unsigned int j=0; j<dim; ++j) {
- // This is for the first derivative
- Sdouble jv = numbers::PI*(j+1)/2.0;
- jv.diff(j, dim);
- // Now the second
- x[j] = jv;
- x[j].diff(j, dim);
- }
-
+ for (unsigned int j=0; j<dim; ++j)
+ {
+ // This is for the first derivative
+ Sdouble jv = numbers::PI*(j+1)/2.0;
+ jv.diff(j, dim);
+ // Now the second
+ x[j] = jv;
+ x[j].diff(j, dim);
+ }
+
Tensor<1,spacedim,SSdouble> F;
- for(unsigned int i=0; i<spacedim; ++i)
- for(unsigned int j=0; j<dim; ++j)
+ for (unsigned int i=0; i<spacedim; ++i)
+ for (unsigned int j=0; j<dim; ++j)
F[i] += std::sin(x[j]+numbers::PI*i/2);
DerivativeForm<1,dim,spacedim,Sdouble> dF;
- for(unsigned int i=0; i<spacedim; ++i)
- for(unsigned int j=0; j<dim; ++j)
+ for (unsigned int i=0; i<spacedim; ++i)
+ for (unsigned int j=0; j<dim; ++j)
dF[i][j] = F[i].dx(j);
DerivativeForm<2,dim,spacedim, double> ddF;
- for(unsigned int i=0; i<spacedim; ++i)
- for(unsigned int j=0; j<dim; ++j)
- for(unsigned int k=0; k<dim; ++k)
- ddF[i][j][k] = dF[i][j].dx(k);
-
+ for (unsigned int i=0; i<spacedim; ++i)
+ for (unsigned int j=0; j<dim; ++j)
+ for (unsigned int k=0; k<dim; ++k)
+ ddF[i][j][k] = dF[i][j].dx(k);
+
deallog << "dim = " << dim
- << ", spacedim = " << spacedim << std::endl;
+ << ", spacedim = " << spacedim << std::endl;
deallog << "x : " << x << std::endl;
- for(unsigned int i=0; i<spacedim; ++i)
+ for (unsigned int i=0; i<spacedim; ++i)
deallog << "F[" << i << "] : " << F[i] << std::endl;
- for(unsigned int i=0; i<spacedim; ++i)
+ for (unsigned int i=0; i<spacedim; ++i)
deallog << "dF[" << i << "] : " << dF[i] << std::endl;
- for(unsigned int i=0; i<spacedim; ++i)
+ for (unsigned int i=0; i<spacedim; ++i)
deallog << "ddF[" << i << "] : " << ddF[i] << std::endl;
}
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
std::vector<std::string> function(1);
std::map<std::string, double> constants;
double value = fp.value(Point<2>(2.0,2.5));
Assert(abs(1.0+2.0*2.5 - value) < 1e-10, ExcMessage("wrong value"));
-
+
std::vector<std::string> expressions;
expressions.push_back("sin(2*mypi*x)+y");
constants["mypi"] = numbers::PI;
fp.initialize("x,y", expressions, constants);
double value1 = fp.value(Point<2>(1.0,2.5), 0);
Assert(abs(2.5 - value1) < 1e-10, ExcMessage("wrong value"));
-
+
}
struct copy_data
{
- int value;
- copy_data():
- value(0)
- {}
-
+ int value;
+ copy_data():
+ value(0)
+ {}
+
};
double value = fp.value(Point<2>(s, 2.5));
Assert(abs(1.0+s*2.5 - value) < 1e-10, ExcMessage("wrong value"));
std::cout << data.value << std::endl;
-
+
data.value = (abs(1.0+s*2.5 - value) < 1e-10)?1:0;
}
-void copy(int & value, const copy_data &data)
+void copy(int &value, const copy_data &data)
{
value += data.value;
}
fp.initialize("s,t", "s*t+c", constants);
std::vector<int> v(10000);
- for (unsigned int i=0;i<v.size();++i)
+ for (unsigned int i=0; i<v.size(); ++i)
v[i] = i;
int result = 0;
std::string variables = "x,y";
std::string expression = "cos(x)+sqrt(y)";
std::map<std::string,double> constants;
-
+
// FunctionParser with 2 variables and 1 component:
FunctionParser<2> fp(1);
fp.initialize(variables,
- expression,
- constants);
+ expression,
+ constants);
// Point at which we want to evaluate the function
Point<2> point(0.0, 4.0);
// evaluate the expression at 'point':
double result = fp.value(point);
-
+
deallog << "Function '" << expression << "'"
- << " @ " << point
- << " is " << result << std::endl;
+ << " @ " << point
+ << " is " << result << std::endl;
}
// And populate it with the newly created objects.
vector_function.initialize(variables,
- expressions,
- constants);
+ expressions,
+ constants);
// Point at which we want to evaluate the function
Point<3> point(0.0, 1.0, 1.0);
// Output the evaluated function
deallog << "Function '" << expressions[0] << "," << expressions[1] << "'"
- << " @ " << point
- << " is " << result << std::endl;
- }
+ << " @ " << point
+ << " is " << result << std::endl;
+}
int main()
test1();
test2();
-
+
}
#include <deal.II/base/function_parser.h>
-void eval(const std::string & exp, const Point<2> & p, double expected)
+void eval(const std::string &exp, const Point<2> &p, double expected)
{
std::string variables = "x,y";
std::map<std::string,double> constants;
FunctionParser<2> fp(1);
fp.initialize(variables,
- exp,
- constants);
+ exp,
+ constants);
double result = fp.value(p);
deallog << "'" << exp << "' @ " << p << " is " << result
- << " ( expected " << expected << " )" << std::endl;
+ << " ( expected " << expected << " )" << std::endl;
if (fabs(result-expected)>1e-10)
deallog << "ERROR!" << std::endl;
-
-
-
+
+
+
}
eval("if(x<1.0 | y<1.0,0,y)",Point<2>(1.5,1.5), 1.5);
eval("if(x<1.0 | y<1.0,0,y)",Point<2>(1.5,0.5), 0.0);
eval("if(x<1.0 | y<1.0,0,y)",Point<2>(0.5,-2), 0.0);
-
+
eval("if(x<1.0 & y<1.0,0,y)",Point<2>(1.5,-2.0), -2.0);
double x,y;
y=3.1;
eval("atan2(x,y)",Point<2>(x,y), atan2(x,y));
- eval("if(x==1.0,0,y)",Point<2>(1.0,-2.0), 0.0);
+ eval("if(x==1.0,0,y)",Point<2>(1.0,-2.0), 0.0);
eval("if(x==1.0,0,y)",Point<2>(1.1,-2.0), -2.0);
eval("int(2.1)",Point<2>(1.1,-2.0), 2.0);
#include <deal.II/base/function_parser.h>
-void eval(const std::string & exp, const Point<2> & p, double expected)
+void eval(const std::string &exp, const Point<2> &p, double expected)
{
std::string variables = "x,y";
std::map<std::string,double> constants;
FunctionParser<2> fp(1);
fp.initialize(variables,
- exp,
- constants);
+ exp,
+ constants);
double result = fp.value(p);
deallog << "'" << exp << "' @ " << p << " is " << result
- << " ( expected " << expected << " )" << std::endl;
+ << " ( expected " << expected << " )" << std::endl;
if (fabs(result-expected)>1e-10)
deallog << "ERROR!" << std::endl;
}
eval("if (x<1.0 | y<1.0,0,y)",Point<2>(1.5,1.5), 1.5);
eval("if (x<1.0 | y<1.0,0,y)",Point<2>(1.5,0.5), 0.0);
eval("if (x<1.0 | y<1.0,0,y)",Point<2>(0.5,-2), 0.0);
-
+
eval("if (x<1.0 & y<1.0,0,y)",Point<2>(1.5,-2.0), -2.0);
double x,y;
y=3.1;
eval("atan2 (x,y)",Point<2>(x,y), atan2(x,y));
- eval("if (x==1.0,0,y)",Point<2>(1.0,-2.0), 0.0);
+ eval("if (x==1.0,0,y)",Point<2>(1.0,-2.0), 0.0);
eval("if (x==1.0,0,y)",Point<2>(1.1,-2.0), -2.0);
eval("int (2.1)",Point<2>(1.1,-2.0), 2.0);
{
names[i] = std::string("comp");
}
-
+
DataOutBase::DXFlags dxflags;
DataOutBase::GnuplotFlags gflags;
std::vector<std_cxx11::tuple<unsigned int, unsigned int, std::string> > vectors;
{
const double mu = 13;
const double sigma = 3;
-
+
unsigned int N = 1000000;
double sum = 0;
double sum_square = 0;
tg[1].join();
tg[2].join();
tg[3].join();
-
-
+
+
// the random number generator is thread-local, so we should get the
// same result every time
deallog << tg[0].return_value().first
- << ' '
- << tg[0].return_value().second
- << std::endl;
+ << ' '
+ << tg[0].return_value().second
+ << std::endl;
AssertThrow (tg[1].return_value() == tg[0].return_value(),
- ExcInternalError());
+ ExcInternalError());
AssertThrow (tg[2].return_value() == tg[0].return_value(),
- ExcInternalError());
+ ExcInternalError());
AssertThrow (tg[3].return_value() == tg[0].return_value(),
- ExcInternalError());
+ ExcInternalError());
}
template <int dim>
std::vector<types::global_dof_index> get_conflict_indices_cfem(
- typename DoFHandler<dim>::active_cell_iterator const &it)
+ typename DoFHandler<dim>::active_cell_iterator const &it)
{
std::vector<types::global_dof_index> local_dof_indices(it->get_fe().dofs_per_cell);
it->get_dof_indices(local_dof_indices);
// Create the coloring
typename DoFHandler<dim>::active_cell_iterator cell(dof_handler.begin_active());
std::vector<std::vector<typename DoFHandler<dim>::active_cell_iterator> > coloring(
- GraphColoring::make_graph_coloring(cell,dof_handler.end(),
- std_cxx11::function<std::vector<types::global_dof_index> (typename
- DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
+ GraphColoring::make_graph_coloring(cell,dof_handler.end(),
+ std_cxx11::function<std::vector<types::global_dof_index> (typename
+ DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
// Output the coloring
for (unsigned int color=0; color<coloring.size(); ++color)
- {
- deallog<<"Color: "<<color<<std::endl;
- for (unsigned int i=0; i<coloring[color].size(); ++i)
- for (unsigned int j=0; j<dim; ++j)
- deallog<<coloring[color][i]->center()[j]<<" ";
- deallog<<std::endl;
- }
+ {
+ deallog<<"Color: "<<color<<std::endl;
+ for (unsigned int i=0; i<coloring[color].size(); ++i)
+ for (unsigned int j=0; j<dim; ++j)
+ deallog<<coloring[color][i]->center()[j]<<" ";
+ deallog<<std::endl;
+ }
}
int main()
template <int dim>
std::vector<types::global_dof_index> get_conflict_indices_cfem(
- typename DoFHandler<dim>::active_cell_iterator const &it)
+ typename DoFHandler<dim>::active_cell_iterator const &it)
{
std::vector<types::global_dof_index> local_dof_indices(it->get_fe().dofs_per_cell);
it->get_dof_indices(local_dof_indices);
typename DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active();
for (; cell<dof_handler.end(); ++cell)
- {
- if ((cell->center()[0]==0.625) && (cell->center()[1]==0.625))
- cell->set_refine_flag();
- }
+ {
+ if ((cell->center()[0]==0.625) && (cell->center()[1]==0.625))
+ cell->set_refine_flag();
+ }
triangulation.execute_coarsening_and_refinement();
dof_handler.distribute_dofs(fe);
// Create the coloring
std::vector<std::vector<typename DoFHandler<dim>::active_cell_iterator> > coloring(
- GraphColoring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
- std_cxx11::function<std::vector<types::global_dof_index> (typename
- DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
+ GraphColoring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
+ std_cxx11::function<std::vector<types::global_dof_index> (typename
+ DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
// Output the coloring
for (unsigned int color=0; color<coloring.size(); ++color)
- {
- deallog<<"Color: "<<color<<std::endl;
- for (unsigned int i=0; i<coloring[color].size(); ++i)
- for (unsigned int j=0; j<dim; ++j)
- deallog<<coloring[color][i]->center()[j]<<" ";
- deallog<<std::endl;
- }
+ {
+ deallog<<"Color: "<<color<<std::endl;
+ for (unsigned int i=0; i<coloring[color].size(); ++i)
+ for (unsigned int j=0; j<dim; ++j)
+ deallog<<coloring[color][i]->center()[j]<<" ";
+ deallog<<std::endl;
+ }
}
int main()
template <int dim>
std::vector<types::global_dof_index> get_conflict_indices_cfem(
- typename hp::DoFHandler<dim>::active_cell_iterator const &it)
+ typename hp::DoFHandler<dim>::active_cell_iterator const &it)
{
std::vector<types::global_dof_index> local_dof_indices(it->get_fe().dofs_per_cell);
it->get_dof_indices(local_dof_indices);
// Create the coloring
std::vector<std::vector<typename hp::DoFHandler<dim>::active_cell_iterator> > coloring(
- GraphColoring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
- std_cxx11::function<std::vector<types::global_dof_index> (typename
- hp::DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
+ GraphColoring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
+ std_cxx11::function<std::vector<types::global_dof_index> (typename
+ hp::DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
// Output the coloring
for (unsigned int color=0; color<coloring.size(); ++color)
- {
- deallog<<"Color: "<<color<<std::endl;
- for (unsigned int i=0; i<coloring[color].size(); ++i)
- for (unsigned int j=0; j<dim; ++j)
- deallog<<coloring[color][i]->center()[j]<<" ";
- deallog<<std::endl;
- }
+ {
+ deallog<<"Color: "<<color<<std::endl;
+ for (unsigned int i=0; i<coloring[color].size(); ++i)
+ for (unsigned int j=0; j<dim; ++j)
+ deallog<<coloring[color][i]->center()[j]<<" ";
+ deallog<<std::endl;
+ }
}
int main()
template <int dim>
std::vector<types::global_dof_index> get_conflict_indices_cfem(
- typename DoFHandler<dim>::active_cell_iterator const &it)
+ typename DoFHandler<dim>::active_cell_iterator const &it)
{
std::vector<types::global_dof_index> local_dof_indices(it->get_fe().dofs_per_cell);
it->get_dof_indices(local_dof_indices);
typename DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active();
for (; cell<dof_handler.end(); ++cell)
- {
- if ((cell->center()[0]==0.625) && (cell->center()[1]==0.625))
- cell->set_refine_flag();
- }
+ {
+ if ((cell->center()[0]==0.625) && (cell->center()[1]==0.625))
+ cell->set_refine_flag();
+ }
triangulation.execute_coarsening_and_refinement();
dof_handler.distribute_dofs(fe);
// Create the coloring
std::vector<std::vector<typename DoFHandler<dim>::active_cell_iterator> > coloring(
- GraphColoring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
- std_cxx11::function<std::vector<types::global_dof_index> (typename
- DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
+ GraphColoring::make_graph_coloring(dof_handler.begin_active(),dof_handler.end(),
+ std_cxx11::function<std::vector<types::global_dof_index> (typename
+ DoFHandler<dim>::active_cell_iterator const &)> (&get_conflict_indices_cfem<dim>)));
// Check that a color does not contain a conflict index twice
for (unsigned int color=0; color<coloring.size(); ++color)
- {
- std::set<types::global_dof_index> color_set;
- for (unsigned int i=0; i<coloring[color].size(); ++i)
{
- std::vector<types::global_dof_index> dofs = get_conflict_indices_cfem<dim>(coloring[color][i]);
- for (unsigned int j=0; j<dofs.size(); ++j)
- {
- if (color_set.count(dofs[j])!=0)
- deallog<<"Error in color: "<<color<<std::endl;
- color_set.insert(dofs[j]);
- }
+ std::set<types::global_dof_index> color_set;
+ for (unsigned int i=0; i<coloring[color].size(); ++i)
+ {
+ std::vector<types::global_dof_index> dofs = get_conflict_indices_cfem<dim>(coloring[color][i]);
+ for (unsigned int j=0; j<dofs.size(); ++j)
+ {
+ if (color_set.count(dofs[j])!=0)
+ deallog<<"Error in color: "<<color<<std::endl;
+ color_set.insert(dofs[j]);
+ }
+ }
}
- }
deallog<<"OK"<<std::endl;
}
template <int dim>
std::vector<types::global_dof_index> get_conflict_indices_cfem(
- typename DoFHandler<dim>::active_cell_iterator const &it)
+ typename DoFHandler<dim>::active_cell_iterator const &it)
{
std::vector<types::global_dof_index> local_dof_indices(it->get_fe().dofs_per_cell);
it->get_dof_indices(local_dof_indices);
void check()
{
deallog << "dim=" << dim << std::endl;
-
+
// Create the Triangulation and the DoFHandler
Triangulation<dim> triangulation;
GridGenerator::hyper_cube(triangulation, -1, 1);
for (unsigned int l=0; l<11-2*dim; ++l)
{
typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active();
+ cell = dof_handler.begin_active();
for (; cell<dof_handler.end(); ++cell)
- if (cell->center().distance (Point<dim>()) < cell->diameter())
- cell->set_refine_flag();
+ if (cell->center().distance (Point<dim>()) < cell->diameter())
+ cell->set_refine_flag();
triangulation.execute_coarsening_and_refinement();
}
dof_handler.distribute_dofs(fe);
deallog << "Total number of cells = " << triangulation.n_active_cells()
- << std::endl;
-
+ << std::endl;
+
// Create the coloring
std::vector<std::vector<typename DoFHandler<dim>::active_cell_iterator> >
- coloring
+ coloring
= GraphColoring::make_graph_coloring(dof_handler.begin_active(),
- dof_handler.end(),
- std_cxx11::function<std::vector<types::global_dof_index>
- (typename DoFHandler<dim>::active_cell_iterator const &)>
- (&get_conflict_indices_cfem<dim>));
+ dof_handler.end(),
+ std_cxx11::function<std::vector<types::global_dof_index>
+ (typename DoFHandler<dim>::active_cell_iterator const &)>
+ (&get_conflict_indices_cfem<dim>));
for (unsigned int color=0; color<coloring.size(); ++color)
deallog << coloring[color].size() << std::endl;
// Assignment
{
- IndexSet::IntervalIterator it = index_set.begin_intervals();
- Assert(it->is_valid() || index_set.n_elements()==0, ExcInternalError());
- it = index_set.end_intervals();
- Assert(!it->is_valid(), ExcInternalError());
+ IndexSet::IntervalIterator it = index_set.begin_intervals();
+ Assert(it->is_valid() || index_set.n_elements()==0, ExcInternalError());
+ it = index_set.end_intervals();
+ Assert(!it->is_valid(), ExcInternalError());
}
// Construct empty iterator
{
- IndexSet::IntervalIterator it;
- Assert(!it->is_valid(), ExcInternalError());
- it = index_set.begin_intervals();
- Assert(it->is_valid() || index_set.n_elements()==0, ExcInternalError());
+ IndexSet::IntervalIterator it;
+ Assert(!it->is_valid(), ExcInternalError());
+ it = index_set.begin_intervals();
+ Assert(it->is_valid() || index_set.n_elements()==0, ExcInternalError());
}
}
Assert(is1 == is2, ExcInternalError());
deallog << is1.is_element(4) << " " << is2.is_element(4) << std::endl;
-
+
deallog << "OK" << std::endl;
std::remove ("a.idxset");
fedisableexcept(FE_INVALID);
#endif
-
+
check<double> ();
check<long double> ();
#if defined(DEAL_II_HAVE_FP_EXCEPTIONS)
fedisableexcept(FE_INVALID);
#endif
-
+
deallog << std::numeric_limits<double>::quiet_NaN() << std::endl;
deallog << std::numeric_limits<double>::signaling_NaN() << std::endl;
deallog << "\t3rd\t";
for (unsigned int d1=0; d1<dim; ++d1)
for (unsigned int d2=0; d2<dim; ++d2)
- for (unsigned int d3=0; d3<dim; ++d3)
- deallog << third[k][d1][d2][d3] << '\t';
+ for (unsigned int d3=0; d3<dim; ++d3)
+ deallog << third[k][d1][d2][d3] << '\t';
deallog << "\t4th\t";
for (unsigned int d1=0; d1<dim; ++d1)
for (unsigned int d2=0; d2<dim; ++d2)
- for (unsigned int d3=0; d3<dim; ++d3)
- for (unsigned int d4=0; d4<dim; ++d4)
- deallog << fourth[k][d1][d2][d3][d4] << '\t';
+ for (unsigned int d3=0; d3<dim; ++d3)
+ for (unsigned int d4=0; d4<dim; ++d4)
+ deallog << fourth[k][d1][d2][d3][d4] << '\t';
deallog << std::endl;
}
deallog << std::endl;
template<typename quadrature_type, unsigned short startn>
-void check_quadrature (double*);
-void check_GRC_right(double*);
+void check_quadrature (double *);
+void check_GRC_right(double *);
int main()
{
// this stores the exact values of \int_0^1 x^i/sqrt(x(1-x)) dx
static double exact_monomials[32];
-
+
exact_monomials[0] = 3.141592653589793;
exact_monomials[1] = 1.570796326794897;
exact_monomials[2] = 1.178097245096172;
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
deallog << std::setprecision(8);
-
+
deallog << "* 1d Gauss-Chebyshev" << std::endl;
check_quadrature<QGaussChebyshev<1>,1>(&exact_monomials[0]);
void check_quadrature(double *exact_monomials)
{
- for (unsigned int n=startn; n<18; ++n)
+ for (unsigned int n=startn; n<18; ++n)
{
- quadrature_type quadrature(n);
- const std::vector<Point<1> > &points =quadrature.get_points();
- const std::vector<double> &weights=quadrature.get_weights();
-
-
- for (unsigned int i=0; i<32; ++i)
- {
- long double quadrature_int=0;
- double err = 0;
-
- // Check the integral
- // x^i/sqrt(x(1-x))
- long double f=1.;
- for (unsigned int x=0; x<quadrature.size(); ++x)
- {
- f = std::pow(static_cast<long double>(points[x](0)), i*1.0L);
- quadrature_int+=f*static_cast<long double>(weights[x]);
- }
- err = std::fabs(quadrature_int-exact_monomials[i]);
- deallog << "Quadrature order " << n << ", polynomial of degree " << i << ": ";
-
- if (err < 1.e-15)
- deallog << "exact." << std::endl;
- else
- deallog << "error " << err << std::endl;
- }
+ quadrature_type quadrature(n);
+ const std::vector<Point<1> > &points =quadrature.get_points();
+ const std::vector<double> &weights=quadrature.get_weights();
+
+
+ for (unsigned int i=0; i<32; ++i)
+ {
+ long double quadrature_int=0;
+ double err = 0;
+
+ // Check the integral
+ // x^i/sqrt(x(1-x))
+ long double f=1.;
+ for (unsigned int x=0; x<quadrature.size(); ++x)
+ {
+ f = std::pow(static_cast<long double>(points[x](0)), i*1.0L);
+ quadrature_int+=f*static_cast<long double>(weights[x]);
+ }
+ err = std::fabs(quadrature_int-exact_monomials[i]);
+ deallog << "Quadrature order " << n << ", polynomial of degree " << i << ": ";
+
+ if (err < 1.e-15)
+ deallog << "exact." << std::endl;
+ else
+ deallog << "error " << err << std::endl;
+ }
}
}
for (unsigned int n=1; n<18; ++n)
{
- QGaussRadauChebyshev<1> quadrature(n,QGaussRadauChebyshev<1>::right);
- const std::vector<Point<1> > &points=quadrature.get_points();
- const std::vector<double> &weights=quadrature.get_weights();
+ QGaussRadauChebyshev<1> quadrature(n,QGaussRadauChebyshev<1>::right);
+ const std::vector<Point<1> > &points=quadrature.get_points();
+ const std::vector<double> &weights=quadrature.get_weights();
- for (unsigned int i=0; i<32; ++i)
- {
- long double quadrature_int=0;
- double err = 0;
+ for (unsigned int i=0; i<32; ++i)
+ {
+ long double quadrature_int=0;
+ double err = 0;
// Check the integral
// x^i/sqrt(x(1-x))
- long double f=1.;
- for (unsigned int x=0; x<quadrature.size(); ++x)
- {
- f = std::pow(static_cast<long double>(points[x](0)), i*1.0L);
- quadrature_int+=f*static_cast<long double>(weights[x]);
- }
- err = std::fabs(quadrature_int-exact_monomials[i]);
- deallog << "Quadrature order " << n << ", polynomial of degree " << i << ": ";
-
- if (err < 1.e-15)
- deallog << "exact." << std::endl;
- else
- deallog << "error " << err << std::endl;
- }
+ long double f=1.;
+ for (unsigned int x=0; x<quadrature.size(); ++x)
+ {
+ f = std::pow(static_cast<long double>(points[x](0)), i*1.0L);
+ quadrature_int+=f*static_cast<long double>(weights[x]);
+ }
+ err = std::fabs(quadrature_int-exact_monomials[i]);
+ deallog << "Quadrature order " << n << ", polynomial of degree " << i << ": ";
+
+ if (err < 1.e-15)
+ deallog << "exact." << std::endl;
+ else
+ deallog << "error " << err << std::endl;
+ }
}
}
template <int dim>
void
-check_quadratures (const std::vector<Quadrature<dim>*>& quadratures) {
- for(unsigned int i=0; i<quadratures.size(); ++i) {
- Quadrature<dim> &quad = *quadratures[i];
- bool check = true;
- for(unsigned int q=1; q<quad.size(); ++q)
- if(quad.weight(q) < quad.weight(q-1)) {
- check = false;
- break;
- }
- if(check == false) {
- deallog << "Something went wrong. The qudrature is not properly sorted." << std::endl;
- for(unsigned int q=1; q<quad.size(); ++q) {
- deallog << "q(" << q << "): " << quad.point(q)
- << ", w(" << q << "): " << quad.weight(q) << std::endl;
- }
+check_quadratures (const std::vector<Quadrature<dim>*> &quadratures)
+{
+ for (unsigned int i=0; i<quadratures.size(); ++i)
+ {
+ Quadrature<dim> &quad = *quadratures[i];
+ bool check = true;
+ for (unsigned int q=1; q<quad.size(); ++q)
+ if (quad.weight(q) < quad.weight(q-1))
+ {
+ check = false;
+ break;
+ }
+ if (check == false)
+ {
+ deallog << "Something went wrong. The qudrature is not properly sorted." << std::endl;
+ for (unsigned int q=1; q<quad.size(); ++q)
+ {
+ deallog << "q(" << q << "): " << quad.point(q)
+ << ", w(" << q << "): " << quad.weight(q) << std::endl;
+ }
+ }
}
- }
}
int main()
if (result != out)
{
deallog << "in='" << in
- << "' from='" << from
- << "' to='" << to
- << "' result='" << result
- << "' != '" << out << "'"
- << std::endl;
+ << "' from='" << from
+ << "' to='" << to
+ << "' result='" << result
+ << "' != '" << out << "'"
+ << std::endl;
}
}
// rank=1
{
deallog << "rank=1" << std::endl;
-
+
const double entries[] = { 1, 2, 3 };
Table<1,double> t (3);
// rank=2
{
deallog << "rank=2" << std::endl;
-
+
const double entries[] = { 1, 2, 3, 4, 5, 6 };
// create a 2x3 table from this
for (unsigned int i=0; i<t.size()[0]; ++i)
{
- for (unsigned int j=0; j<t.size()[1]; ++j)
- deallog << t[i][j] << ' ';
- deallog << std::endl;
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ deallog << t[i][j] << ' ';
+ deallog << std::endl;
}
// same data, same table, but filled in transpose ordering
for (unsigned int i=0; i<t.size()[0]; ++i)
{
- for (unsigned int j=0; j<t.size()[1]; ++j)
- deallog << t[i][j] << ' ';
- deallog << std::endl;
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ deallog << t[i][j] << ' ';
+ deallog << std::endl;
}
}
// rank=3
{
deallog << "rank=3" << std::endl;
-
+
const double entries[] = { 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12 };
+ 7, 8, 9, 10, 11, 12
+ };
// create a 2x3x2 table from this
Table<3,double> t (2,3,2);
for (unsigned int i=0; i<t.size()[0]; ++i)
{
- for (unsigned int j=0; j<t.size()[1]; ++j)
- {
- deallog << '(';
- for (unsigned int k=0; k<t.size()[2]; ++k)
- deallog << t[i][j][k] << ' ';
- deallog << ')';
- }
- deallog << std::endl;
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ {
+ deallog << '(';
+ for (unsigned int k=0; k<t.size()[2]; ++k)
+ deallog << t[i][j][k] << ' ';
+ deallog << ')';
+ }
+ deallog << std::endl;
}
// same data, same table, but filled in transpose ordering
for (unsigned int i=0; i<t.size()[0]; ++i)
{
- for (unsigned int j=0; j<t.size()[1]; ++j)
- {
- deallog << '(';
- for (unsigned int k=0; k<t.size()[2]; ++k)
- deallog << t[i][j][k] << ' ';
- deallog << ')';
- }
- deallog << std::endl;
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ {
+ deallog << '(';
+ for (unsigned int k=0; k<t.size()[2]; ++k)
+ deallog << t[i][j][k] << ' ';
+ deallog << ')';
+ }
+ deallog << std::endl;
}
}
}
Table<2,double> t (2,3);
std::istringstream in1(elements);
t.fill (std::istream_iterator<double>(in1),
- true);
+ true);
for (unsigned int i=0; i<t.size()[0]; ++i)
{
- for (unsigned int j=0; j<t.size()[1]; ++j)
- deallog << t[i][j] << ' ';
- deallog << std::endl;
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ deallog << t[i][j] << ' ';
+ deallog << std::endl;
}
// same data, same table, but filled in transpose ordering
std::istringstream in2(elements);
t.fill (std::istream_iterator<double>(in2),
- false);
+ false);
for (unsigned int i=0; i<t.size()[0]; ++i)
{
- for (unsigned int j=0; j<t.size()[1]; ++j)
- deallog << t[i][j] << ' ';
- deallog << std::endl;
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ deallog << t[i][j] << ' ';
+ deallog << std::endl;
}
}
}
// rank=1
{
deallog << "rank=1" << std::endl;
-
+
const double entries[] = { 1, 2, 3 };
{
Table<1,double> t (3, entries, true);
for (unsigned int i=0; i<t.size()[0]; ++i)
- deallog << t[i] << ' ';
+ deallog << t[i] << ' ';
deallog << std::endl;
}
-
+
// passing false as second argument shouldn't
// make a difference for rank-1 tables
{
Table<1,double> t (3, entries, false);
for (unsigned int i=0; i<t.size()[0]; ++i)
- deallog << t[i] << ' ';
+ deallog << t[i] << ' ';
deallog << std::endl;
}
}
// rank=2
{
deallog << "rank=2" << std::endl;
-
+
const double entries[] = { 1, 2, 3, 4, 5, 6 };
// create a 2x3 table from this
Table<2,double> t (2, 3, entries, true);
for (unsigned int i=0; i<t.size()[0]; ++i)
- {
- for (unsigned int j=0; j<t.size()[1]; ++j)
- deallog << t[i][j] << ' ';
- deallog << std::endl;
- }
+ {
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ deallog << t[i][j] << ' ';
+ deallog << std::endl;
+ }
}
-
+
// same data, same table, but filled in transpose ordering
{
Table<2,double> t (2, 3, entries, false);
for (unsigned int i=0; i<t.size()[0]; ++i)
- {
- for (unsigned int j=0; j<t.size()[1]; ++j)
- deallog << t[i][j] << ' ';
- deallog << std::endl;
- }
+ {
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ deallog << t[i][j] << ' ';
+ deallog << std::endl;
+ }
}
}
// rank=3
{
deallog << "rank=3" << std::endl;
-
+
const double entries[] = { 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12 };
+ 7, 8, 9, 10, 11, 12
+ };
// create a 2x3x2 table from this
{
Table<3,double> t (2,3,2, entries, true);
for (unsigned int i=0; i<t.size()[0]; ++i)
- {
- for (unsigned int j=0; j<t.size()[1]; ++j)
- {
- deallog << '(';
- for (unsigned int k=0; k<t.size()[2]; ++k)
- deallog << t[i][j][k] << ' ';
- deallog << ')';
- }
- deallog << std::endl;
- }
+ {
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ {
+ deallog << '(';
+ for (unsigned int k=0; k<t.size()[2]; ++k)
+ deallog << t[i][j][k] << ' ';
+ deallog << ')';
+ }
+ deallog << std::endl;
+ }
}
-
+
// same data, same table, but filled in transpose ordering
{
Table<3,double> t (2,3,2, entries, false);
for (unsigned int i=0; i<t.size()[0]; ++i)
- {
- for (unsigned int j=0; j<t.size()[1]; ++j)
- {
- deallog << '(';
- for (unsigned int k=0; k<t.size()[2]; ++k)
- deallog << t[i][j][k] << ' ';
- deallog << ')';
- }
- deallog << std::endl;
- }
+ {
+ for (unsigned int j=0; j<t.size()[1]; ++j)
+ {
+ deallog << '(';
+ for (unsigned int k=0; k<t.size()[2]; ++k)
+ deallog << t[i][j][k] << ' ';
+ deallog << ')';
+ }
+ deallog << std::endl;
+ }
}
}
}
// ---------------------------------------------------------------------
-// check that Table<{1,2,3},T>::reinit(TableIndices) work
+// check that Table<{1,2,3},T>::reinit(TableIndices) work
#include "../tests.h"
#include <cmath>
deallog.threshold_double(1.e-10);
const unsigned int n = testing_max_num_threads();
-
+
// if we have a machine with less than 5 cores fake the output:
if (MultithreadInfo::n_threads()<n)
{
}
// multiply on the right by a complex<double>
- const Tensor<1,dim,std::complex<double> > right =
+ const Tensor<1,dim,std::complex<double> > right =
t * std::complex<double> (1,2);
// multiply on the left by a complex<double>
- const Tensor<1,dim,std::complex<double> > left =
+ const Tensor<1,dim,std::complex<double> > left =
std::complex<double> (1,2) * t;
// they should yield the same result
Assert (left == right, ExcInternalError ());
deallog << "dim = " << dim << std::endl
- << left << " : " << right << std::endl;
+ << left << " : " << right << std::endl;
}
{
t[i] = std::complex<double> (i,1);
}
- const Tensor<1,dim,std::complex<double> > res =
+ const Tensor<1,dim,std::complex<double> > res =
t * std::complex<double> (1,2);
deallog << "dim = " << dim << ": " << res << std::endl;
{
t[i] = std::complex<double> (1,i);
}
- const Tensor<1,dim,std::complex<double> > res =
+ const Tensor<1,dim,std::complex<double> > res =
t * std::complex<double> (1,2);
deallog << "dim = " << dim << ": " << res << std::endl;
t = Threads::new_thread (&X::f, x);
AssertThrow (t.return_value() == 42,
- ExcInternalError());
+ ExcInternalError());
}
Threads::Thread<int> t;
t = Threads::new_thread (&X::f, x);
AssertThrow (t.return_value() == 10,
- ExcInternalError());
+ ExcInternalError());
}
{
Threads::Thread<int> t;
t = Threads::new_thread (&X::f, x);
AssertThrow (t.return_value() == 11,
- ExcInternalError());
+ ExcInternalError());
}
AssertThrow (counter == 12, ExcInternalError());
#include <fstream>
#include <iostream>
template <int> struct X {};
-struct U {
+struct U
+{
virtual ~U () {}
- X<0> foo_0 () {
+ X<0> foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_0 () {
+ static X<0> static_foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_0 () {
+ X<0> &ref_foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_0 () {
+ static X<0> &static_ref_foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_0 () {
+ static const X<0> &static_const_ref_foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_0 () {
+ X<0> foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_0 () {
+ static X<0> static_foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_0 () {
+ X<0> &ref_foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_0 () {
+ const X<0> &const_ref_foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_0 () {
+ const X<0> &const_ref_foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_0 () {
+ const X<0> &const_ref_foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_0_const ()const {
+ const X<0> &const_ref_foo_0_const ()const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_0_const ()const {
+ const X<0> &const_ref_foo_ref_0_const ()const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_0_const ()const {
+ const X<0> &const_ref_foo_const_ref_0_const ()const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_0 () {
+ virtual const X<0> &virtual_const_ref_foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_0 () {
+ virtual const X<0> &virtual_const_ref_foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_0 () {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_0_const ()const {
+ virtual const X<0> &virtual_const_ref_foo_0_const ()const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_0_const ()const {
+ virtual const X<0> &virtual_const_ref_foo_ref_0_const ()const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_0_const ()const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_0_const ()const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_0 () {
+ static X<0> &static_ref_foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_0 () {
+ static const X<0> &static_const_ref_foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_0 () {
+ X<0> foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_0 () {
+ static X<0> static_foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_0 () {
+ X<0> &ref_foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_0 () {
+ static X<0> &static_ref_foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_0 () {
+ static const X<0> &static_const_ref_foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_0_const () const {
+ X<0> foo_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_0_const () const {
+ X<0> &ref_foo_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_0_const () const {
+ X<0> foo_ref_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_0_const () const {
+ X<0> &ref_foo_ref_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_0_const () const {
+ X<0> foo_const_ref_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_0_const () const {
+ X<0> &ref_foo_const_ref_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_0_const () const {
+ virtual X<0> virtual_foo_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_0_const () const {
+ virtual X<0> &virtual_ref_foo_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_0_const () const {
+ virtual X<0> virtual_foo_ref_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_0_const () const {
+ virtual X<0> &virtual_ref_foo_ref_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_0_const () const {
+ virtual X<0> virtual_foo_const_ref_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_0_const () const {
+ virtual X<0> &virtual_ref_foo_const_ref_0_const () const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_0 () {
+ virtual X<0> virtual_foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_0 () {
+ virtual X<0> &virtual_ref_foo_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_0 () {
+ virtual X<0> virtual_foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_0 () {
+ virtual X<0> &virtual_ref_foo_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_0 () {
+ virtual X<0> virtual_foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_0 () {
+ virtual X<0> &virtual_ref_foo_const_ref_0 ()
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_1 (X<1>) {
+ X<0> foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_1 (X<1>) {
+ static X<0> static_foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_1 (X<1>) {
+ X<0> &ref_foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_1 (X<1>) {
+ static X<0> &static_ref_foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_1 (X<1>) {
+ static const X<0> &static_const_ref_foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_1 (X<1>&) {
+ X<0> foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_1 (X<1>&) {
+ static X<0> static_foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_1 (X<1>&) {
+ X<0> &ref_foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_1 (X<1>) {
+ const X<0> &const_ref_foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_1 (X<1>&) {
+ const X<0> &const_ref_foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_1 (X<1>&) {
+ const X<0> &const_ref_foo_const_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_1_const (X<1>)const {
+ const X<0> &const_ref_foo_1_const (X<1>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_1_const (X<1>&)const {
+ const X<0> &const_ref_foo_ref_1_const (X<1> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_1_const (X<1>&)const {
+ const X<0> &const_ref_foo_const_ref_1_const (X<1> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_1 (X<1>) {
+ virtual const X<0> &virtual_const_ref_foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_1 (X<1>&) {
+ virtual const X<0> &virtual_const_ref_foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_1 (X<1>&) {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_1_const (X<1>)const {
+ virtual const X<0> &virtual_const_ref_foo_1_const (X<1>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_1_const (X<1>&)const {
+ virtual const X<0> &virtual_const_ref_foo_ref_1_const (X<1> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_1_const (X<1>&)const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_1_const (X<1> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_1 (X<1>&) {
+ static X<0> &static_ref_foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_1 (X<1>&) {
+ static const X<0> &static_const_ref_foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_1 (const X<1>&) {
+ X<0> foo_const_ref_1 (const X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_1 (const X<1>&) {
+ static X<0> static_foo_const_ref_1 (const X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_1 (const X<1>&) {
+ X<0> &ref_foo_const_ref_1 (const X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_1 (const X<1>&) {
+ static X<0> &static_ref_foo_const_ref_1 (const X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_1 (const X<1>&) {
+ static const X<0> &static_const_ref_foo_const_ref_1 (const X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_1_const (X<1>) const {
+ X<0> foo_1_const (X<1>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_1_const (X<1>) const {
+ X<0> &ref_foo_1_const (X<1>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_1_const (X<1>&) const {
+ X<0> foo_ref_1_const (X<1> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_1_const (X<1>&) const {
+ X<0> &ref_foo_ref_1_const (X<1> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_1_const (const X<1>&) const {
+ X<0> foo_const_ref_1_const (const X<1> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_1_const (const X<1>&) const {
+ X<0> &ref_foo_const_ref_1_const (const X<1> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_1_const (X<1>) const {
+ virtual X<0> virtual_foo_1_const (X<1>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_1_const (X<1>) const {
+ virtual X<0> &virtual_ref_foo_1_const (X<1>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_1_const (X<1>&) const {
+ virtual X<0> virtual_foo_ref_1_const (X<1> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_1_const (X<1>&) const {
+ virtual X<0> &virtual_ref_foo_ref_1_const (X<1> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_1_const (const X<1>&) const {
+ virtual X<0> virtual_foo_const_ref_1_const (const X<1> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_1_const (const X<1>&) const {
+ virtual X<0> &virtual_ref_foo_const_ref_1_const (const X<1> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_1 (X<1>) {
+ virtual X<0> virtual_foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_1 (X<1>) {
+ virtual X<0> &virtual_ref_foo_1 (X<1>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_1 (X<1>&) {
+ virtual X<0> virtual_foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_1 (X<1>&) {
+ virtual X<0> &virtual_ref_foo_ref_1 (X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_1 (const X<1>&) {
+ virtual X<0> virtual_foo_const_ref_1 (const X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_1 (const X<1>&) {
+ virtual X<0> &virtual_ref_foo_const_ref_1 (const X<1> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_2 (X<1>,X<2>) {
+ X<0> foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_2 (X<1>,X<2>) {
+ static X<0> static_foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_2 (X<1>,X<2>) {
+ X<0> &ref_foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_2 (X<1>,X<2>) {
+ static X<0> &static_ref_foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_2 (X<1>,X<2>) {
+ static const X<0> &static_const_ref_foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_2 (X<1>&,X<2>&) {
+ X<0> foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_2 (X<1>&,X<2>&) {
+ static X<0> static_foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_2 (X<1>&,X<2>&) {
+ X<0> &ref_foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_2 (X<1>,X<2>) {
+ const X<0> &const_ref_foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_2 (X<1>&,X<2>&) {
+ const X<0> &const_ref_foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_2 (X<1>&,X<2>&) {
+ const X<0> &const_ref_foo_const_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_2_const (X<1>,X<2>)const {
+ const X<0> &const_ref_foo_2_const (X<1>,X<2>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_2_const (X<1>&,X<2>&)const {
+ const X<0> &const_ref_foo_ref_2_const (X<1> &,X<2> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_2_const (X<1>&,X<2>&)const {
+ const X<0> &const_ref_foo_const_ref_2_const (X<1> &,X<2> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_2 (X<1>,X<2>) {
+ virtual const X<0> &virtual_const_ref_foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_2 (X<1>&,X<2>&) {
+ virtual const X<0> &virtual_const_ref_foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_2 (X<1>&,X<2>&) {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_2_const (X<1>,X<2>)const {
+ virtual const X<0> &virtual_const_ref_foo_2_const (X<1>,X<2>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_2_const (X<1>&,X<2>&)const {
+ virtual const X<0> &virtual_const_ref_foo_ref_2_const (X<1> &,X<2> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_2_const (X<1>&,X<2>&)const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_2_const (X<1> &,X<2> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_2 (X<1>&,X<2>&) {
+ static X<0> &static_ref_foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_2 (X<1>&,X<2>&) {
+ static const X<0> &static_const_ref_foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_2 (const X<1>&,const X<2>&) {
+ X<0> foo_const_ref_2 (const X<1> &,const X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_2 (const X<1>&,const X<2>&) {
+ static X<0> static_foo_const_ref_2 (const X<1> &,const X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_2 (const X<1>&,const X<2>&) {
+ X<0> &ref_foo_const_ref_2 (const X<1> &,const X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_2 (const X<1>&,const X<2>&) {
+ static X<0> &static_ref_foo_const_ref_2 (const X<1> &,const X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_2 (const X<1>&,const X<2>&) {
+ static const X<0> &static_const_ref_foo_const_ref_2 (const X<1> &,const X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_2_const (X<1>,X<2>) const {
+ X<0> foo_2_const (X<1>,X<2>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_2_const (X<1>,X<2>) const {
+ X<0> &ref_foo_2_const (X<1>,X<2>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_2_const (X<1>&,X<2>&) const {
+ X<0> foo_ref_2_const (X<1> &,X<2> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_2_const (X<1>&,X<2>&) const {
+ X<0> &ref_foo_ref_2_const (X<1> &,X<2> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_2_const (const X<1>&,const X<2>&) const {
+ X<0> foo_const_ref_2_const (const X<1> &,const X<2> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_2_const (const X<1>&,const X<2>&) const {
+ X<0> &ref_foo_const_ref_2_const (const X<1> &,const X<2> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_2_const (X<1>,X<2>) const {
+ virtual X<0> virtual_foo_2_const (X<1>,X<2>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_2_const (X<1>,X<2>) const {
+ virtual X<0> &virtual_ref_foo_2_const (X<1>,X<2>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_2_const (X<1>&,X<2>&) const {
+ virtual X<0> virtual_foo_ref_2_const (X<1> &,X<2> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_2_const (X<1>&,X<2>&) const {
+ virtual X<0> &virtual_ref_foo_ref_2_const (X<1> &,X<2> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_2_const (const X<1>&,const X<2>&) const {
+ virtual X<0> virtual_foo_const_ref_2_const (const X<1> &,const X<2> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_2_const (const X<1>&,const X<2>&) const {
+ virtual X<0> &virtual_ref_foo_const_ref_2_const (const X<1> &,const X<2> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_2 (X<1>,X<2>) {
+ virtual X<0> virtual_foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_2 (X<1>,X<2>) {
+ virtual X<0> &virtual_ref_foo_2 (X<1>,X<2>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_2 (X<1>&,X<2>&) {
+ virtual X<0> virtual_foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_2 (X<1>&,X<2>&) {
+ virtual X<0> &virtual_ref_foo_ref_2 (X<1> &,X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_2 (const X<1>&,const X<2>&) {
+ virtual X<0> virtual_foo_const_ref_2 (const X<1> &,const X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_2 (const X<1>&,const X<2>&) {
+ virtual X<0> &virtual_ref_foo_const_ref_2 (const X<1> &,const X<2> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_3 (X<1>,X<2>,X<3>) {
+ X<0> foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_3 (X<1>,X<2>,X<3>) {
+ static X<0> static_foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_3 (X<1>,X<2>,X<3>) {
+ X<0> &ref_foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_3 (X<1>,X<2>,X<3>) {
+ static X<0> &static_ref_foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_3 (X<1>,X<2>,X<3>) {
+ static const X<0> &static_const_ref_foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ X<0> foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ static X<0> static_foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ X<0> &ref_foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_3 (X<1>,X<2>,X<3>) {
+ const X<0> &const_ref_foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ const X<0> &const_ref_foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_3 (X<1>&,X<2>&,X<3>&) {
+ const X<0> &const_ref_foo_const_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_3_const (X<1>,X<2>,X<3>)const {
+ const X<0> &const_ref_foo_3_const (X<1>,X<2>,X<3>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_3_const (X<1>&,X<2>&,X<3>&)const {
+ const X<0> &const_ref_foo_ref_3_const (X<1> &,X<2> &,X<3> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_3_const (X<1>&,X<2>&,X<3>&)const {
+ const X<0> &const_ref_foo_const_ref_3_const (X<1> &,X<2> &,X<3> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_3 (X<1>,X<2>,X<3>) {
+ virtual const X<0> &virtual_const_ref_foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ virtual const X<0> &virtual_const_ref_foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_3 (X<1>&,X<2>&,X<3>&) {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_3_const (X<1>,X<2>,X<3>)const {
+ virtual const X<0> &virtual_const_ref_foo_3_const (X<1>,X<2>,X<3>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_3_const (X<1>&,X<2>&,X<3>&)const {
+ virtual const X<0> &virtual_const_ref_foo_ref_3_const (X<1> &,X<2> &,X<3> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_3_const (X<1>&,X<2>&,X<3>&)const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_3_const (X<1> &,X<2> &,X<3> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ static X<0> &static_ref_foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ static const X<0> &static_const_ref_foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_3 (const X<1>&,const X<2>&,const X<3>&) {
+ X<0> foo_const_ref_3 (const X<1> &,const X<2> &,const X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_3 (const X<1>&,const X<2>&,const X<3>&) {
+ static X<0> static_foo_const_ref_3 (const X<1> &,const X<2> &,const X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_3 (const X<1>&,const X<2>&,const X<3>&) {
+ X<0> &ref_foo_const_ref_3 (const X<1> &,const X<2> &,const X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_3 (const X<1>&,const X<2>&,const X<3>&) {
+ static X<0> &static_ref_foo_const_ref_3 (const X<1> &,const X<2> &,const X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_3 (const X<1>&,const X<2>&,const X<3>&) {
+ static const X<0> &static_const_ref_foo_const_ref_3 (const X<1> &,const X<2> &,const X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_3_const (X<1>,X<2>,X<3>) const {
+ X<0> foo_3_const (X<1>,X<2>,X<3>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_3_const (X<1>,X<2>,X<3>) const {
+ X<0> &ref_foo_3_const (X<1>,X<2>,X<3>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_3_const (X<1>&,X<2>&,X<3>&) const {
+ X<0> foo_ref_3_const (X<1> &,X<2> &,X<3> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_3_const (X<1>&,X<2>&,X<3>&) const {
+ X<0> &ref_foo_ref_3_const (X<1> &,X<2> &,X<3> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_3_const (const X<1>&,const X<2>&,const X<3>&) const {
+ X<0> foo_const_ref_3_const (const X<1> &,const X<2> &,const X<3> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_3_const (const X<1>&,const X<2>&,const X<3>&) const {
+ X<0> &ref_foo_const_ref_3_const (const X<1> &,const X<2> &,const X<3> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_3_const (X<1>,X<2>,X<3>) const {
+ virtual X<0> virtual_foo_3_const (X<1>,X<2>,X<3>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_3_const (X<1>,X<2>,X<3>) const {
+ virtual X<0> &virtual_ref_foo_3_const (X<1>,X<2>,X<3>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_3_const (X<1>&,X<2>&,X<3>&) const {
+ virtual X<0> virtual_foo_ref_3_const (X<1> &,X<2> &,X<3> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_3_const (X<1>&,X<2>&,X<3>&) const {
+ virtual X<0> &virtual_ref_foo_ref_3_const (X<1> &,X<2> &,X<3> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_3_const (const X<1>&,const X<2>&,const X<3>&) const {
+ virtual X<0> virtual_foo_const_ref_3_const (const X<1> &,const X<2> &,const X<3> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_3_const (const X<1>&,const X<2>&,const X<3>&) const {
+ virtual X<0> &virtual_ref_foo_const_ref_3_const (const X<1> &,const X<2> &,const X<3> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_3 (X<1>,X<2>,X<3>) {
+ virtual X<0> virtual_foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_3 (X<1>,X<2>,X<3>) {
+ virtual X<0> &virtual_ref_foo_3 (X<1>,X<2>,X<3>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ virtual X<0> virtual_foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_3 (X<1>&,X<2>&,X<3>&) {
+ virtual X<0> &virtual_ref_foo_ref_3 (X<1> &,X<2> &,X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_3 (const X<1>&,const X<2>&,const X<3>&) {
+ virtual X<0> virtual_foo_const_ref_3 (const X<1> &,const X<2> &,const X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_3 (const X<1>&,const X<2>&,const X<3>&) {
+ virtual X<0> &virtual_ref_foo_const_ref_3 (const X<1> &,const X<2> &,const X<3> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ X<0> foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ static X<0> static_foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ X<0> &ref_foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ static X<0> &static_ref_foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ static const X<0> &static_const_ref_foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ X<0> foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ static X<0> static_foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ X<0> &ref_foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ const X<0> &const_ref_foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ const X<0> &const_ref_foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ const X<0> &const_ref_foo_const_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_4_const (X<1>,X<2>,X<3>,X<4>)const {
+ const X<0> &const_ref_foo_4_const (X<1>,X<2>,X<3>,X<4>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_4_const (X<1>&,X<2>&,X<3>&,X<4>&)const {
+ const X<0> &const_ref_foo_ref_4_const (X<1> &,X<2> &,X<3> &,X<4> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_4_const (X<1>&,X<2>&,X<3>&,X<4>&)const {
+ const X<0> &const_ref_foo_const_ref_4_const (X<1> &,X<2> &,X<3> &,X<4> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ virtual const X<0> &virtual_const_ref_foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ virtual const X<0> &virtual_const_ref_foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_4_const (X<1>,X<2>,X<3>,X<4>)const {
+ virtual const X<0> &virtual_const_ref_foo_4_const (X<1>,X<2>,X<3>,X<4>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_4_const (X<1>&,X<2>&,X<3>&,X<4>&)const {
+ virtual const X<0> &virtual_const_ref_foo_ref_4_const (X<1> &,X<2> &,X<3> &,X<4> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_4_const (X<1>&,X<2>&,X<3>&,X<4>&)const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_4_const (X<1> &,X<2> &,X<3> &,X<4> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ static X<0> &static_ref_foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ static const X<0> &static_const_ref_foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_4 (const X<1>&,const X<2>&,const X<3>&,const X<4>&) {
+ X<0> foo_const_ref_4 (const X<1> &,const X<2> &,const X<3> &,const X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_4 (const X<1>&,const X<2>&,const X<3>&,const X<4>&) {
+ static X<0> static_foo_const_ref_4 (const X<1> &,const X<2> &,const X<3> &,const X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_4 (const X<1>&,const X<2>&,const X<3>&,const X<4>&) {
+ X<0> &ref_foo_const_ref_4 (const X<1> &,const X<2> &,const X<3> &,const X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_4 (const X<1>&,const X<2>&,const X<3>&,const X<4>&) {
+ static X<0> &static_ref_foo_const_ref_4 (const X<1> &,const X<2> &,const X<3> &,const X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_4 (const X<1>&,const X<2>&,const X<3>&,const X<4>&) {
+ static const X<0> &static_const_ref_foo_const_ref_4 (const X<1> &,const X<2> &,const X<3> &,const X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_4_const (X<1>,X<2>,X<3>,X<4>) const {
+ X<0> foo_4_const (X<1>,X<2>,X<3>,X<4>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_4_const (X<1>,X<2>,X<3>,X<4>) const {
+ X<0> &ref_foo_4_const (X<1>,X<2>,X<3>,X<4>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_4_const (X<1>&,X<2>&,X<3>&,X<4>&) const {
+ X<0> foo_ref_4_const (X<1> &,X<2> &,X<3> &,X<4> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_4_const (X<1>&,X<2>&,X<3>&,X<4>&) const {
+ X<0> &ref_foo_ref_4_const (X<1> &,X<2> &,X<3> &,X<4> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_4_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&) const {
+ X<0> foo_const_ref_4_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_4_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&) const {
+ X<0> &ref_foo_const_ref_4_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_4_const (X<1>,X<2>,X<3>,X<4>) const {
+ virtual X<0> virtual_foo_4_const (X<1>,X<2>,X<3>,X<4>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_4_const (X<1>,X<2>,X<3>,X<4>) const {
+ virtual X<0> &virtual_ref_foo_4_const (X<1>,X<2>,X<3>,X<4>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_4_const (X<1>&,X<2>&,X<3>&,X<4>&) const {
+ virtual X<0> virtual_foo_ref_4_const (X<1> &,X<2> &,X<3> &,X<4> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_4_const (X<1>&,X<2>&,X<3>&,X<4>&) const {
+ virtual X<0> &virtual_ref_foo_ref_4_const (X<1> &,X<2> &,X<3> &,X<4> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_4_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&) const {
+ virtual X<0> virtual_foo_const_ref_4_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_4_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&) const {
+ virtual X<0> &virtual_ref_foo_const_ref_4_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ virtual X<0> virtual_foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_4 (X<1>,X<2>,X<3>,X<4>) {
+ virtual X<0> &virtual_ref_foo_4 (X<1>,X<2>,X<3>,X<4>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ virtual X<0> virtual_foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_4 (X<1>&,X<2>&,X<3>&,X<4>&) {
+ virtual X<0> &virtual_ref_foo_ref_4 (X<1> &,X<2> &,X<3> &,X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_4 (const X<1>&,const X<2>&,const X<3>&,const X<4>&) {
+ virtual X<0> virtual_foo_const_ref_4 (const X<1> &,const X<2> &,const X<3> &,const X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_4 (const X<1>&,const X<2>&,const X<3>&,const X<4>&) {
+ virtual X<0> &virtual_ref_foo_const_ref_4 (const X<1> &,const X<2> &,const X<3> &,const X<4> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ X<0> foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ static X<0> static_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ X<0> &ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ static X<0> &static_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ static const X<0> &static_const_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ X<0> foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ static X<0> static_foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ X<0> &ref_foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ const X<0> &const_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ const X<0> &const_ref_foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ const X<0> &const_ref_foo_const_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>)const {
+ const X<0> &const_ref_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_5_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&)const {
+ const X<0> &const_ref_foo_ref_5_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_5_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&)const {
+ const X<0> &const_ref_foo_const_ref_5_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ virtual const X<0> &virtual_const_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ virtual const X<0> &virtual_const_ref_foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>)const {
+ virtual const X<0> &virtual_const_ref_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_5_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&)const {
+ virtual const X<0> &virtual_const_ref_foo_ref_5_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_5_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&)const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_5_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ static X<0> &static_ref_foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ static const X<0> &static_const_ref_foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_5 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) {
+ X<0> foo_const_ref_5 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_5 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) {
+ static X<0> static_foo_const_ref_5 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_5 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) {
+ X<0> &ref_foo_const_ref_5 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_5 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) {
+ static X<0> &static_ref_foo_const_ref_5 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_5 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) {
+ static const X<0> &static_const_ref_foo_const_ref_5 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>) const {
+ X<0> foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>) const {
+ X<0> &ref_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_5_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) const {
+ X<0> foo_ref_5_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_5_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) const {
+ X<0> &ref_foo_ref_5_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_5_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) const {
+ X<0> foo_const_ref_5_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_5_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) const {
+ X<0> &ref_foo_const_ref_5_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>) const {
+ virtual X<0> virtual_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>) const {
+ virtual X<0> &virtual_ref_foo_5_const (X<1>,X<2>,X<3>,X<4>,X<5>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_5_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) const {
+ virtual X<0> virtual_foo_ref_5_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_5_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) const {
+ virtual X<0> &virtual_ref_foo_ref_5_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_5_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) const {
+ virtual X<0> virtual_foo_const_ref_5_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_5_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) const {
+ virtual X<0> &virtual_ref_foo_const_ref_5_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ virtual X<0> virtual_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>) {
+ virtual X<0> &virtual_ref_foo_5 (X<1>,X<2>,X<3>,X<4>,X<5>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ virtual X<0> virtual_foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_5 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&) {
+ virtual X<0> &virtual_ref_foo_ref_5 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_5 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) {
+ virtual X<0> virtual_foo_const_ref_5 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_5 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&) {
+ virtual X<0> &virtual_ref_foo_const_ref_5 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ X<0> foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ static X<0> static_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ X<0> &ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ static X<0> &static_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ static const X<0> &static_const_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ X<0> foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ static X<0> static_foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ X<0> &ref_foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ const X<0> &const_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ const X<0> &const_ref_foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ const X<0> &const_ref_foo_const_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)const {
+ const X<0> &const_ref_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_6_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&)const {
+ const X<0> &const_ref_foo_ref_6_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_6_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&)const {
+ const X<0> &const_ref_foo_const_ref_6_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ virtual const X<0> &virtual_const_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ virtual const X<0> &virtual_const_ref_foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)const {
+ virtual const X<0> &virtual_const_ref_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_6_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&)const {
+ virtual const X<0> &virtual_const_ref_foo_ref_6_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_6_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&)const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_6_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ static X<0> &static_ref_foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ static const X<0> &static_const_ref_foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_6 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) {
+ X<0> foo_const_ref_6 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_6 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) {
+ static X<0> static_foo_const_ref_6 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_6 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) {
+ X<0> &ref_foo_const_ref_6 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_6 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) {
+ static X<0> &static_ref_foo_const_ref_6 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_6 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) {
+ static const X<0> &static_const_ref_foo_const_ref_6 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) const {
+ X<0> foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) const {
+ X<0> &ref_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_6_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) const {
+ X<0> foo_ref_6_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_6_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) const {
+ X<0> &ref_foo_ref_6_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_6_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) const {
+ X<0> foo_const_ref_6_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_6_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) const {
+ X<0> &ref_foo_const_ref_6_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) const {
+ virtual X<0> virtual_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) const {
+ virtual X<0> &virtual_ref_foo_6_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_6_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) const {
+ virtual X<0> virtual_foo_ref_6_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_6_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) const {
+ virtual X<0> &virtual_ref_foo_ref_6_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_6_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) const {
+ virtual X<0> virtual_foo_const_ref_6_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_6_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) const {
+ virtual X<0> &virtual_ref_foo_const_ref_6_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ virtual X<0> virtual_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>) {
+ virtual X<0> &virtual_ref_foo_6 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ virtual X<0> virtual_foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_6 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&) {
+ virtual X<0> &virtual_ref_foo_ref_6 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_6 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) {
+ virtual X<0> virtual_foo_const_ref_6 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_6 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&) {
+ virtual X<0> &virtual_ref_foo_const_ref_6 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ X<0> foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ static X<0> static_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ X<0> &ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ static X<0> &static_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ static const X<0> &static_const_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ X<0> foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ static X<0> static_foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ X<0> &ref_foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ const X<0> &const_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ const X<0> &const_ref_foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ const X<0> &const_ref_foo_const_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)const {
+ const X<0> &const_ref_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_7_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&)const {
+ const X<0> &const_ref_foo_ref_7_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_7_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&)const {
+ const X<0> &const_ref_foo_const_ref_7_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ virtual const X<0> &virtual_const_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ virtual const X<0> &virtual_const_ref_foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)const {
+ virtual const X<0> &virtual_const_ref_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_7_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&)const {
+ virtual const X<0> &virtual_const_ref_foo_ref_7_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_7_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&)const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_7_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ static X<0> &static_ref_foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ static const X<0> &static_const_ref_foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_7 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) {
+ X<0> foo_const_ref_7 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_7 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) {
+ static X<0> static_foo_const_ref_7 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_7 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) {
+ X<0> &ref_foo_const_ref_7 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_7 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) {
+ static X<0> &static_ref_foo_const_ref_7 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_7 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) {
+ static const X<0> &static_const_ref_foo_const_ref_7 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) const {
+ X<0> foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) const {
+ X<0> &ref_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_7_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) const {
+ X<0> foo_ref_7_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_7_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) const {
+ X<0> &ref_foo_ref_7_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_7_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) const {
+ X<0> foo_const_ref_7_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_7_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) const {
+ X<0> &ref_foo_const_ref_7_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) const {
+ virtual X<0> virtual_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) const {
+ virtual X<0> &virtual_ref_foo_7_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_7_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) const {
+ virtual X<0> virtual_foo_ref_7_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_7_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) const {
+ virtual X<0> &virtual_ref_foo_ref_7_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_7_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) const {
+ virtual X<0> virtual_foo_const_ref_7_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_7_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) const {
+ virtual X<0> &virtual_ref_foo_const_ref_7_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ virtual X<0> virtual_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>) {
+ virtual X<0> &virtual_ref_foo_7 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ virtual X<0> virtual_foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_7 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&) {
+ virtual X<0> &virtual_ref_foo_ref_7 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_7 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) {
+ virtual X<0> virtual_foo_const_ref_7 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_7 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&) {
+ virtual X<0> &virtual_ref_foo_const_ref_7 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ X<0> foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ static X<0> static_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ X<0> &ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ static X<0> &static_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ static const X<0> &static_const_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ X<0> foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ static X<0> static_foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ X<0> &ref_foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ const X<0> &const_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ const X<0> &const_ref_foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ const X<0> &const_ref_foo_const_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)const {
+ const X<0> &const_ref_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_ref_8_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&)const {
+ const X<0> &const_ref_foo_ref_8_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- const X<0> & const_ref_foo_const_ref_8_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&)const {
+ const X<0> &const_ref_foo_const_ref_8_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ virtual const X<0> &virtual_const_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ virtual const X<0> &virtual_const_ref_foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)const {
+ virtual const X<0> &virtual_const_ref_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_ref_8_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&)const {
+ virtual const X<0> &virtual_const_ref_foo_ref_8_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual const X<0> & virtual_const_ref_foo_const_ref_8_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&)const {
+ virtual const X<0> &virtual_const_ref_foo_const_ref_8_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ static X<0> &static_ref_foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ static const X<0> &static_const_ref_foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_8 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) {
+ X<0> foo_const_ref_8 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> static_foo_const_ref_8 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) {
+ static X<0> static_foo_const_ref_8 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_8 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) {
+ X<0> &ref_foo_const_ref_8 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static X<0> & static_ref_foo_const_ref_8 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) {
+ static X<0> &static_ref_foo_const_ref_8 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- static const X<0> & static_const_ref_foo_const_ref_8 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) {
+ static const X<0> &static_const_ref_foo_const_ref_8 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) const {
+ X<0> foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) const {
+ X<0> &ref_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_ref_8_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) const {
+ X<0> foo_ref_8_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_ref_8_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) const {
+ X<0> &ref_foo_ref_8_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> foo_const_ref_8_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) const {
+ X<0> foo_const_ref_8_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- X<0> & ref_foo_const_ref_8_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) const {
+ X<0> &ref_foo_const_ref_8_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) const {
+ virtual X<0> virtual_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) const {
+ virtual X<0> &virtual_ref_foo_8_const (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_8_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) const {
+ virtual X<0> virtual_foo_ref_8_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_8_const (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) const {
+ virtual X<0> &virtual_ref_foo_ref_8_const (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_8_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) const {
+ virtual X<0> virtual_foo_const_ref_8_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_8_const (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) const {
+ virtual X<0> &virtual_ref_foo_const_ref_8_const (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &) const
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ virtual X<0> virtual_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>) {
+ virtual X<0> &virtual_ref_foo_8 (X<1>,X<2>,X<3>,X<4>,X<5>,X<6>,X<7>,X<8>)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ virtual X<0> virtual_foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_ref_8 (X<1>&,X<2>&,X<3>&,X<4>&,X<5>&,X<6>&,X<7>&,X<8>&) {
+ virtual X<0> &virtual_ref_foo_ref_8 (X<1> &,X<2> &,X<3> &,X<4> &,X<5> &,X<6> &,X<7> &,X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> virtual_foo_const_ref_8 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) {
+ virtual X<0> virtual_foo_const_ref_8 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
- virtual X<0> & virtual_ref_foo_const_ref_8 (const X<1>&,const X<2>&,const X<3>&,const X<4>&,const X<5>&,const X<6>&,const X<7>&,const X<8>&) {
+ virtual X<0> &virtual_ref_foo_const_ref_8 (const X<1> &,const X<2> &,const X<3> &,const X<4> &,const X<5> &,const X<6> &,const X<7> &,const X<8> &)
+ {
deallog << unify_pretty_function(__PRETTY_FUNCTION__) << std::endl;
- static X<0> x; return x;
+ static X<0> x;
+ return x;
}
};
-int main () {
+int main ()
+{
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
ThreadGroup<X<0>&> tgr;
ThreadGroup<const X<0>&> tgcr;
U u;
-X<1> x1;
-X<2> x2;
-X<3> x3;
-X<4> x4;
-X<5> x5;
-X<6> x6;
-X<7> x7;
-X<8> x8;
- tgr += new_thread (&U::ref_foo_0, u);
- tgr += new_thread (&U::ref_foo_0_const, u);
- tgr += new_thread (&U::ref_foo_const_ref_0, u);
- tgr += new_thread (&U::ref_foo_const_ref_0_const, u);
- tgr += new_thread (&U::ref_foo_ref_0, u);
- tgr += new_thread (&U::ref_foo_ref_0_const, u);
- tgcr += new_thread (&U::const_ref_foo_0, u);
- tgcr += new_thread (&U::const_ref_foo_0_const, u);
- tgcr += new_thread (&U::const_ref_foo_const_ref_0, u);
- tgcr += new_thread (&U::const_ref_foo_const_ref_0_const, u);
- tgcr += new_thread (&U::const_ref_foo_ref_0, u);
- tgcr += new_thread (&U::const_ref_foo_ref_0_const, u);
- tgcr += new_thread (&U::virtual_const_ref_foo_0, u);
- tgcr += new_thread (&U::virtual_const_ref_foo_0_const, u);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_0, u);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_0_const, u);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_0, u);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_0_const, u);
- tg += new_thread (&U::foo_0, u);
- tg += new_thread (&U::foo_0_const, u);
- tg += new_thread (&U::foo_const_ref_0, u);
- tg += new_thread (&U::foo_const_ref_0_const, u);
- tg += new_thread (&U::foo_ref_0, u);
- tg += new_thread (&U::foo_ref_0_const, u);
- tgr += new_thread (&U::virtual_ref_foo_0, u);
- tgr += new_thread (&U::virtual_ref_foo_0_const, u);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_0, u);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_0_const, u);
- tgr += new_thread (&U::virtual_ref_foo_ref_0, u);
- tgr += new_thread (&U::virtual_ref_foo_ref_0_const, u);
- tg += new_thread (&U::virtual_foo_0, u);
- tg += new_thread (&U::virtual_foo_0_const, u);
- tg += new_thread (&U::virtual_foo_const_ref_0, u);
- tg += new_thread (&U::virtual_foo_const_ref_0_const, u);
- tg += new_thread (&U::virtual_foo_ref_0, u);
- tg += new_thread (&U::virtual_foo_ref_0_const, u);
+ X<1> x1;
+ X<2> x2;
+ X<3> x3;
+ X<4> x4;
+ X<5> x5;
+ X<6> x6;
+ X<7> x7;
+ X<8> x8;
+ tgr += new_thread (&U::ref_foo_0, u);
+ tgr += new_thread (&U::ref_foo_0_const, u);
+ tgr += new_thread (&U::ref_foo_const_ref_0, u);
+ tgr += new_thread (&U::ref_foo_const_ref_0_const, u);
+ tgr += new_thread (&U::ref_foo_ref_0, u);
+ tgr += new_thread (&U::ref_foo_ref_0_const, u);
+ tgcr += new_thread (&U::const_ref_foo_0, u);
+ tgcr += new_thread (&U::const_ref_foo_0_const, u);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_0, u);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_0_const, u);
+ tgcr += new_thread (&U::const_ref_foo_ref_0, u);
+ tgcr += new_thread (&U::const_ref_foo_ref_0_const, u);
+ tgcr += new_thread (&U::virtual_const_ref_foo_0, u);
+ tgcr += new_thread (&U::virtual_const_ref_foo_0_const, u);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_0, u);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_0_const, u);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_0, u);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_0_const, u);
+ tg += new_thread (&U::foo_0, u);
+ tg += new_thread (&U::foo_0_const, u);
+ tg += new_thread (&U::foo_const_ref_0, u);
+ tg += new_thread (&U::foo_const_ref_0_const, u);
+ tg += new_thread (&U::foo_ref_0, u);
+ tg += new_thread (&U::foo_ref_0_const, u);
+ tgr += new_thread (&U::virtual_ref_foo_0, u);
+ tgr += new_thread (&U::virtual_ref_foo_0_const, u);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_0, u);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_0_const, u);
+ tgr += new_thread (&U::virtual_ref_foo_ref_0, u);
+ tgr += new_thread (&U::virtual_ref_foo_ref_0_const, u);
+ tg += new_thread (&U::virtual_foo_0, u);
+ tg += new_thread (&U::virtual_foo_0_const, u);
+ tg += new_thread (&U::virtual_foo_const_ref_0, u);
+ tg += new_thread (&U::virtual_foo_const_ref_0_const, u);
+ tg += new_thread (&U::virtual_foo_ref_0, u);
+ tg += new_thread (&U::virtual_foo_ref_0_const, u);
- tgr += new_thread (&U::static_ref_foo_0);
- tgr += new_thread (&U::static_ref_foo_const_ref_0);
- tgr += new_thread (&U::static_ref_foo_ref_0);
- tgcr += new_thread (&U::static_const_ref_foo_0);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_0);
- tgcr += new_thread (&U::static_const_ref_foo_ref_0);
- tg += new_thread (&U::static_foo_0);
- tg += new_thread (&U::static_foo_const_ref_0);
- tg += new_thread (&U::static_foo_ref_0);
- tgr += new_thread (&U::ref_foo_1, u, x1);
- tgr += new_thread (&U::ref_foo_1_const, u, x1);
- tgr += new_thread (&U::ref_foo_const_ref_1, u, x1);
- tgr += new_thread (&U::ref_foo_const_ref_1_const, u, x1);
- tgr += new_thread (&U::ref_foo_ref_1, u, x1);
- tgr += new_thread (&U::ref_foo_ref_1_const, u, x1);
- tgcr += new_thread (&U::const_ref_foo_1, u, x1);
- tgcr += new_thread (&U::const_ref_foo_1_const, u, x1);
- tgcr += new_thread (&U::const_ref_foo_const_ref_1, u, x1);
- tgcr += new_thread (&U::const_ref_foo_const_ref_1_const, u, x1);
- tgcr += new_thread (&U::const_ref_foo_ref_1, u, x1);
- tgcr += new_thread (&U::const_ref_foo_ref_1_const, u, x1);
- tgcr += new_thread (&U::virtual_const_ref_foo_1, u, x1);
- tgcr += new_thread (&U::virtual_const_ref_foo_1_const, u, x1);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_1, u, x1);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_1_const, u, x1);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_1, u, x1);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_1_const, u, x1);
- tg += new_thread (&U::foo_1, u, x1);
- tg += new_thread (&U::foo_1_const, u, x1);
- tg += new_thread (&U::foo_const_ref_1, u, x1);
- tg += new_thread (&U::foo_const_ref_1_const, u, x1);
- tg += new_thread (&U::foo_ref_1, u, x1);
- tg += new_thread (&U::foo_ref_1_const, u, x1);
- tgr += new_thread (&U::virtual_ref_foo_1, u, x1);
- tgr += new_thread (&U::virtual_ref_foo_1_const, u, x1);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_1, u, x1);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_1_const, u, x1);
- tgr += new_thread (&U::virtual_ref_foo_ref_1, u, x1);
- tgr += new_thread (&U::virtual_ref_foo_ref_1_const, u, x1);
- tg += new_thread (&U::virtual_foo_1, u, x1);
- tg += new_thread (&U::virtual_foo_1_const, u, x1);
- tg += new_thread (&U::virtual_foo_const_ref_1, u, x1);
- tg += new_thread (&U::virtual_foo_const_ref_1_const, u, x1);
- tg += new_thread (&U::virtual_foo_ref_1, u, x1);
- tg += new_thread (&U::virtual_foo_ref_1_const, u, x1);
+ tgr += new_thread (&U::static_ref_foo_0);
+ tgr += new_thread (&U::static_ref_foo_const_ref_0);
+ tgr += new_thread (&U::static_ref_foo_ref_0);
+ tgcr += new_thread (&U::static_const_ref_foo_0);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_0);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_0);
+ tg += new_thread (&U::static_foo_0);
+ tg += new_thread (&U::static_foo_const_ref_0);
+ tg += new_thread (&U::static_foo_ref_0);
+ tgr += new_thread (&U::ref_foo_1, u, x1);
+ tgr += new_thread (&U::ref_foo_1_const, u, x1);
+ tgr += new_thread (&U::ref_foo_const_ref_1, u, x1);
+ tgr += new_thread (&U::ref_foo_const_ref_1_const, u, x1);
+ tgr += new_thread (&U::ref_foo_ref_1, u, x1);
+ tgr += new_thread (&U::ref_foo_ref_1_const, u, x1);
+ tgcr += new_thread (&U::const_ref_foo_1, u, x1);
+ tgcr += new_thread (&U::const_ref_foo_1_const, u, x1);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_1, u, x1);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_1_const, u, x1);
+ tgcr += new_thread (&U::const_ref_foo_ref_1, u, x1);
+ tgcr += new_thread (&U::const_ref_foo_ref_1_const, u, x1);
+ tgcr += new_thread (&U::virtual_const_ref_foo_1, u, x1);
+ tgcr += new_thread (&U::virtual_const_ref_foo_1_const, u, x1);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_1, u, x1);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_1_const, u, x1);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_1, u, x1);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_1_const, u, x1);
+ tg += new_thread (&U::foo_1, u, x1);
+ tg += new_thread (&U::foo_1_const, u, x1);
+ tg += new_thread (&U::foo_const_ref_1, u, x1);
+ tg += new_thread (&U::foo_const_ref_1_const, u, x1);
+ tg += new_thread (&U::foo_ref_1, u, x1);
+ tg += new_thread (&U::foo_ref_1_const, u, x1);
+ tgr += new_thread (&U::virtual_ref_foo_1, u, x1);
+ tgr += new_thread (&U::virtual_ref_foo_1_const, u, x1);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_1, u, x1);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_1_const, u, x1);
+ tgr += new_thread (&U::virtual_ref_foo_ref_1, u, x1);
+ tgr += new_thread (&U::virtual_ref_foo_ref_1_const, u, x1);
+ tg += new_thread (&U::virtual_foo_1, u, x1);
+ tg += new_thread (&U::virtual_foo_1_const, u, x1);
+ tg += new_thread (&U::virtual_foo_const_ref_1, u, x1);
+ tg += new_thread (&U::virtual_foo_const_ref_1_const, u, x1);
+ tg += new_thread (&U::virtual_foo_ref_1, u, x1);
+ tg += new_thread (&U::virtual_foo_ref_1_const, u, x1);
- tgr += new_thread (&U::static_ref_foo_1,x1);
- tgr += new_thread (&U::static_ref_foo_const_ref_1,x1);
- tgr += new_thread (&U::static_ref_foo_ref_1,x1);
- tgcr += new_thread (&U::static_const_ref_foo_1,x1);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_1,x1);
- tgcr += new_thread (&U::static_const_ref_foo_ref_1,x1);
- tg += new_thread (&U::static_foo_1,x1);
- tg += new_thread (&U::static_foo_const_ref_1,x1);
- tg += new_thread (&U::static_foo_ref_1,x1);
- tgr += new_thread (&U::ref_foo_2, u, x1,x2);
- tgr += new_thread (&U::ref_foo_2_const, u, x1,x2);
- tgr += new_thread (&U::ref_foo_const_ref_2, u, x1,x2);
- tgr += new_thread (&U::ref_foo_const_ref_2_const, u, x1,x2);
- tgr += new_thread (&U::ref_foo_ref_2, u, x1,x2);
- tgr += new_thread (&U::ref_foo_ref_2_const, u, x1,x2);
- tgcr += new_thread (&U::const_ref_foo_2, u, x1,x2);
- tgcr += new_thread (&U::const_ref_foo_2_const, u, x1,x2);
- tgcr += new_thread (&U::const_ref_foo_const_ref_2, u, x1,x2);
- tgcr += new_thread (&U::const_ref_foo_const_ref_2_const, u, x1,x2);
- tgcr += new_thread (&U::const_ref_foo_ref_2, u, x1,x2);
- tgcr += new_thread (&U::const_ref_foo_ref_2_const, u, x1,x2);
- tgcr += new_thread (&U::virtual_const_ref_foo_2, u, x1,x2);
- tgcr += new_thread (&U::virtual_const_ref_foo_2_const, u, x1,x2);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_2, u, x1,x2);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_2_const, u, x1,x2);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_2, u, x1,x2);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_2_const, u, x1,x2);
- tg += new_thread (&U::foo_2, u, x1,x2);
- tg += new_thread (&U::foo_2_const, u, x1,x2);
- tg += new_thread (&U::foo_const_ref_2, u, x1,x2);
- tg += new_thread (&U::foo_const_ref_2_const, u, x1,x2);
- tg += new_thread (&U::foo_ref_2, u, x1,x2);
- tg += new_thread (&U::foo_ref_2_const, u, x1,x2);
- tgr += new_thread (&U::virtual_ref_foo_2, u, x1,x2);
- tgr += new_thread (&U::virtual_ref_foo_2_const, u, x1,x2);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_2, u, x1,x2);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_2_const, u, x1,x2);
- tgr += new_thread (&U::virtual_ref_foo_ref_2, u, x1,x2);
- tgr += new_thread (&U::virtual_ref_foo_ref_2_const, u, x1,x2);
- tg += new_thread (&U::virtual_foo_2, u, x1,x2);
- tg += new_thread (&U::virtual_foo_2_const, u, x1,x2);
- tg += new_thread (&U::virtual_foo_const_ref_2, u, x1,x2);
- tg += new_thread (&U::virtual_foo_const_ref_2_const, u, x1,x2);
- tg += new_thread (&U::virtual_foo_ref_2, u, x1,x2);
- tg += new_thread (&U::virtual_foo_ref_2_const, u, x1,x2);
+ tgr += new_thread (&U::static_ref_foo_1,x1);
+ tgr += new_thread (&U::static_ref_foo_const_ref_1,x1);
+ tgr += new_thread (&U::static_ref_foo_ref_1,x1);
+ tgcr += new_thread (&U::static_const_ref_foo_1,x1);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_1,x1);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_1,x1);
+ tg += new_thread (&U::static_foo_1,x1);
+ tg += new_thread (&U::static_foo_const_ref_1,x1);
+ tg += new_thread (&U::static_foo_ref_1,x1);
+ tgr += new_thread (&U::ref_foo_2, u, x1,x2);
+ tgr += new_thread (&U::ref_foo_2_const, u, x1,x2);
+ tgr += new_thread (&U::ref_foo_const_ref_2, u, x1,x2);
+ tgr += new_thread (&U::ref_foo_const_ref_2_const, u, x1,x2);
+ tgr += new_thread (&U::ref_foo_ref_2, u, x1,x2);
+ tgr += new_thread (&U::ref_foo_ref_2_const, u, x1,x2);
+ tgcr += new_thread (&U::const_ref_foo_2, u, x1,x2);
+ tgcr += new_thread (&U::const_ref_foo_2_const, u, x1,x2);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_2, u, x1,x2);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_2_const, u, x1,x2);
+ tgcr += new_thread (&U::const_ref_foo_ref_2, u, x1,x2);
+ tgcr += new_thread (&U::const_ref_foo_ref_2_const, u, x1,x2);
+ tgcr += new_thread (&U::virtual_const_ref_foo_2, u, x1,x2);
+ tgcr += new_thread (&U::virtual_const_ref_foo_2_const, u, x1,x2);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_2, u, x1,x2);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_2_const, u, x1,x2);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_2, u, x1,x2);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_2_const, u, x1,x2);
+ tg += new_thread (&U::foo_2, u, x1,x2);
+ tg += new_thread (&U::foo_2_const, u, x1,x2);
+ tg += new_thread (&U::foo_const_ref_2, u, x1,x2);
+ tg += new_thread (&U::foo_const_ref_2_const, u, x1,x2);
+ tg += new_thread (&U::foo_ref_2, u, x1,x2);
+ tg += new_thread (&U::foo_ref_2_const, u, x1,x2);
+ tgr += new_thread (&U::virtual_ref_foo_2, u, x1,x2);
+ tgr += new_thread (&U::virtual_ref_foo_2_const, u, x1,x2);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_2, u, x1,x2);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_2_const, u, x1,x2);
+ tgr += new_thread (&U::virtual_ref_foo_ref_2, u, x1,x2);
+ tgr += new_thread (&U::virtual_ref_foo_ref_2_const, u, x1,x2);
+ tg += new_thread (&U::virtual_foo_2, u, x1,x2);
+ tg += new_thread (&U::virtual_foo_2_const, u, x1,x2);
+ tg += new_thread (&U::virtual_foo_const_ref_2, u, x1,x2);
+ tg += new_thread (&U::virtual_foo_const_ref_2_const, u, x1,x2);
+ tg += new_thread (&U::virtual_foo_ref_2, u, x1,x2);
+ tg += new_thread (&U::virtual_foo_ref_2_const, u, x1,x2);
- tgr += new_thread (&U::static_ref_foo_2,x1,x2);
- tgr += new_thread (&U::static_ref_foo_const_ref_2,x1,x2);
- tgr += new_thread (&U::static_ref_foo_ref_2,x1,x2);
- tgcr += new_thread (&U::static_const_ref_foo_2,x1,x2);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_2,x1,x2);
- tgcr += new_thread (&U::static_const_ref_foo_ref_2,x1,x2);
- tg += new_thread (&U::static_foo_2,x1,x2);
- tg += new_thread (&U::static_foo_const_ref_2,x1,x2);
- tg += new_thread (&U::static_foo_ref_2,x1,x2);
- tgr += new_thread (&U::ref_foo_3, u, x1,x2,x3);
- tgr += new_thread (&U::ref_foo_3_const, u, x1,x2,x3);
- tgr += new_thread (&U::ref_foo_const_ref_3, u, x1,x2,x3);
- tgr += new_thread (&U::ref_foo_const_ref_3_const, u, x1,x2,x3);
- tgr += new_thread (&U::ref_foo_ref_3, u, x1,x2,x3);
- tgr += new_thread (&U::ref_foo_ref_3_const, u, x1,x2,x3);
- tgcr += new_thread (&U::const_ref_foo_3, u, x1,x2,x3);
- tgcr += new_thread (&U::const_ref_foo_3_const, u, x1,x2,x3);
- tgcr += new_thread (&U::const_ref_foo_const_ref_3, u, x1,x2,x3);
- tgcr += new_thread (&U::const_ref_foo_const_ref_3_const, u, x1,x2,x3);
- tgcr += new_thread (&U::const_ref_foo_ref_3, u, x1,x2,x3);
- tgcr += new_thread (&U::const_ref_foo_ref_3_const, u, x1,x2,x3);
- tgcr += new_thread (&U::virtual_const_ref_foo_3, u, x1,x2,x3);
- tgcr += new_thread (&U::virtual_const_ref_foo_3_const, u, x1,x2,x3);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_3, u, x1,x2,x3);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_3_const, u, x1,x2,x3);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_3, u, x1,x2,x3);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_3_const, u, x1,x2,x3);
- tg += new_thread (&U::foo_3, u, x1,x2,x3);
- tg += new_thread (&U::foo_3_const, u, x1,x2,x3);
- tg += new_thread (&U::foo_const_ref_3, u, x1,x2,x3);
- tg += new_thread (&U::foo_const_ref_3_const, u, x1,x2,x3);
- tg += new_thread (&U::foo_ref_3, u, x1,x2,x3);
- tg += new_thread (&U::foo_ref_3_const, u, x1,x2,x3);
- tgr += new_thread (&U::virtual_ref_foo_3, u, x1,x2,x3);
- tgr += new_thread (&U::virtual_ref_foo_3_const, u, x1,x2,x3);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_3, u, x1,x2,x3);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_3_const, u, x1,x2,x3);
- tgr += new_thread (&U::virtual_ref_foo_ref_3, u, x1,x2,x3);
- tgr += new_thread (&U::virtual_ref_foo_ref_3_const, u, x1,x2,x3);
- tg += new_thread (&U::virtual_foo_3, u, x1,x2,x3);
- tg += new_thread (&U::virtual_foo_3_const, u, x1,x2,x3);
- tg += new_thread (&U::virtual_foo_const_ref_3, u, x1,x2,x3);
- tg += new_thread (&U::virtual_foo_const_ref_3_const, u, x1,x2,x3);
- tg += new_thread (&U::virtual_foo_ref_3, u, x1,x2,x3);
- tg += new_thread (&U::virtual_foo_ref_3_const, u, x1,x2,x3);
+ tgr += new_thread (&U::static_ref_foo_2,x1,x2);
+ tgr += new_thread (&U::static_ref_foo_const_ref_2,x1,x2);
+ tgr += new_thread (&U::static_ref_foo_ref_2,x1,x2);
+ tgcr += new_thread (&U::static_const_ref_foo_2,x1,x2);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_2,x1,x2);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_2,x1,x2);
+ tg += new_thread (&U::static_foo_2,x1,x2);
+ tg += new_thread (&U::static_foo_const_ref_2,x1,x2);
+ tg += new_thread (&U::static_foo_ref_2,x1,x2);
+ tgr += new_thread (&U::ref_foo_3, u, x1,x2,x3);
+ tgr += new_thread (&U::ref_foo_3_const, u, x1,x2,x3);
+ tgr += new_thread (&U::ref_foo_const_ref_3, u, x1,x2,x3);
+ tgr += new_thread (&U::ref_foo_const_ref_3_const, u, x1,x2,x3);
+ tgr += new_thread (&U::ref_foo_ref_3, u, x1,x2,x3);
+ tgr += new_thread (&U::ref_foo_ref_3_const, u, x1,x2,x3);
+ tgcr += new_thread (&U::const_ref_foo_3, u, x1,x2,x3);
+ tgcr += new_thread (&U::const_ref_foo_3_const, u, x1,x2,x3);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_3, u, x1,x2,x3);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_3_const, u, x1,x2,x3);
+ tgcr += new_thread (&U::const_ref_foo_ref_3, u, x1,x2,x3);
+ tgcr += new_thread (&U::const_ref_foo_ref_3_const, u, x1,x2,x3);
+ tgcr += new_thread (&U::virtual_const_ref_foo_3, u, x1,x2,x3);
+ tgcr += new_thread (&U::virtual_const_ref_foo_3_const, u, x1,x2,x3);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_3, u, x1,x2,x3);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_3_const, u, x1,x2,x3);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_3, u, x1,x2,x3);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_3_const, u, x1,x2,x3);
+ tg += new_thread (&U::foo_3, u, x1,x2,x3);
+ tg += new_thread (&U::foo_3_const, u, x1,x2,x3);
+ tg += new_thread (&U::foo_const_ref_3, u, x1,x2,x3);
+ tg += new_thread (&U::foo_const_ref_3_const, u, x1,x2,x3);
+ tg += new_thread (&U::foo_ref_3, u, x1,x2,x3);
+ tg += new_thread (&U::foo_ref_3_const, u, x1,x2,x3);
+ tgr += new_thread (&U::virtual_ref_foo_3, u, x1,x2,x3);
+ tgr += new_thread (&U::virtual_ref_foo_3_const, u, x1,x2,x3);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_3, u, x1,x2,x3);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_3_const, u, x1,x2,x3);
+ tgr += new_thread (&U::virtual_ref_foo_ref_3, u, x1,x2,x3);
+ tgr += new_thread (&U::virtual_ref_foo_ref_3_const, u, x1,x2,x3);
+ tg += new_thread (&U::virtual_foo_3, u, x1,x2,x3);
+ tg += new_thread (&U::virtual_foo_3_const, u, x1,x2,x3);
+ tg += new_thread (&U::virtual_foo_const_ref_3, u, x1,x2,x3);
+ tg += new_thread (&U::virtual_foo_const_ref_3_const, u, x1,x2,x3);
+ tg += new_thread (&U::virtual_foo_ref_3, u, x1,x2,x3);
+ tg += new_thread (&U::virtual_foo_ref_3_const, u, x1,x2,x3);
- tgr += new_thread (&U::static_ref_foo_3,x1,x2,x3);
- tgr += new_thread (&U::static_ref_foo_const_ref_3,x1,x2,x3);
- tgr += new_thread (&U::static_ref_foo_ref_3,x1,x2,x3);
- tgcr += new_thread (&U::static_const_ref_foo_3,x1,x2,x3);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_3,x1,x2,x3);
- tgcr += new_thread (&U::static_const_ref_foo_ref_3,x1,x2,x3);
- tg += new_thread (&U::static_foo_3,x1,x2,x3);
- tg += new_thread (&U::static_foo_const_ref_3,x1,x2,x3);
- tg += new_thread (&U::static_foo_ref_3,x1,x2,x3);
- tgr += new_thread (&U::ref_foo_4, u, x1,x2,x3,x4);
- tgr += new_thread (&U::ref_foo_4_const, u, x1,x2,x3,x4);
- tgr += new_thread (&U::ref_foo_const_ref_4, u, x1,x2,x3,x4);
- tgr += new_thread (&U::ref_foo_const_ref_4_const, u, x1,x2,x3,x4);
- tgr += new_thread (&U::ref_foo_ref_4, u, x1,x2,x3,x4);
- tgr += new_thread (&U::ref_foo_ref_4_const, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::const_ref_foo_4, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::const_ref_foo_4_const, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::const_ref_foo_const_ref_4, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::const_ref_foo_const_ref_4_const, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::const_ref_foo_ref_4, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::const_ref_foo_ref_4_const, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::virtual_const_ref_foo_4, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::virtual_const_ref_foo_4_const, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_4, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_4_const, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_4, u, x1,x2,x3,x4);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_4_const, u, x1,x2,x3,x4);
- tg += new_thread (&U::foo_4, u, x1,x2,x3,x4);
- tg += new_thread (&U::foo_4_const, u, x1,x2,x3,x4);
- tg += new_thread (&U::foo_const_ref_4, u, x1,x2,x3,x4);
- tg += new_thread (&U::foo_const_ref_4_const, u, x1,x2,x3,x4);
- tg += new_thread (&U::foo_ref_4, u, x1,x2,x3,x4);
- tg += new_thread (&U::foo_ref_4_const, u, x1,x2,x3,x4);
- tgr += new_thread (&U::virtual_ref_foo_4, u, x1,x2,x3,x4);
- tgr += new_thread (&U::virtual_ref_foo_4_const, u, x1,x2,x3,x4);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_4, u, x1,x2,x3,x4);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_4_const, u, x1,x2,x3,x4);
- tgr += new_thread (&U::virtual_ref_foo_ref_4, u, x1,x2,x3,x4);
- tgr += new_thread (&U::virtual_ref_foo_ref_4_const, u, x1,x2,x3,x4);
- tg += new_thread (&U::virtual_foo_4, u, x1,x2,x3,x4);
- tg += new_thread (&U::virtual_foo_4_const, u, x1,x2,x3,x4);
- tg += new_thread (&U::virtual_foo_const_ref_4, u, x1,x2,x3,x4);
- tg += new_thread (&U::virtual_foo_const_ref_4_const, u, x1,x2,x3,x4);
- tg += new_thread (&U::virtual_foo_ref_4, u, x1,x2,x3,x4);
- tg += new_thread (&U::virtual_foo_ref_4_const, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::static_ref_foo_3,x1,x2,x3);
+ tgr += new_thread (&U::static_ref_foo_const_ref_3,x1,x2,x3);
+ tgr += new_thread (&U::static_ref_foo_ref_3,x1,x2,x3);
+ tgcr += new_thread (&U::static_const_ref_foo_3,x1,x2,x3);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_3,x1,x2,x3);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_3,x1,x2,x3);
+ tg += new_thread (&U::static_foo_3,x1,x2,x3);
+ tg += new_thread (&U::static_foo_const_ref_3,x1,x2,x3);
+ tg += new_thread (&U::static_foo_ref_3,x1,x2,x3);
+ tgr += new_thread (&U::ref_foo_4, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::ref_foo_4_const, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::ref_foo_const_ref_4, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::ref_foo_const_ref_4_const, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::ref_foo_ref_4, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::ref_foo_ref_4_const, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::const_ref_foo_4, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::const_ref_foo_4_const, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_4, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_4_const, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::const_ref_foo_ref_4, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::const_ref_foo_ref_4_const, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::virtual_const_ref_foo_4, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::virtual_const_ref_foo_4_const, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_4, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_4_const, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_4, u, x1,x2,x3,x4);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_4_const, u, x1,x2,x3,x4);
+ tg += new_thread (&U::foo_4, u, x1,x2,x3,x4);
+ tg += new_thread (&U::foo_4_const, u, x1,x2,x3,x4);
+ tg += new_thread (&U::foo_const_ref_4, u, x1,x2,x3,x4);
+ tg += new_thread (&U::foo_const_ref_4_const, u, x1,x2,x3,x4);
+ tg += new_thread (&U::foo_ref_4, u, x1,x2,x3,x4);
+ tg += new_thread (&U::foo_ref_4_const, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::virtual_ref_foo_4, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::virtual_ref_foo_4_const, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_4, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_4_const, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::virtual_ref_foo_ref_4, u, x1,x2,x3,x4);
+ tgr += new_thread (&U::virtual_ref_foo_ref_4_const, u, x1,x2,x3,x4);
+ tg += new_thread (&U::virtual_foo_4, u, x1,x2,x3,x4);
+ tg += new_thread (&U::virtual_foo_4_const, u, x1,x2,x3,x4);
+ tg += new_thread (&U::virtual_foo_const_ref_4, u, x1,x2,x3,x4);
+ tg += new_thread (&U::virtual_foo_const_ref_4_const, u, x1,x2,x3,x4);
+ tg += new_thread (&U::virtual_foo_ref_4, u, x1,x2,x3,x4);
+ tg += new_thread (&U::virtual_foo_ref_4_const, u, x1,x2,x3,x4);
- tgr += new_thread (&U::static_ref_foo_4,x1,x2,x3,x4);
- tgr += new_thread (&U::static_ref_foo_const_ref_4,x1,x2,x3,x4);
- tgr += new_thread (&U::static_ref_foo_ref_4,x1,x2,x3,x4);
- tgcr += new_thread (&U::static_const_ref_foo_4,x1,x2,x3,x4);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_4,x1,x2,x3,x4);
- tgcr += new_thread (&U::static_const_ref_foo_ref_4,x1,x2,x3,x4);
- tg += new_thread (&U::static_foo_4,x1,x2,x3,x4);
- tg += new_thread (&U::static_foo_const_ref_4,x1,x2,x3,x4);
- tg += new_thread (&U::static_foo_ref_4,x1,x2,x3,x4);
- tgr += new_thread (&U::ref_foo_5, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::ref_foo_5_const, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::ref_foo_const_ref_5, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::ref_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::ref_foo_ref_5, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::ref_foo_ref_5_const, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::const_ref_foo_5, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::const_ref_foo_5_const, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::const_ref_foo_const_ref_5, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::const_ref_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::const_ref_foo_ref_5, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::const_ref_foo_ref_5_const, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::virtual_const_ref_foo_5, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::virtual_const_ref_foo_5_const, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_5, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_5, u, x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_5_const, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::foo_5, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::foo_5_const, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::foo_const_ref_5, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::foo_ref_5, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::foo_ref_5_const, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::virtual_ref_foo_5, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::virtual_ref_foo_5_const, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_5, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::virtual_ref_foo_ref_5, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::virtual_ref_foo_ref_5_const, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::virtual_foo_5, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::virtual_foo_5_const, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::virtual_foo_const_ref_5, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::virtual_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::virtual_foo_ref_5, u, x1,x2,x3,x4,x5);
- tg += new_thread (&U::virtual_foo_ref_5_const, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::static_ref_foo_4,x1,x2,x3,x4);
+ tgr += new_thread (&U::static_ref_foo_const_ref_4,x1,x2,x3,x4);
+ tgr += new_thread (&U::static_ref_foo_ref_4,x1,x2,x3,x4);
+ tgcr += new_thread (&U::static_const_ref_foo_4,x1,x2,x3,x4);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_4,x1,x2,x3,x4);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_4,x1,x2,x3,x4);
+ tg += new_thread (&U::static_foo_4,x1,x2,x3,x4);
+ tg += new_thread (&U::static_foo_const_ref_4,x1,x2,x3,x4);
+ tg += new_thread (&U::static_foo_ref_4,x1,x2,x3,x4);
+ tgr += new_thread (&U::ref_foo_5, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::ref_foo_5_const, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::ref_foo_const_ref_5, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::ref_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::ref_foo_ref_5, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::ref_foo_ref_5_const, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::const_ref_foo_5, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::const_ref_foo_5_const, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_5, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::const_ref_foo_ref_5, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::const_ref_foo_ref_5_const, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::virtual_const_ref_foo_5, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::virtual_const_ref_foo_5_const, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_5, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_5, u, x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_5_const, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::foo_5, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::foo_5_const, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::foo_const_ref_5, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::foo_ref_5, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::foo_ref_5_const, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::virtual_ref_foo_5, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::virtual_ref_foo_5_const, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_5, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::virtual_ref_foo_ref_5, u, x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::virtual_ref_foo_ref_5_const, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::virtual_foo_5, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::virtual_foo_5_const, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::virtual_foo_const_ref_5, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::virtual_foo_const_ref_5_const, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::virtual_foo_ref_5, u, x1,x2,x3,x4,x5);
+ tg += new_thread (&U::virtual_foo_ref_5_const, u, x1,x2,x3,x4,x5);
- tgr += new_thread (&U::static_ref_foo_5,x1,x2,x3,x4,x5);
- tgr += new_thread (&U::static_ref_foo_const_ref_5,x1,x2,x3,x4,x5);
- tgr += new_thread (&U::static_ref_foo_ref_5,x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::static_const_ref_foo_5,x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_5,x1,x2,x3,x4,x5);
- tgcr += new_thread (&U::static_const_ref_foo_ref_5,x1,x2,x3,x4,x5);
- tg += new_thread (&U::static_foo_5,x1,x2,x3,x4,x5);
- tg += new_thread (&U::static_foo_const_ref_5,x1,x2,x3,x4,x5);
- tg += new_thread (&U::static_foo_ref_5,x1,x2,x3,x4,x5);
- tgr += new_thread (&U::ref_foo_6, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::ref_foo_6_const, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::ref_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::ref_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::ref_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::ref_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::const_ref_foo_6, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::const_ref_foo_6_const, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::const_ref_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::const_ref_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::const_ref_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::const_ref_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::virtual_const_ref_foo_6, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::virtual_const_ref_foo_6_const, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::foo_6, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::foo_6_const, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::foo_ref_6, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::virtual_ref_foo_6, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::virtual_ref_foo_6_const, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::virtual_ref_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::virtual_ref_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::virtual_foo_6, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::virtual_foo_6_const, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::virtual_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::virtual_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::virtual_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::virtual_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::static_ref_foo_5,x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::static_ref_foo_const_ref_5,x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::static_ref_foo_ref_5,x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::static_const_ref_foo_5,x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_5,x1,x2,x3,x4,x5);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_5,x1,x2,x3,x4,x5);
+ tg += new_thread (&U::static_foo_5,x1,x2,x3,x4,x5);
+ tg += new_thread (&U::static_foo_const_ref_5,x1,x2,x3,x4,x5);
+ tg += new_thread (&U::static_foo_ref_5,x1,x2,x3,x4,x5);
+ tgr += new_thread (&U::ref_foo_6, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::ref_foo_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::ref_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::ref_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::ref_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::ref_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::const_ref_foo_6, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::const_ref_foo_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::const_ref_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::const_ref_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::virtual_const_ref_foo_6, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::virtual_const_ref_foo_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::foo_6, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::foo_6_const, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::foo_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::virtual_ref_foo_6, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::virtual_ref_foo_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::virtual_ref_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::virtual_ref_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::virtual_foo_6, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::virtual_foo_6_const, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::virtual_foo_const_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::virtual_foo_const_ref_6_const, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::virtual_foo_ref_6, u, x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::virtual_foo_ref_6_const, u, x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::static_ref_foo_6,x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::static_ref_foo_const_ref_6,x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::static_ref_foo_ref_6,x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::static_const_ref_foo_6,x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_6,x1,x2,x3,x4,x5,x6);
- tgcr += new_thread (&U::static_const_ref_foo_ref_6,x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::static_foo_6,x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::static_foo_const_ref_6,x1,x2,x3,x4,x5,x6);
- tg += new_thread (&U::static_foo_ref_6,x1,x2,x3,x4,x5,x6);
- tgr += new_thread (&U::ref_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::ref_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::ref_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::ref_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::ref_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::ref_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::const_ref_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::const_ref_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::const_ref_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::const_ref_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::const_ref_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::const_ref_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::virtual_const_ref_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::virtual_const_ref_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::foo_7, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::virtual_ref_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::virtual_ref_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::virtual_ref_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::virtual_ref_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::virtual_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::virtual_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::virtual_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::virtual_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::virtual_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::virtual_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::static_ref_foo_6,x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::static_ref_foo_const_ref_6,x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::static_ref_foo_ref_6,x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::static_const_ref_foo_6,x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_6,x1,x2,x3,x4,x5,x6);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_6,x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::static_foo_6,x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::static_foo_const_ref_6,x1,x2,x3,x4,x5,x6);
+ tg += new_thread (&U::static_foo_ref_6,x1,x2,x3,x4,x5,x6);
+ tgr += new_thread (&U::ref_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::ref_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::ref_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::ref_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::ref_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::ref_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::const_ref_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::const_ref_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::const_ref_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::const_ref_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::virtual_const_ref_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::virtual_const_ref_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::foo_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::virtual_ref_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::virtual_ref_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::virtual_ref_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::virtual_ref_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::virtual_foo_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::virtual_foo_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::virtual_foo_const_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::virtual_foo_const_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::virtual_foo_ref_7, u, x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::virtual_foo_ref_7_const, u, x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::static_ref_foo_7,x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::static_ref_foo_const_ref_7,x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::static_ref_foo_ref_7,x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::static_const_ref_foo_7,x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_7,x1,x2,x3,x4,x5,x6,x7);
- tgcr += new_thread (&U::static_const_ref_foo_ref_7,x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::static_foo_7,x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::static_foo_const_ref_7,x1,x2,x3,x4,x5,x6,x7);
- tg += new_thread (&U::static_foo_ref_7,x1,x2,x3,x4,x5,x6,x7);
- tgr += new_thread (&U::ref_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::ref_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::ref_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::ref_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::ref_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::ref_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::const_ref_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::const_ref_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::const_ref_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::const_ref_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::const_ref_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::const_ref_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::virtual_const_ref_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::virtual_const_ref_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::virtual_const_ref_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::virtual_ref_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::virtual_ref_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::virtual_ref_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::virtual_ref_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::virtual_ref_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::virtual_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::virtual_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::virtual_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::virtual_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::virtual_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::virtual_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::static_ref_foo_7,x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::static_ref_foo_const_ref_7,x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::static_ref_foo_ref_7,x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::static_const_ref_foo_7,x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_7,x1,x2,x3,x4,x5,x6,x7);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_7,x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::static_foo_7,x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::static_foo_const_ref_7,x1,x2,x3,x4,x5,x6,x7);
+ tg += new_thread (&U::static_foo_ref_7,x1,x2,x3,x4,x5,x6,x7);
+ tgr += new_thread (&U::ref_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::ref_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::ref_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::ref_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::ref_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::ref_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::const_ref_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::const_ref_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::const_ref_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::const_ref_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::const_ref_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::virtual_const_ref_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::virtual_const_ref_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::virtual_const_ref_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::virtual_const_ref_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::virtual_ref_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::virtual_ref_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::virtual_ref_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::virtual_ref_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::virtual_ref_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::virtual_foo_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::virtual_foo_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::virtual_foo_const_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::virtual_foo_const_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::virtual_foo_ref_8, u, x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::virtual_foo_ref_8_const, u, x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::static_ref_foo_8,x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::static_ref_foo_const_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
- tgr += new_thread (&U::static_ref_foo_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::static_const_ref_foo_8,x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::static_const_ref_foo_const_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
- tgcr += new_thread (&U::static_const_ref_foo_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::static_foo_8,x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::static_foo_const_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
- tg += new_thread (&U::static_foo_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::static_ref_foo_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::static_ref_foo_const_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tgr += new_thread (&U::static_ref_foo_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::static_const_ref_foo_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::static_const_ref_foo_const_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tgcr += new_thread (&U::static_const_ref_foo_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::static_foo_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::static_foo_const_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
+ tg += new_thread (&U::static_foo_ref_8,x1,x2,x3,x4,x5,x6,x7,x8);
tg.join_all();
tgr.join_all();
tgcr.join_all();
#include <deal.II/lac/vector.h>
// test Runge-Kutta methods
-Vector<double> f1(double const t, Vector<double> const &y)
-{
+Vector<double> f1(double const t, Vector<double> const &y)
+{
Vector<double> values(y);
for (unsigned int i=0; i<values.size(); ++i)
values[i] = 1.0;
return values;
}
-Vector<double> f2(double const t, Vector<double> const &y)
-{
+Vector<double> f2(double const t, Vector<double> const &y)
+{
Vector<double> values(y);
for (unsigned int i=0; i<values.size(); ++i)
values[i] = 2.0*t;
- return values;
+ return values;
}
-Vector<double> f3(double const t, Vector<double> const &y)
-{
+Vector<double> f3(double const t, Vector<double> const &y)
+{
Vector<double> values(y);
for (unsigned int i=0; i<values.size(); ++i)
values[i] = 3.0*t*t;
- return values;
+ return values;
}
-Vector<double> f4(double const t, Vector<double> const &y)
-{
+Vector<double> f4(double const t, Vector<double> const &y)
+{
Vector<double> values(y);
for (unsigned int i=0; i<values.size(); ++i)
values[i] = 4.0*t*t*t;
-
- return values;
+
+ return values;
}
-Vector<double> f5(double const t, Vector<double> const &y)
+Vector<double> f5(double const t, Vector<double> const &y)
{
Vector<double> values(y);
for (unsigned int i=0; i<values.size(); ++i)
values[i] = 5.0*t*t*t*t;
-
- return values;
+
+ return values;
}
-Vector<double> id_minus_tau_J_inv1(double const t, double const tau, Vector<double> const &y)
+Vector<double> id_minus_tau_J_inv1(double const t, double const tau, Vector<double> const &y)
{
return y;
}
-Vector<double> id_minus_tau_J_inv2(double const t, double const tau, Vector<double> const &y)
+Vector<double> id_minus_tau_J_inv2(double const t, double const tau, Vector<double> const &y)
{
return y;
}
-Vector<double> id_minus_tau_J_inv3(double const t, double const tau, Vector<double> const &y)
+Vector<double> id_minus_tau_J_inv3(double const t, double const tau, Vector<double> const &y)
{
return y;
}
-Vector<double> id_minus_tau_J_inv4(double const t, double const tau, Vector<double> const &y)
+Vector<double> id_minus_tau_J_inv4(double const t, double const tau, Vector<double> const &y)
{
return y;
}
-Vector<double> id_minus_tau_J_inv5(double const t, double const tau, Vector<double> const &y)
+Vector<double> id_minus_tau_J_inv5(double const t, double const tau, Vector<double> const &y)
{
return y;
}
-double my1(double const t)
-{
- return t;
+double my1(double const t)
+{
+ return t;
}
-double my2(double const t)
-{
- return t*t;
+double my2(double const t)
+{
+ return t*t;
}
-double my3(double const t)
-{
- return t*t*t;
+double my3(double const t)
+{
+ return t*t*t;
}
-double my4(double const t)
-{
- return t*t*t*t;
+double my4(double const t)
+{
+ return t*t*t*t;
}
-double my5(double const t)
-{
- return t*t*t*t*t;
+double my5(double const t)
+{
+ return t*t*t*t*t;
}
void test(TimeStepping::RungeKutta<Vector<double> > &solver,
- std_cxx11::function<Vector<double> (double const, Vector<double> const &)> f,
- std_cxx11::function<Vector<double> (double const, double const, Vector<double> const &)> id_minus_tau_J_inv,
- std_cxx11::function<double (double const)> my)
+ std_cxx11::function<Vector<double> (double const, Vector<double> const &)> f,
+ std_cxx11::function<Vector<double> (double const, double const, Vector<double> const &)> id_minus_tau_J_inv,
+ std_cxx11::function<double (double const)> my)
{
unsigned int n_time_steps = 1;
unsigned int size = 1;
Vector<double> solution(size);
Vector<double> exact_solution(size);
for (unsigned int i=0; i<size; ++i)
- {
- solution[i] = my(initial_time);
- exact_solution[i] = my(final_time);
- }
+ {
+ solution[i] = my(initial_time);
+ exact_solution[i] = my(final_time);
+ }
for (unsigned int i=0; i<n_time_steps; ++i)
time = solver.evolve_one_time_step(f,id_minus_tau_J_inv,time,time_step,solution);
}
void test2(TimeStepping::EmbeddedExplicitRungeKutta<Vector<double> > &solver,
- std_cxx11::function<Vector<double> (double const, Vector<double> const &)> f,
- std_cxx11::function<Vector<double> (double const, double const, Vector<double> const &)> id_minus_tau_J_inv,
- std_cxx11::function<double (double const)> my)
+ std_cxx11::function<Vector<double> (double const, Vector<double> const &)> f,
+ std_cxx11::function<Vector<double> (double const, double const, Vector<double> const &)> id_minus_tau_J_inv,
+ std_cxx11::function<double (double const)> my)
{
double initial_time = 0.0, final_time = 1.0;
double time_step = 1.0;
Vector<double> solution(size);
Vector<double> exact_solution(size);
for (unsigned int i=0; i<size; ++i)
- {
- solution[i] = my(initial_time);
- exact_solution[i] = my(final_time);
- }
+ {
+ solution[i] = my(initial_time);
+ exact_solution[i] = my(final_time);
+ }
while (time<final_time)
- {
- if (time+time_step>final_time)
- time_step = final_time - time;
- time = solver.evolve_one_time_step(f,id_minus_tau_J_inv,time,time_step,solution);
- time_step = solver.get_status().delta_t_guess;
- }
+ {
+ if (time+time_step>final_time)
+ time_step = final_time - time;
+ time = solver.evolve_one_time_step(f,id_minus_tau_J_inv,time,time_step,solution);
+ time_step = solver.get_status().delta_t_guess;
+ }
Vector<double> error(exact_solution);
error.sadd(1.0,-1.0,solution);
deallog.threshold_double(1.e-1);
{
-
+
// use std::cout so that no output is saved to the logfile, because it
// is difficult to test (timing)
TimerOutput t(std::cout, TimerOutput::summary, TimerOutput::cpu_times);
{
const char *p = "";
deallog << Utilities::split_string_list (p).size()
- << std::endl;
+ << std::endl;
deallog << Utilities::split_string_list (p, ' ').size()
- << std::endl;
+ << std::endl;
}
// also test a string that consists only of whitespace. this should
{
const char *p = " ";
deallog << Utilities::split_string_list (p).size()
- << std::endl;
+ << std::endl;
deallog << Utilities::split_string_list (p, ' ').size()
- << std::endl;
+ << std::endl;
}
}
// verify the documented behavior of eating trailing delimiters
{
deallog << Utilities::split_string_list (",").size()
- << std::endl;
+ << std::endl;
deallog << Utilities::split_string_list (" , ").size()
- << std::endl;
+ << std::endl;
}
{
deallog << Utilities::split_string_list (",,").size()
- << std::endl;
+ << std::endl;
deallog << Utilities::split_string_list (" , , ").size()
- << std::endl;
+ << std::endl;
}
// try some more esoteric cases:
{
deallog << Utilities::split_string_list (" , , ", ' ').size()
- << std::endl;
+ << std::endl;
}
{
deallog << Utilities::split_string_list (" ", ' ').size()
- << std::endl;
+ << std::endl;
deallog << Utilities::split_string_list (" ", ' ').size()
- << std::endl;
+ << std::endl;
}
Assert (Utilities::split_string_list(" ; ", ';').size() == 1,
- ExcInternalError());
+ ExcInternalError());
Assert (Utilities::split_string_list(" ; ", ';')[0] == "",
- ExcInternalError());
+ ExcInternalError());
}
#include <deal.II/base/utilities.h>
-void check(const std::string & input, const std::string & expected)
+void check(const std::string &input, const std::string &expected)
{
deallog << "trim(\"" << input << "\") = \"" << Utilities::trim(input) << "\"" << std::endl;
Assert(Utilities::trim(input) == expected, ExcInternalError());
void foo (const std::vector<unsigned int>::iterator,
- ScratchData&,
- unsigned int&)
+ ScratchData &,
+ unsigned int &)
{
}
-void bar (const unsigned int&)
+void bar (const unsigned int &)
{
}
// first run with only a worker
WorkStream::run (v.begin(), v.end(),
&foo,
- std_cxx11::function<void(const unsigned int&)>(),
+ std_cxx11::function<void(const unsigned int &)>(),
ScratchData(),
0U);
-
+
// next run with only a copier
WorkStream::run (v.begin(), v.end(),
std_cxx11::function<void(const std::vector<unsigned int>::iterator,
- ScratchData&,unsigned int&)>(),
+ ScratchData &,unsigned int &)>(),
&bar,
ScratchData(),
0U);
void check ()
{
deallog << "dim=" << dim << std::endl;
-
+
Triangulation<dim> triangulation;
double r1 = 0.5, r2 = 1.0, halfl = 0.25;
GridGenerator::truncated_cone (triangulation, r1, r2, halfl);
466: --------------------------------------------------------
466: An error occurred in line <306> of file </ssd/branch_port_the_testsuite/deal.II/source/numerics/data_out.cc> in function
466: void dealii::DataOut<dim, DH>::build_one_patch(const std::pair<typename dealii::DataOut_DoFData<DH, DH:: dimension, DH:: space_dimension>::cell_iterator, unsigned int>*, dealii::internal::DataOut::ParallelData<DH:: dimension, DH:: space_dimension>&, dealii::DataOutBase::Patch<DH:: dimension, DH:: space_dimension>&, dealii::DataOut<dim, DH>::CurvedCellRegion, std::vector<dealii::DataOutBase::Patch<DH:: dimension, DH:: space_dimension> >&) [with int dim = 2, DH = dealii::DoFHandler<2>, typename dealii::DataOut_DoFData<DH, DH:: dimension, DH:: space_dimension>::cell_iterator = dealii::TriaIterator<dealii::CellAccessor<2, 2> >]
-466: The violated condition was:
+466: The violated condition was:
466: cell_and_index->second < patches.size()
466: The name and call sequence of the exception was:
466: ExcInternalError()
std::string output_file_name = "output";
template<int dim>
- class FilteredDataOut : public DataOut<dim>
+class FilteredDataOut : public DataOut<dim>
+{
+public:
+ FilteredDataOut (const unsigned int subdomain_id)
+ :
+ subdomain_id (subdomain_id)
+ {}
+
+ virtual typename DataOut<dim>::cell_iterator
+ first_cell ()
+ {
+ typename DataOut<dim>::active_cell_iterator
+ cell = this->dofs->begin_active();
+ while ((cell != this->dofs->end()) &&
+ (cell->subdomain_id() != subdomain_id))
+ ++cell;
+
+ return cell;
+ }
+
+ virtual typename DataOut<dim>::cell_iterator
+ next_cell (const typename DataOut<dim>::cell_iterator &old_cell)
{
- public:
- FilteredDataOut (const unsigned int subdomain_id)
- :
- subdomain_id (subdomain_id)
- {}
-
- virtual typename DataOut<dim>::cell_iterator
- first_cell ()
- {
- typename DataOut<dim>::active_cell_iterator
- cell = this->dofs->begin_active();
- while ((cell != this->dofs->end()) &&
- (cell->subdomain_id() != subdomain_id))
- ++cell;
-
- return cell;
- }
-
- virtual typename DataOut<dim>::cell_iterator
- next_cell (const typename DataOut<dim>::cell_iterator &old_cell)
- {
- if (old_cell != this->dofs->end())
- {
- const IteratorFilters::SubdomainEqualTo
- predicate(subdomain_id);
-
- return
- ++(FilteredIterator
- <typename DataOut<dim>::active_cell_iterator>
- (predicate,old_cell));
- }
- else
- return old_cell;
- }
-
- private:
- const unsigned int subdomain_id;
- };
+ if (old_cell != this->dofs->end())
+ {
+ const IteratorFilters::SubdomainEqualTo
+ predicate(subdomain_id);
+
+ return
+ ++(FilteredIterator
+ <typename DataOut<dim>::active_cell_iterator>
+ (predicate,old_cell));
+ }
+ else
+ return old_cell;
+ }
+
+private:
+ const unsigned int subdomain_id;
+};
template <int dim>
tria.refine_global (1);
Vector<double> cell_data(4);
- for (unsigned int i=0;i<4;++i)
+ for (unsigned int i=0; i<4; ++i)
cell_data(i)=i*1.0;
// this should skip the first cell
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
check<2>();
-
+
return 0;
}
Triangulation<2> tria;
GridGenerator::hyper_cube (tria);
tria.refine_global(1);
-
+
FE_DGQ<2> fe(0);
DoFHandler<2> dof_handler(tria);
dof_handler.distribute_dofs(fe);
renumbering[1]=2;
renumbering[2]=1;
renumbering[3]=0;
-
+
dof_handler.renumber_dofs(renumbering);
-
+
Vector<double> v_node(dof_handler.n_dofs());
Vector<double> v_cell(dof_handler.n_dofs());
- for (unsigned int i=0;i<dof_handler.n_dofs();++i)
+ for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
{
v_node[i]=i;
v_cell[i]=10+i;
//correct one is done if both are possible but specified
deallog << "*** Check cell and node data:" << std::endl;
- {
+ {
DataOut<2> data_out;
data_out.attach_dof_handler (dof_handler);
data_out.add_data_vector (v_node, "node_data", DataOut<2>::type_dof_data);
//only tria, output correctly
deallog << "*** Check cell data only:" << std::endl;
- {
+ {
DataOut<2> data_out;
data_out.attach_triangulation (tria);
data_out.add_data_vector (v_cell, "cell_data");
data_out.write_vtk (deallog.get_file_stream());
}
-
+
//error if both
deallog << "*** should fail:" << std::endl;
try
- {
- DataOut<2> data_out;
- data_out.attach_dof_handler (dof_handler);
- data_out.add_data_vector (v_cell, "cell_data");
- data_out.build_patches ();
+ {
+ DataOut<2> data_out;
+ data_out.attach_dof_handler (dof_handler);
+ data_out.add_data_vector (v_cell, "cell_data");
+ data_out.build_patches ();
- data_out.write_vtk (deallog.get_file_stream());
- }
+ data_out.write_vtk (deallog.get_file_stream());
+ }
catch (...)
{
deallog << "exception" << std::endl;
// works if we use the other add_data_vector:
deallog << "*** Check node data only:" << std::endl;
- {
+ {
DataOut<2> data_out;
data_out.attach_dof_handler (dof_handler);
data_out.add_data_vector (dof_handler, v_node, "node_data");
data_out.write_vtk (deallog.get_file_stream());
}
-
-
-
+
+
+
}
deal_II_exceptions::disable_abort_on_exception();
initlog();
test();
-
+
}
DataOut<dim> data_out;
data_out.add_data_vector (dof1, v1, "scalar");
std::vector<DataComponentInterpretation::DataComponentInterpretation>
- component_interpretation(dim,DataComponentInterpretation::component_is_part_of_vector);
+ component_interpretation(dim,DataComponentInterpretation::component_is_part_of_vector);
data_out.add_data_vector (dof2, v2, std::vector<std::string>(dim,"vector"),
component_interpretation);
data_out.build_patches ();
for (unsigned int i=0; i<v2.size(); ++i) v4(i) = -v2(i);
std::vector<DataComponentInterpretation::DataComponentInterpretation>
- component_interpretation(dim,DataComponentInterpretation::component_is_part_of_vector);
+ component_interpretation(dim,DataComponentInterpretation::component_is_part_of_vector);
DataOut<dim> data_out;
data_out.add_data_vector (dof1, v1, "scalar1");
data_out.add_data_vector (dof2, v2, std::vector<std::string>(dim,"vector1"),
template <int dim>
void
check_this (const DoFHandler<dim> &,
- const Vector<double> &,
- const Vector<double> &)
+ const Vector<double> &,
+ const Vector<double> &)
{
// 3d would generate 4d data, which
// we don't presently support
const Vector<double> &v_cell)
{
const unsigned int dim = 1;
-
+
DataOutStack<dim> data_out_stack;
data_out_stack.declare_data_vector ("node_data",
DataOutStack<dim>::dof_vector);
template <int dim>
void
check_this (const DoFHandler<dim> &,
- const Vector<double> &,
- const Vector<double> &)
+ const Vector<double> &,
+ const Vector<double> &)
{
// 3d would generate 4d data, which
// we don't presently support
const Vector<double> &v_cell)
{
const unsigned int dim = 1;
-
+
DataOutStack<dim> data_out_stack;
data_out_stack.declare_data_vector ("node_data",
DataOutStack<dim>::dof_vector);
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
GridIn<dim> gi;
std::ifstream in (dim == 2 ? SOURCE_DIR "/grids/2d" :
- SOURCE_DIR "/grids/3d");
+ SOURCE_DIR "/grids/3d");
gi.attach_triangulation (coarse_grid);
deallog << "DoFs of face_1:" << std::endl;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
deallog << dofs_1[i] << " is located at "
- << support_points[dofs_1[i]] << std::endl;
+ << support_points[dofs_1[i]] << std::endl;
deallog << "DoFs of face_2:" << std::endl;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
deallog << dofs_2[i] << " is located at "
- << support_points[dofs_2[i]] << std::endl;
+ << support_points[dofs_2[i]] << std::endl;
std::bitset<3> orientation;
deallog << "DoFs of face_1:" << std::endl;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
deallog << dofs_1[i] << " is located at "
- << support_points[dofs_1[i]] << std::endl;
+ << support_points[dofs_1[i]] << std::endl;
deallog << "DoFs of face_2:" << std::endl;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
deallog << dofs_2[i] << " is located at "
- << support_points[dofs_2[i]] << std::endl;
+ << support_points[dofs_2[i]] << std::endl;
std::bitset<3> orientation;
deallog << "DoFs of face_1:" << std::endl;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
deallog << dofs_1[i] << " is located at "
- << support_points[dofs_1[i]] << std::endl;
+ << support_points[dofs_1[i]] << std::endl;
deallog << "DoFs of face_2:" << std::endl;
for (unsigned int i = 0; i < fe.dofs_per_face; ++i)
deallog << dofs_2[i] << " is located at "
- << support_points[dofs_2[i]] << std::endl;
+ << support_points[dofs_2[i]] << std::endl;
std::bitset<3> orientation;
i = sp.begin(1);
deallog << i->row() << ' ' << i->column() << std::endl;
- deallog << "OK" << std::endl;
+ deallog << "OK" << std::endl;
}
i = sp.begin(1);
deallog << i->row() << ' ' << i->column() << std::endl;
- deallog << "OK" << std::endl;
+ deallog << "OK" << std::endl;
}
/*
crash:
-/usr/include/c++/4.8/debug/safe_iterator.h:506:error: attempt to compare a
+/usr/include/c++/4.8/debug/safe_iterator.h:506:error: attempt to compare a
singular iterator to a singular iterator.
Objects involved in the operation:
{
for (unsigned int row=0; row<sp.n_rows(); ++row)
{
- DynamicSparsityPattern::iterator col = sp.begin(row),
- end_col = sp.end(row);
- deallog << "row " << row << ":" << std::endl;
- for (;col != end_col;++col)
- {
- deallog << "row= " << col->row()
- << ", col= "<< col->column()
- << ", index= " << col->index()
- << std::endl;
- }
+ DynamicSparsityPattern::iterator col = sp.begin(row),
+ end_col = sp.end(row);
+ deallog << "row " << row << ":" << std::endl;
+ for (; col != end_col; ++col)
+ {
+ deallog << "row= " << col->row()
+ << ", col= "<< col->column()
+ << ", index= " << col->index()
+ << std::endl;
+ }
}
}
deallog << "OK" << std::endl;
sp.add (0,1);
sp.add (3,3);
sp.compress ();
-
+
deallog << "** 5 by 5 ** " << std::endl;
iterate (sp);
}
{
deallog << std::scientific;
deallog.precision(16);
-
+
Point< 2 > ePos;
ePos(0) = 0.0653630060373507487669897386695;
ePos(1) = 1125.59175030825804242340382189;
create_coarse_grid(triangulation); // first Tria with just one cell
Triangulation<2>::active_cell_iterator it = triangulation.begin();
-
+
Point<2> p;
p = mapping.transform_real_to_unit_cell(it, ePos);
deallog << "A: " << p << std::endl;
- // throws:
+ // throws:
p = mapping2.transform_real_to_unit_cell(it, ePos);
deallog << "B: " << p << std::endl;
{
Triangulation<2> tr;
GridGenerator::hyper_cube(tr);
-
+
Point< 2 > p;
p(0) = -0.1;
p(1) = 0.5;
MappingQ<2> mapping(1);
-
+
try
{
GridTools::find_active_cell_around_point (mapping, tr, p);
GridGenerator::subdivided_hyper_rectangle(triangulation,
- n_cells,
- left_bottom,
- right_top,
- true);
+ n_cells,
+ left_bottom,
+ right_top,
+ true);
typename Triangulation<2>::active_cell_iterator
- cell = triangulation.begin_active(),
- endc = triangulation.end();
- for (; cell!=endc; ++cell){
- Point<2> cell_center = cell->center();
- if (abs(cell_center(0) - 1500) < 550){
- cell->set_refine_flag ();
+ cell = triangulation.begin_active(),
+ endc = triangulation.end();
+ for (; cell!=endc; ++cell)
+ {
+ Point<2> cell_center = cell->center();
+ if (abs(cell_center(0) - 1500) < 550)
+ {
+ cell->set_refine_flag ();
+ }
}
- }
triangulation.execute_coarsening_and_refinement ();
try
{
std::pair<typename Triangulation<2>::active_cell_iterator, Point<2> > current_cell =
- GridTools::find_active_cell_around_point(MappingQ1<2>(), triangulation, test_point);
+ GridTools::find_active_cell_around_point(MappingQ1<2>(), triangulation, test_point);
deallog << "cell: index = " << current_cell.first->index()
- << " level = " << current_cell.first->level() << std::endl;
+ << " level = " << current_cell.first->level() << std::endl;
deallog << " pos: " << current_cell.second << std::endl;
}
catch (GridTools::ExcPointNotFound<2> &e)
GridGenerator::hyper_cube (triangulation, -1, 1);
FESystem<dim> fe(FE_Q<2>(1),1,FE_Q<2>(2),2);
-
+
deallog << "Number of cells: "
<< triangulation.n_active_cells() << std::endl;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs (fe);
- //DoFRenumbering::component_wise(dof_handler);
+ //DoFRenumbering::component_wise(dof_handler);
deallog << "Number of dofs: "
<< dof_handler.n_dofs() << std::endl;
constraints.close();
deallog << "Number of Constraints: " << constraints.n_constraints()<<std::endl;
- Quadrature<2> quadrature_formula(fe.get_unit_support_points());
+ Quadrature<2> quadrature_formula(fe.get_unit_support_points());
FEValues<2> fe_values (fe, quadrature_formula,
update_values | update_gradients | update_JxW_values|update_q_points);
cell->get_dof_indices (local_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
- {
- if (constraints.is_constrained(local_dof_indices[i]))
- deallog << "DoF "<< local_dof_indices[i]
- << ", copy " << fe.system_to_base_index(i).first.second
- << ", base element " << fe.system_to_base_index(i).first.first
- << ", index " << fe.system_to_base_index(i).second
- << ", position " << locations[i] << std::endl;
- }
+ {
+ if (constraints.is_constrained(local_dof_indices[i]))
+ deallog << "DoF "<< local_dof_indices[i]
+ << ", copy " << fe.system_to_base_index(i).first.second
+ << ", base element " << fe.system_to_base_index(i).first.first
+ << ", index " << fe.system_to_base_index(i).second
+ << ", position " << locations[i] << std::endl;
+ }
}
}
#include <deal.II/base/parameter_handler.h>
#include <fstream>
-void check (const char * content, double &v1, double &v2)
+void check (const char *content, double &v1, double &v2)
{
ParameterHandler foo;
foo.enter_subsection("bar");
{
ParameterHandler prm;
prm.declare_entry ("a", "this that and the other", Patterns::Anything(),
- "");
+ "");
try
{
prm.get_double ("a");
{
deallog << "get_bool() detected the mistake" << std::endl;
}
-
+
}
bool okay = foo.read_input(SOURCE_DIR "/parameter_handler_18.prm");
Assert(okay, ExcMessage("read_input failed"));
-
+
foo.enter_subsection("bar");
deallog << foo.get ("val") << std::endl;
foo.leave_subsection();
std::string s = "set x=5\n";
bool success = prm.read_input_from_string (s.c_str());
deallog << "success? "
- << success
- << " (should work), x correct? "
- << (prm.get_integer("x")==5) << std::endl;
+ << success
+ << " (should work), x correct? "
+ << (prm.get_integer("x")==5) << std::endl;
prm.leave_subsection();
}
try
{
prm.declare_entry ("test_1", "abc",
- Patterns::List(Patterns::Integer(-1,1),2,3));
+ Patterns::List(Patterns::Integer(-1,1),2,3));
}
catch (const ParameterHandler::ExcValueDoesNotMatchPattern &)
{
std::ifstream in(p);
bool status = prm.read_input (in);
Assert (status == false, ExcInternalError());
-
+
deallog << "test_1=" << prm.get ("test_1") << std::endl;
}
#include <deal.II/base/parameter_handler.h>
#include <fstream>
-void check (const char * content)
+void check (const char *content)
{
deallog << "* check" << std::endl;
ParameterHandler foo;
#include <fstream>
#include <sstream>
-void check (const char *defaults, const char* defined, const char *input)
+void check (const char *defaults, const char *defined, const char *input)
{
ParameterHandler prm;
prm.declare_entry ("v", defaults, Patterns::MultipleSelection(defined), "");
-
+
std::stringstream in(input);
prm.read_input (in);
deallog << "defaults='" << defaults
- << "' defined='" << defined
- << "' input='" << input
- << "' result='" << prm.get("v") << "'" << std::endl;
+ << "' defined='" << defined
+ << "' input='" << input
+ << "' result='" << prm.get("v") << "'" << std::endl;
}
void test()
Patterns::Double(),
"docs 3");
prm.declare_alias ("int",
- "int_alias");
+ "int_alias");
prm.leave_subsection ();
// read and then write parameters
Patterns::Double(),
"docs 3");
prm.declare_alias ("int_alias",
- "int");
+ "int");
prm.leave_subsection ();
// read and then write parameters
Patterns::Double(),
"docs 3");
prm.declare_alias ("int_alias",
- "int");
+ "int");
prm.leave_subsection ();
// read and then write parameters
Patterns::Double(),
"docs 3");
prm.declare_alias ("int_alias",
- "int");
+ "int");
prm.leave_subsection ();
// read and then write parameters
"docs 3");
prm.declare_alias ("double",
"double_alias",
- true);
+ true);
}
prm.leave_subsection ();
};
Deal2PeriodicBug::Deal2PeriodicBug()
-: fe(2), dof_handler(triangulation)
+ : fe(2), dof_handler(triangulation)
{}
{
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
- cell!=tria.end(); ++cell, ++index)
+ cell!=tria.end(); ++cell, ++index)
Assert (cell->active_cell_index() == index, ExcInternalError());
}
{
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
- cell!=tria.end(); ++cell, ++index)
+ cell!=tria.end(); ++cell, ++index)
Assert (cell->active_cell_index() == index, ExcInternalError());
}
{
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
- cell!=tria.end(); ++cell, ++index)
+ cell!=tria.end(); ++cell, ++index)
Assert (cell->active_cell_index() == index, ExcInternalError());
}
{
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
- cell!=tria.end(); ++cell, ++index)
+ cell!=tria.end(); ++cell, ++index)
Assert (cell->active_cell_index() == index, ExcInternalError());
}
{
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
- cell!=tria.end(); ++cell, ++index)
+ cell!=tria.end(); ++cell, ++index)
Assert (cell->active_cell_index() == index, ExcInternalError());
}
check (tria);
{
Triangulation<dim> x;
-
+
// save data to archive
std::ostringstream oss;
{
// restore triangulation
ia >> x;
}
-
+
check(x);
}
check (tria);
{
Triangulation<dim> x;
-
+
// save data to archive
std::ostringstream oss;
{
// restore triangulation
ia >> x;
}
-
+
check(x);
}
long double area = 0;
typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
for (; cell!=endc; ++cell)
{
x_fe_values.reinit (cell);
dof_handler.distribute_dofs (fe);
typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
long double perimeter = 0;
for (; cell!=endc; ++cell)
for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell; ++face_no)
Threads::ThreadGroup<> threads;
for (unsigned int thread=0; thread<n_threads; ++thread)
threads += Threads::new_thread (&Solver<dim>::assemble_matrix, *this,
- linear_system,
- thread_ranges[thread].first,
- thread_ranges[thread].second,
- mutex);
+ linear_system,
+ thread_ranges[thread].first,
+ thread_ranges[thread].second,
+ mutex);
assemble_rhs (linear_system.rhs);
linear_system.hanging_node_constraints.condense (linear_system.rhs);
= &DoFTools::make_hanging_node_constraints;
Threads::Thread<>
- mhnc_thread = Threads::new_thread (mhnc_p, dof_handler,
- hanging_node_constraints);
+ mhnc_thread = Threads::new_thread (mhnc_p, dof_handler,
+ hanging_node_constraints);
sparsity_pattern.reinit (dof_handler.n_dofs(),
dof_handler.n_dofs(),
{
fe_values.reinit (cell);
fe_values.get_function_gradients (solution,
- solution_gradients);
+ solution_gradients);
unsigned int q_point = 0;
for (; q_point<solution_gradients.size(); ++q_point)
= &DoFTools::make_hanging_node_constraints;
Threads::Thread<>
- mhnc_thread = Threads::new_thread (mhnc_p,dof_handler, hanging_node_constraints);
+ mhnc_thread = Threads::new_thread (mhnc_p,dof_handler, hanging_node_constraints);
sparsity_pattern.reinit (dof_handler.n_dofs(),
dof_handler.n_dofs(),
->value_list (cell_data.fe_values.get_quadrature_points(),
cell_data.rhs_values);
cell_data.fe_values.get_function_hessians (primal_solution,
- cell_data.cell_grad_grads);
+ cell_data.cell_grad_grads);
cell_data.fe_values.get_function_values (dual_weights,
cell_data.dual_weights);
face_data.fe_face_values_cell.reinit (cell, face_no);
face_data.fe_face_values_cell.get_function_gradients (primal_solution,
- face_data.cell_grads);
+ face_data.cell_grads);
Assert (cell->neighbor(face_no).state() == IteratorState::valid,
ExcInternalError());
const active_cell_iterator neighbor = cell->neighbor(face_no);
face_data.fe_face_values_neighbor.reinit (neighbor, neighbor_neighbor);
face_data.fe_face_values_neighbor.get_function_gradients (primal_solution,
- face_data.neighbor_grads);
+ face_data.neighbor_grads);
for (unsigned int p=0; p<n_q_points; ++p)
face_data.jump_residual[p]
face_data.fe_subface_values_cell.reinit (cell, face_no, subface_no);
face_data.fe_subface_values_cell.get_function_gradients (primal_solution,
- face_data.cell_grads);
+ face_data.cell_grads);
face_data.fe_face_values_neighbor.reinit (neighbor_child,
neighbor_neighbor);
face_data.fe_face_values_neighbor.get_function_gradients (primal_solution,
- face_data.neighbor_grads);
+ face_data.neighbor_grads);
for (unsigned int p=0; p<n_q_points; ++p)
face_data.jump_residual[p]
std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
typename DoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
- endc = mg_dof_handler.end();
+ endc = mg_dof_handler.end();
for (; cell!=endc; ++cell)
{
const unsigned int level = cell->level();
std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
typename DoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
- endc = mg_dof_handler.end();
+ endc = mg_dof_handler.end();
for (; cell!=endc; ++cell)
{
const unsigned int level = cell->level();
template <>
const Point<1>
SolutionBase<1>::source_centers[SolutionBase<1>::n_source_centers]
- = { Point<1>(-1.0 / 3.0),
- Point<1>(0.0),
- Point<1>(+1.0 / 3.0)
- };
+ = { Point<1>(-1.0 / 3.0),
+ Point<1>(0.0),
+ Point<1>(+1.0 / 3.0)
+ };
template <>
const Point<2>
SolutionBase<2>::source_centers[SolutionBase<2>::n_source_centers]
- = { Point<2>(-0.5, +0.5),
- Point<2>(-0.5, -0.5),
- Point<2>(+0.5, -0.5)
- };
+ = { Point<2>(-0.5, +0.5),
+ Point<2>(-0.5, -0.5),
+ Point<2>(+0.5, -0.5)
+ };
template <>
const Point<3>
SolutionBase<3>::source_centers[SolutionBase<3>::n_source_centers]
- = { Point<3>(-0.5, +0.5, 0.25),
- Point<3>(-0.6, -0.5, -0.125),
- Point<3>(+0.5, -0.5, 0.5)
- };
+ = { Point<3>(-0.5, +0.5, 0.25),
+ Point<3>(-0.6, -0.5, -0.125),
+ Point<3>(+0.5, -0.5, 0.5)
+ };
template <int dim>
const double SolutionBase<dim>::width = 1./5.;
for (unsigned int q=0; q<n_q_points; ++q)
{
const double rhs_value
- = scratch.right_hand_side.value(scratch.fe_values_local.quadrature_point(q));
+ = scratch.right_hand_side.value(scratch.fe_values_local.quadrature_point(q));
const Tensor<1,dim> convection
- = scratch.convection_velocity.value(scratch.fe_values_local.quadrature_point(q));
+ = scratch.convection_velocity.value(scratch.fe_values_local.quadrature_point(q));
const double JxW = scratch.fe_values_local.JxW(q);
for (unsigned int k=0; k<loc_dofs_per_cell; ++k)
{
scratch.fe_face_values.quadrature_point(q);
const Tensor<1,dim> normal = scratch.fe_face_values.normal_vector(q);
const Tensor<1,dim> convection
- = scratch.convection_velocity.value(quadrature_point);
+ = scratch.convection_velocity.value(quadrature_point);
const double tau_stab = (5. +
std::abs(convection * normal));
const unsigned int jj=scratch.fe_local_support_on_face[face][j];
scratch.ll_matrix(ii,jj) += tau_stab * scratch.u_phi[i] * scratch.u_phi[j] * JxW;
}
-
+
if (task_data.trace_reconstruct)
for (unsigned int i=0; i<scratch.fe_local_support_on_face[face].size(); ++i)
{
template <>
const Point<1>
SolutionBase<1>::source_centers[SolutionBase<1>::n_source_centers]
- = { Point<1>(-1.0 / 3.0),
- Point<1>(0.0),
- Point<1>(+1.0 / 3.0)
- };
+ = { Point<1>(-1.0 / 3.0),
+ Point<1>(0.0),
+ Point<1>(+1.0 / 3.0)
+ };
template <>
const Point<2>
SolutionBase<2>::source_centers[SolutionBase<2>::n_source_centers]
- = { Point<2>(-0.5, +0.5),
- Point<2>(-0.5, -0.5),
- Point<2>(+0.5, -0.5)
- };
+ = { Point<2>(-0.5, +0.5),
+ Point<2>(-0.5, -0.5),
+ Point<2>(+0.5, -0.5)
+ };
template <>
const Point<3>
SolutionBase<3>::source_centers[SolutionBase<3>::n_source_centers]
- = { Point<3>(-0.5, +0.5, 0.25),
- Point<3>(-0.6, -0.5, -0.125),
- Point<3>(+0.5, -0.5, 0.5)
- };
+ = { Point<3>(-0.5, +0.5, 0.25),
+ Point<3>(-0.6, -0.5, -0.125),
+ Point<3>(+0.5, -0.5, 0.5)
+ };
template <int dim>
const double SolutionBase<dim>::width = 1./5.;
for (unsigned int q=0; q<n_q_points; ++q)
{
const double rhs_value
- = scratch.right_hand_side.value(scratch.fe_values_local.quadrature_point(q));
+ = scratch.right_hand_side.value(scratch.fe_values_local.quadrature_point(q));
const Tensor<1,dim> convection
- = scratch.convection_velocity.value(scratch.fe_values_local.quadrature_point(q));
+ = scratch.convection_velocity.value(scratch.fe_values_local.quadrature_point(q));
const double JxW = scratch.fe_values_local.JxW(q);
for (unsigned int k=0; k<loc_dofs_per_cell; ++k)
{
scratch.fe_face_values.quadrature_point(q);
const Tensor<1,dim> normal = scratch.fe_face_values.normal_vector(q);
const Tensor<1,dim> convection
- = scratch.convection_velocity.value(quadrature_point);
+ = scratch.convection_velocity.value(quadrature_point);
const double tau_stab = (5. +
std::abs(convection * normal));
const unsigned int jj=scratch.fe_local_support_on_face[face][j];
scratch.ll_matrix(ii,jj) += tau_stab * scratch.u_phi[i] * scratch.u_phi[j] * JxW;
}
-
+
if (task_data.trace_reconstruct)
for (unsigned int i=0; i<scratch.fe_local_support_on_face[face].size(); ++i)
{
convergence_table.set_scientific("val L2-post", true);
convergence_table
- .evaluate_convergence_rates("val L2", "cells", ConvergenceTable::reduction_rate_log2, dim);
+ .evaluate_convergence_rates("val L2", "cells", ConvergenceTable::reduction_rate_log2, dim);
convergence_table
- .evaluate_convergence_rates("grad L2", "cells", ConvergenceTable::reduction_rate_log2, dim);
+ .evaluate_convergence_rates("grad L2", "cells", ConvergenceTable::reduction_rate_log2, dim);
convergence_table
- .evaluate_convergence_rates("val L2-post", "cells", ConvergenceTable::reduction_rate_log2, dim);
+ .evaluate_convergence_rates("val L2-post", "cells", ConvergenceTable::reduction_rate_log2, dim);
convergence_table.write_text(deallog.get_file_stream());
}
estimated_error_per_cell);
GridRefinement::refine_and_coarsen_optimize (triangulation,
- estimated_error_per_cell,
- 5);
+ estimated_error_per_cell,
+ 5);
triangulation.execute_coarsening_and_refinement ();
}
estimated_error_per_cell);
GridRefinement::refine_and_coarsen_optimize (triangulation,
- estimated_error_per_cell);
+ estimated_error_per_cell);
triangulation.execute_coarsening_and_refinement ();
}
std::set<types::boundary_id> boundary_ids;
boundary_ids.insert (0);
GridGenerator::extract_boundary_mesh (volume_mesh, boundary_mesh,
- boundary_ids);
+ boundary_ids);
deallog << volume_mesh.n_active_cells () << std::endl;
deallog << boundary_mesh.n_active_cells () << std::endl;
boundary_ids.insert(0);
GridGenerator::extract_boundary_mesh (volume_mesh, tria,
- boundary_ids);
+ boundary_ids);
// test for the position
MappingQ<2,3> mapping(mapping_degree,true);
surface_to_volume_mapping
= GridGenerator::extract_boundary_mesh (volume_mesh, boundary_mesh,
- boundary_ids);
+ boundary_ids);
if (test_vertices_orientation(boundary_mesh, surface_to_volume_mapping))
deallog << "Passed.";
typename DoFHandler<spacedim>::face_iterator>
element_assignment =
GridGenerator::extract_boundary_mesh(space_dof_handler,
- contact_dof_handler,
- boundary_ids);
+ contact_dof_handler,
+ boundary_ids);
contact_dof_handler.distribute_dofs(boundary_fe);
{
double qpow = pow(quad.point(q)[0], (double) power);
approx_integral += qpow * quad.weight(q);
- double factor = log(abs( (factored_quad.point(q)-origins[nos])[0] )/alphas[nas] );
- // This code cannot work if factor is equal to
- // zero. In this case, just pass the other
- // quadrature formula, which should be valid anyway.
- if(factor != 0.0) {
- qpow *= factor;
- approx_integral_factored += qpow * factored_quad.weight(q);
- } else {
- approx_integral_factored += qpow * quad.weight(q);
- }
+ double factor = log(abs( (factored_quad.point(q)-origins[nos])[0] )/alphas[nas] );
+ // This code cannot work if factor is equal to
+ // zero. In this case, just pass the other
+ // quadrature formula, which should be valid anyway.
+ if (factor != 0.0)
+ {
+ qpow *= factor;
+ approx_integral_factored += qpow * factored_quad.weight(q);
+ }
+ else
+ {
+ approx_integral_factored += qpow * quad.weight(q);
+ }
}
deallog << " Error(n=" << quad.size()
double
exact_integral_one_over_r (
- const unsigned int i, const unsigned int j,
- const unsigned int vertex_index);
+ const unsigned int i, const unsigned int j,
+ const unsigned int vertex_index);
ofstream logfile("output");
<< " =============================== " << endl;
deallog << " ============================================================ " << endl;
unsigned int index=0;
- {
- deallog << " ===============Vertex: " << vertices[index]
- << " ============================= " << endl;
- QTelles<2> quad(m, vertices[index]);
- QGaussOneOverR<2> quad2(m, vertices[index]);
+ {
+ deallog << " ===============Vertex: " << vertices[index]
+ << " ============================= " << endl;
+ QTelles<2> quad(m, vertices[index]);
+ QGaussOneOverR<2> quad2(m, vertices[index]);
- for (unsigned int i = 0; i < 6; ++i)
- {
- for (unsigned int j = 0; j < 6; ++j)
- {
+ for (unsigned int i = 0; i < 6; ++i)
+ {
+ for (unsigned int j = 0; j < 6; ++j)
+ {
- double exact_integral = exact_integral_one_over_r(index, i,j);
- double approx_integral = 0;
- double approx_integral_2 = 0;
+ double exact_integral = exact_integral_one_over_r(index, i,j);
+ double approx_integral = 0;
+ double approx_integral_2 = 0;
- for (unsigned int q=0; q< quad.size(); ++q)
- {
- double x = quad.point(q)[0];
- double y = quad.point(q)[1];
- double R = sqrt(x*x+y*y);
- approx_integral += ( pow(x, (double)i) *
- pow(y, (double)j) / R *
- quad.weight(q) );
- }
+ for (unsigned int q=0; q< quad.size(); ++q)
+ {
+ double x = quad.point(q)[0];
+ double y = quad.point(q)[1];
+ double R = sqrt(x*x+y*y);
+ approx_integral += ( pow(x, (double)i) *
+ pow(y, (double)j) / R *
+ quad.weight(q) );
+ }
- for (unsigned int q=0; q< quad2.size(); ++q)
- {
- double x = quad2.point(q)[0];
- double y = quad2.point(q)[1];
- double R = sqrt(x*x+y*y);
- approx_integral_2 += ( pow(x, (double)i) *
- pow(y, (double)j) *
- quad2.weight(q) );
- }
+ for (unsigned int q=0; q< quad2.size(); ++q)
+ {
+ double x = quad2.point(q)[0];
+ double y = quad2.point(q)[1];
+ double R = sqrt(x*x+y*y);
+ approx_integral_2 += ( pow(x, (double)i) *
+ pow(y, (double)j) *
+ quad2.weight(q) );
+ }
- deallog << "f(x,y) = x^" << i
- << " y^" << j
- << ", Errors = "
- << approx_integral - exact_integral
- << ", "
- << approx_integral_2 - exact_integral
- << std::endl;
- }
- }
- }
- }
+ deallog << "f(x,y) = x^" << i
+ << " y^" << j
+ << ", Errors = "
+ << approx_integral - exact_integral
+ << ", "
+ << approx_integral_2 - exact_integral
+ << std::endl;
+ }
+ }
+ }
}
+}
double exact_integral_one_over_r(const unsigned int vertex_index,
- const unsigned int i,
- const unsigned int j)
- {
- Assert(vertex_index < 4, ExcInternalError());
- Assert(i<6, ExcNotImplemented());
- Assert(j<6, ExcNotImplemented());
+ const unsigned int i,
+ const unsigned int j)
+{
+ Assert(vertex_index < 4, ExcInternalError());
+ Assert(i<6, ExcNotImplemented());
+ Assert(j<6, ExcNotImplemented());
// The integrals are computed using the following maple snippet of
// code:
// end do;
// C(v)
- static double v[4][6][6] =
- {
- {
- { 0}}};
- if (v[0][0][0] == 0)
- {
- v[0][0][0] = 0.17627471740390860505e1;
- v[0][0][1] = 0.64779357469631903702e0;
- v[0][0][2] = 0.38259785823210634567e0;
- v[0][0][3] = 0.26915893322379450224e0;
- v[0][0][4] = 0.20702239737104695572e0;
- v[0][0][5] = 0.16800109713227567467e0;
- v[0][1][0] = 0.64779357469631903702e0;
- v[0][1][1] = 0.27614237491539669920e0;
- v[0][1][2] = 0.17015838751246776515e0;
- v[0][1][3] = 0.12189514164974600651e0;
- v[0][1][4] = 0.94658660368131133694e-1;
- v[0][1][5] = 0.77263794021029438797e-1;
- v[0][2][0] = 0.38259785823210634567e0;
- v[0][2][1] = 0.17015838751246776515e0;
- v[0][2][2] = 0.10656799507071040471e0;
- v[0][2][3] = 0.76947022258735165920e-1;
- v[0][2][4] = 0.60022626787495395021e-1;
- v[0][2][5] = 0.49131622931360879320e-1;
- v[0][3][0] = 0.26915893322379450224e0;
- v[0][3][1] = 0.12189514164974600651e0;
- v[0][3][2] = 0.76947022258735165919e-1;
- v[0][3][3] = 0.55789184535895709637e-1;
- v[0][3][4] = 0.43625068213915842136e-1;
- v[0][3][5] = 0.35766126849971778500e-1;
- v[0][4][0] = 0.20702239737104695572e0;
- v[0][4][1] = 0.94658660368131133694e-1;
- v[0][4][2] = 0.60022626787495395021e-1;
- v[0][4][3] = 0.43625068213915842137e-1;
- v[0][4][4] = 0.34164088852375945192e-1;
- v[0][4][5] = 0.28037139560980277614e-1;
- v[0][5][0] = 0.16800109713227567467e0;
- v[0][5][1] = 0.77263794021029438797e-1;
- v[0][5][2] = 0.49131622931360879320e-1;
- v[0][5][3] = 0.35766126849971778501e-1;
- v[0][5][4] = 0.28037139560980277614e-1;
- v[0][5][5] = 0.23024181049838367777e-1;
- v[1][0][0] = 0.17627471740390860505e1;
- v[1][0][1] = 0.64779357469631903702e0;
- v[1][0][2] = 0.38259785823210634567e0;
- v[1][0][3] = 0.26915893322379450224e0;
- v[1][0][4] = 0.20702239737104695572e0;
- v[1][0][5] = 0.16800109713227567467e0;
- v[1][1][0] = 0.11149535993427670134e1;
- v[1][1][1] = 0.37165119978092233782e0;
- v[1][1][2] = 0.21243947071963858053e0;
- v[1][1][3] = 0.14726379157404849573e0;
- v[1][1][4] = 0.11236373700291582202e0;
- v[1][1][5] = 0.90737303111246235871e-1;
- v[1][2][0] = 0.84975788287855432210e0;
- v[1][2][1] = 0.26566721237799340376e0;
- v[1][2][2] = 0.14884907827788122009e0;
- v[1][2][3] = 0.10231567218303765515e0;
- v[1][2][4] = 0.77727703422280083352e-1;
- v[1][2][5] = 0.62605132021577676395e-1;
- v[1][3][0] = 0.69800109142265347423e0;
- v[1][3][1] = 0.20794647083778622837e0;
- v[1][3][2] = 0.11487965864809909847e0;
- v[1][3][3] = 0.78525390514866270852e-1;
- v[1][3][4] = 0.59489228415223897572e-1;
- v[1][3][5] = 0.47838457013298217744e-1;
- v[1][4][0] = 0.59754668912231692323e0;
- v[1][4][1] = 0.17125249387868593878e0;
- v[1][4][2] = 0.93606816359052444729e-1;
- v[1][4][3] = 0.63728830247554475330e-1;
- v[1][4][4] = 0.48187332620207367724e-1;
- v[1][4][5] = 0.38708290797416359020e-1;
- v[1][5][0] = 0.52527944036356840363e0;
- v[1][5][1] = 0.14574366656617935708e0;
- v[1][5][2] = 0.78997159795636003667e-1;
- v[1][5][3] = 0.53620816423066464705e-1;
- v[1][5][4] = 0.40487985967086264433e-1;
- v[1][5][5] = 0.32498604596082509165e-1;
- v[2][0][0] = 0.17627471740390860505e1;
- v[2][0][1] = 0.11149535993427670134e1;
- v[2][0][2] = 0.84975788287855432210e0;
- v[2][0][3] = 0.69800109142265347419e0;
- v[2][0][4] = 0.59754668912231692318e0;
- v[2][0][5] = 0.52527944036356840362e0;
- v[2][1][0] = 0.64779357469631903702e0;
- v[2][1][1] = 0.37165119978092233782e0;
- v[2][1][2] = 0.26566721237799340376e0;
- v[2][1][3] = 0.20794647083778622835e0;
- v[2][1][4] = 0.17125249387868593876e0;
- v[2][1][5] = 0.14574366656617935708e0;
- v[2][2][0] = 0.38259785823210634567e0;
- v[2][2][1] = 0.21243947071963858053e0;
- v[2][2][2] = 0.14884907827788122009e0;
- v[2][2][3] = 0.11487965864809909845e0;
- v[2][2][4] = 0.93606816359052444712e-1;
- v[2][2][5] = 0.78997159795636003667e-1;
- v[2][3][0] = 0.26915893322379450223e0;
- v[2][3][1] = 0.14726379157404849572e0;
- v[2][3][2] = 0.10231567218303765514e0;
- v[2][3][3] = 0.78525390514866270835e-1;
- v[2][3][4] = 0.63728830247554475311e-1;
- v[2][3][5] = 0.53620816423066464702e-1;
- v[2][4][0] = 0.20702239737104695572e0;
- v[2][4][1] = 0.11236373700291582202e0;
- v[2][4][2] = 0.77727703422280083352e-1;
- v[2][4][3] = 0.59489228415223897563e-1;
- v[2][4][4] = 0.48187332620207367713e-1;
- v[2][4][5] = 0.40487985967086264434e-1;
- v[2][5][0] = 0.16800109713227567468e0;
- v[2][5][1] = 0.90737303111246235879e-1;
- v[2][5][2] = 0.62605132021577676399e-1;
- v[2][5][3] = 0.47838457013298217740e-1;
- v[2][5][4] = 0.38708290797416359014e-1;
- v[2][5][5] = 0.32498604596082509169e-1;
- v[3][0][0] = 0.17627471740390860505e1;
- v[3][0][1] = 0.11149535993427670134e1;
- v[3][0][2] = 0.84975788287855432210e0;
- v[3][0][3] = 0.69800109142265347419e0;
- v[3][0][4] = 0.59754668912231692318e0;
- v[3][0][5] = 0.52527944036356840362e0;
- v[3][1][0] = 0.11149535993427670134e1;
- v[3][1][1] = 0.74330239956184467563e0;
- v[3][1][2] = 0.58409067050056091834e0;
- v[3][1][3] = 0.49005462058486724584e0;
- v[3][1][4] = 0.42629419524363098443e0;
- v[3][1][5] = 0.37953577379738904654e0;
- v[3][2][0] = 0.84975788287855432210e0;
- v[3][2][1] = 0.58409067050056091834e0;
- v[3][2][2] = 0.46727253640044873467e0;
- v[3][2][3] = 0.39698780839518011595e0;
- v[3][2][4] = 0.34864851772399749038e0;
- v[3][2][5] = 0.31278926702684569312e0;
- v[3][3][0] = 0.69800109142265347423e0;
- v[3][3][1] = 0.49005462058486724586e0;
- v[3][3][2] = 0.39698780839518011599e0;
- v[3][3][3] = 0.34027526433872581371e0;
- v[3][3][4] = 0.30088082631586196583e0;
- v[3][3][5] = 0.27141910362887187844e0;
- v[3][4][0] = 0.59754668912231692323e0;
- v[3][4][1] = 0.42629419524363098445e0;
- v[3][4][2] = 0.34864851772399749044e0;
- v[3][4][3] = 0.30088082631586196576e0;
- v[3][4][4] = 0.26744962339187730308e0;
- v[3][4][5] = 0.24229245314748740295e0;
- v[3][5][0] = 0.52527944036356840363e0;
- v[3][5][1] = 0.37953577379738904655e0;
- v[3][5][2] = 0.31278926702684569301e0;
- v[3][5][3] = 0.27141910362887187862e0;
- v[3][5][4] = 0.24229245314748740263e0;
- v[3][5][5] = 0.22026586649771582089e0;
- }
- return v[vertex_index][i][j];
- }
+ static double v[4][6][6] =
+ {
+ {
+ { 0}
+ }
+ };
+ if (v[0][0][0] == 0)
+ {
+ v[0][0][0] = 0.17627471740390860505e1;
+ v[0][0][1] = 0.64779357469631903702e0;
+ v[0][0][2] = 0.38259785823210634567e0;
+ v[0][0][3] = 0.26915893322379450224e0;
+ v[0][0][4] = 0.20702239737104695572e0;
+ v[0][0][5] = 0.16800109713227567467e0;
+ v[0][1][0] = 0.64779357469631903702e0;
+ v[0][1][1] = 0.27614237491539669920e0;
+ v[0][1][2] = 0.17015838751246776515e0;
+ v[0][1][3] = 0.12189514164974600651e0;
+ v[0][1][4] = 0.94658660368131133694e-1;
+ v[0][1][5] = 0.77263794021029438797e-1;
+ v[0][2][0] = 0.38259785823210634567e0;
+ v[0][2][1] = 0.17015838751246776515e0;
+ v[0][2][2] = 0.10656799507071040471e0;
+ v[0][2][3] = 0.76947022258735165920e-1;
+ v[0][2][4] = 0.60022626787495395021e-1;
+ v[0][2][5] = 0.49131622931360879320e-1;
+ v[0][3][0] = 0.26915893322379450224e0;
+ v[0][3][1] = 0.12189514164974600651e0;
+ v[0][3][2] = 0.76947022258735165919e-1;
+ v[0][3][3] = 0.55789184535895709637e-1;
+ v[0][3][4] = 0.43625068213915842136e-1;
+ v[0][3][5] = 0.35766126849971778500e-1;
+ v[0][4][0] = 0.20702239737104695572e0;
+ v[0][4][1] = 0.94658660368131133694e-1;
+ v[0][4][2] = 0.60022626787495395021e-1;
+ v[0][4][3] = 0.43625068213915842137e-1;
+ v[0][4][4] = 0.34164088852375945192e-1;
+ v[0][4][5] = 0.28037139560980277614e-1;
+ v[0][5][0] = 0.16800109713227567467e0;
+ v[0][5][1] = 0.77263794021029438797e-1;
+ v[0][5][2] = 0.49131622931360879320e-1;
+ v[0][5][3] = 0.35766126849971778501e-1;
+ v[0][5][4] = 0.28037139560980277614e-1;
+ v[0][5][5] = 0.23024181049838367777e-1;
+ v[1][0][0] = 0.17627471740390860505e1;
+ v[1][0][1] = 0.64779357469631903702e0;
+ v[1][0][2] = 0.38259785823210634567e0;
+ v[1][0][3] = 0.26915893322379450224e0;
+ v[1][0][4] = 0.20702239737104695572e0;
+ v[1][0][5] = 0.16800109713227567467e0;
+ v[1][1][0] = 0.11149535993427670134e1;
+ v[1][1][1] = 0.37165119978092233782e0;
+ v[1][1][2] = 0.21243947071963858053e0;
+ v[1][1][3] = 0.14726379157404849573e0;
+ v[1][1][4] = 0.11236373700291582202e0;
+ v[1][1][5] = 0.90737303111246235871e-1;
+ v[1][2][0] = 0.84975788287855432210e0;
+ v[1][2][1] = 0.26566721237799340376e0;
+ v[1][2][2] = 0.14884907827788122009e0;
+ v[1][2][3] = 0.10231567218303765515e0;
+ v[1][2][4] = 0.77727703422280083352e-1;
+ v[1][2][5] = 0.62605132021577676395e-1;
+ v[1][3][0] = 0.69800109142265347423e0;
+ v[1][3][1] = 0.20794647083778622837e0;
+ v[1][3][2] = 0.11487965864809909847e0;
+ v[1][3][3] = 0.78525390514866270852e-1;
+ v[1][3][4] = 0.59489228415223897572e-1;
+ v[1][3][5] = 0.47838457013298217744e-1;
+ v[1][4][0] = 0.59754668912231692323e0;
+ v[1][4][1] = 0.17125249387868593878e0;
+ v[1][4][2] = 0.93606816359052444729e-1;
+ v[1][4][3] = 0.63728830247554475330e-1;
+ v[1][4][4] = 0.48187332620207367724e-1;
+ v[1][4][5] = 0.38708290797416359020e-1;
+ v[1][5][0] = 0.52527944036356840363e0;
+ v[1][5][1] = 0.14574366656617935708e0;
+ v[1][5][2] = 0.78997159795636003667e-1;
+ v[1][5][3] = 0.53620816423066464705e-1;
+ v[1][5][4] = 0.40487985967086264433e-1;
+ v[1][5][5] = 0.32498604596082509165e-1;
+ v[2][0][0] = 0.17627471740390860505e1;
+ v[2][0][1] = 0.11149535993427670134e1;
+ v[2][0][2] = 0.84975788287855432210e0;
+ v[2][0][3] = 0.69800109142265347419e0;
+ v[2][0][4] = 0.59754668912231692318e0;
+ v[2][0][5] = 0.52527944036356840362e0;
+ v[2][1][0] = 0.64779357469631903702e0;
+ v[2][1][1] = 0.37165119978092233782e0;
+ v[2][1][2] = 0.26566721237799340376e0;
+ v[2][1][3] = 0.20794647083778622835e0;
+ v[2][1][4] = 0.17125249387868593876e0;
+ v[2][1][5] = 0.14574366656617935708e0;
+ v[2][2][0] = 0.38259785823210634567e0;
+ v[2][2][1] = 0.21243947071963858053e0;
+ v[2][2][2] = 0.14884907827788122009e0;
+ v[2][2][3] = 0.11487965864809909845e0;
+ v[2][2][4] = 0.93606816359052444712e-1;
+ v[2][2][5] = 0.78997159795636003667e-1;
+ v[2][3][0] = 0.26915893322379450223e0;
+ v[2][3][1] = 0.14726379157404849572e0;
+ v[2][3][2] = 0.10231567218303765514e0;
+ v[2][3][3] = 0.78525390514866270835e-1;
+ v[2][3][4] = 0.63728830247554475311e-1;
+ v[2][3][5] = 0.53620816423066464702e-1;
+ v[2][4][0] = 0.20702239737104695572e0;
+ v[2][4][1] = 0.11236373700291582202e0;
+ v[2][4][2] = 0.77727703422280083352e-1;
+ v[2][4][3] = 0.59489228415223897563e-1;
+ v[2][4][4] = 0.48187332620207367713e-1;
+ v[2][4][5] = 0.40487985967086264434e-1;
+ v[2][5][0] = 0.16800109713227567468e0;
+ v[2][5][1] = 0.90737303111246235879e-1;
+ v[2][5][2] = 0.62605132021577676399e-1;
+ v[2][5][3] = 0.47838457013298217740e-1;
+ v[2][5][4] = 0.38708290797416359014e-1;
+ v[2][5][5] = 0.32498604596082509169e-1;
+ v[3][0][0] = 0.17627471740390860505e1;
+ v[3][0][1] = 0.11149535993427670134e1;
+ v[3][0][2] = 0.84975788287855432210e0;
+ v[3][0][3] = 0.69800109142265347419e0;
+ v[3][0][4] = 0.59754668912231692318e0;
+ v[3][0][5] = 0.52527944036356840362e0;
+ v[3][1][0] = 0.11149535993427670134e1;
+ v[3][1][1] = 0.74330239956184467563e0;
+ v[3][1][2] = 0.58409067050056091834e0;
+ v[3][1][3] = 0.49005462058486724584e0;
+ v[3][1][4] = 0.42629419524363098443e0;
+ v[3][1][5] = 0.37953577379738904654e0;
+ v[3][2][0] = 0.84975788287855432210e0;
+ v[3][2][1] = 0.58409067050056091834e0;
+ v[3][2][2] = 0.46727253640044873467e0;
+ v[3][2][3] = 0.39698780839518011595e0;
+ v[3][2][4] = 0.34864851772399749038e0;
+ v[3][2][5] = 0.31278926702684569312e0;
+ v[3][3][0] = 0.69800109142265347423e0;
+ v[3][3][1] = 0.49005462058486724586e0;
+ v[3][3][2] = 0.39698780839518011599e0;
+ v[3][3][3] = 0.34027526433872581371e0;
+ v[3][3][4] = 0.30088082631586196583e0;
+ v[3][3][5] = 0.27141910362887187844e0;
+ v[3][4][0] = 0.59754668912231692323e0;
+ v[3][4][1] = 0.42629419524363098445e0;
+ v[3][4][2] = 0.34864851772399749044e0;
+ v[3][4][3] = 0.30088082631586196576e0;
+ v[3][4][4] = 0.26744962339187730308e0;
+ v[3][4][5] = 0.24229245314748740295e0;
+ v[3][5][0] = 0.52527944036356840363e0;
+ v[3][5][1] = 0.37953577379738904655e0;
+ v[3][5][2] = 0.31278926702684569301e0;
+ v[3][5][3] = 0.27141910362887187862e0;
+ v[3][5][4] = 0.24229245314748740263e0;
+ v[3][5][5] = 0.22026586649771582089e0;
+ }
+ return v[vertex_index][i][j];
+}
template<int dim, int spacedim>
void test(const unsigned int refs,
- const unsigned int degree,
- const unsigned int subdivisions) {
+ const unsigned int degree,
+ const unsigned int subdivisions)
+{
const unsigned int id = degree+10*refs+100*subdivisions;
-
+
Triangulation<dim, spacedim> triangulation;
FE_Q<dim, spacedim> fe(degree);
scal_sol.reinit (dof_handler.n_dofs());
scal_sol = 1;
VectorTools::get_position_vector(map_dh,euler_vec);
-
+
MappingFEField<dim, spacedim> mapping(map_dh,euler_vec);;
DataOut<dim, DoFHandler<dim, spacedim> > data_out_scal;
data_out_scal.attach_dof_handler (dof_handler);
data_out_scal.add_data_vector (scal_sol, "scalar_data",
- DataOut<dim,DoFHandler<dim, spacedim> >::type_dof_data);
+ DataOut<dim,DoFHandler<dim, spacedim> >::type_dof_data);
data_out_scal.build_patches(mapping,
subdivisions,
data_out_euler.attach_dof_handler (map_dh);
data_out_euler.add_data_vector (euler_vec, "euler_vec",
- DataOut<dim, DoFHandler<dim, spacedim> >::type_dof_data, data_component_interpretation);
+ DataOut<dim, DoFHandler<dim, spacedim> >::type_dof_data, data_component_interpretation);
data_out_euler.build_patches(mapping,
- degree,
- DataOut<dim, DoFHandler<dim, spacedim> >::curved_inner_cells);
+ degree,
+ DataOut<dim, DoFHandler<dim, spacedim> >::curved_inner_cells);
std::string filename_euler = ( "euler_check_"+ Utilities::int_to_string(id) + ".vtu" );
std::ofstream file_euler(filename_euler.c_str());
boundary_ids.insert(0);
GridGenerator::extract_boundary_mesh (volume_mesh, triangulation,
- boundary_ids);
+ boundary_ids);
triangulation.set_boundary (0);
GridTools::transform (&warp<3>, triangulation);
<< tr2.n_active_cells()
<< std::endl;
deallog << "Checksum: "
- << tr.get_checksum ()
- << std::endl;
+ << tr.get_checksum ()
+ << std::endl;
assert_tria_equal(tr, tr2);
template<int dim>
void test(const char *filename)
{
- const char * p = strrchr(filename,'/');
+ const char *p = strrchr(filename,'/');
deallog.push (p);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
gi.attach_triangulation (tr);
std::ifstream in (SOURCE_DIR "/../grid/grid_in_3d/4.in");
gi.read_xda (in);
- //tr.refine_global (1);
+ //tr.refine_global (1);
}
{
gi.attach_triangulation (tr2);
std::ifstream in (SOURCE_DIR "/../grid/grid_in_3d/4.in");
gi.read_xda (in);
- //tr2.refine_global (1);
+ //tr2.refine_global (1);
}
Assert (tr.n_active_cells() == tr2.n_active_cells(),
<< tr2.n_active_cells()
<< std::endl;
deallog << "Checksum: "
- << tr.get_checksum ()
- << std::endl;
+ << tr.get_checksum ()
+ << std::endl;
assert_tria_equal(tr, tr2);
initlog();
deallog.push("2-3");
- test<2,3>(deallog.get_file_stream());
+ test<2,3>(deallog.get_file_stream());
deallog.pop();
}
cell->get_dof_indices (local_dof_indices);
constraints.distribute_local_to_global (cell_matrix,
- cell_rhs,
- local_dof_indices,
- system_matrix,
- system_rhs);
+ cell_rhs,
+ local_dof_indices,
+ system_matrix,
+ system_rhs);
}
}
deallog << " Number of active cells: "
- << triangulation.n_active_cells()
- << std::endl;
+ << triangulation.n_active_cells()
+ << std::endl;
setup_system ();
deallog << " Number of degrees of freedom: "
- << dof_handler.n_dofs()
- << std::endl;
+ << dof_handler.n_dofs()
+ << std::endl;
assemble_system ();
solve ();
{
fe_values.reinit (cell);
fe_values.get_present_fe_values().get_function_gradients (solution,
- solution_gradients);
+ solution_gradients);
unsigned int q_point = 0;
for (; q_point<solution_gradients.size(); ++q_point)
Threads::Mutex mutex;
Threads::ThreadGroup<> threads;
for (unsigned int thread=0; thread<n_threads; ++thread)
- threads += Threads::new_thread (&Solver<dim>::assemble_matrix, *this,
- linear_system,
- thread_ranges[thread].first,
- thread_ranges[thread].second,
- mutex);
+ threads += Threads::new_thread (&Solver<dim>::assemble_matrix, *this,
+ linear_system,
+ thread_ranges[thread].first,
+ thread_ranges[thread].second,
+ mutex);
assemble_rhs (linear_system.rhs);
linear_system.hanging_node_constraints.condense (linear_system.rhs);
= &DoFTools::make_hanging_node_constraints;
Threads::Thread<>
- mhnc_thread = Threads::new_thread (mhnc_p, dof_handler, hanging_node_constraints);
+ mhnc_thread = Threads::new_thread (mhnc_p, dof_handler, hanging_node_constraints);
sparsity_pattern.reinit (dof_handler.n_dofs(),
dof_handler.n_dofs(),
Threads::ThreadGroup<> threads;
for (unsigned int i=0; i<n_threads; ++i)
threads += Threads::new_thread (&WeightedResidual<dim>::estimate_some, *this,
- primal_solution,
- dual_weights,
- n_threads, i,
- error_indicators,
- face_integrals);
+ primal_solution,
+ dual_weights,
+ n_threads, i,
+ error_indicators,
+ face_integrals);
threads.join_all();
unsigned int present_cell=0;
fe_values.get_present_fe_values().get_function_values (present_solution,
local_solution_values);
fe_values.get_present_fe_values().get_function_gradients (present_solution,
- local_solution_grads);
+ local_solution_grads);
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
{
fe_values.get_present_fe_values().get_function_values (function,
local_solution_values);
fe_values.get_present_fe_values().get_function_gradients (function,
- local_solution_grads);
+ local_solution_grads);
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
energy += (std::pow (fe_values.get_present_fe_values().quadrature_point(q_point)(0)
{
FE_BDM<dim> fe_rt(degree);
deallog.push(fe_rt.get_name());
-
+
const unsigned int div=2;
for (unsigned int mz=0; mz<=((dim>2) ? div : 0) ; ++mz)
for (unsigned int my=0; my<=((dim>1) ? div : 0) ; ++my)
plot_shape_functions<2>(degree);
plot_shape_functions<3>(degree);
}
-
+
return 0;
}
{
switch (transform)
{
- // first round: take
- // original grid
+ // first round: take
+ // original grid
case 0:
break;
- // second round: rotate
- // triangulation
+ // second round: rotate
+ // triangulation
case 1:
GridTools::rotate (3.14159265358/2, tria);
break;
- // third round: inflate
- // by a factor of 2
+ // third round: inflate
+ // by a factor of 2
case 2:
GridTools::scale (2, tria);
break;
- // third round: scale
- // back, rotate back,
- // stretch
+ // third round: scale
+ // back, rotate back,
+ // stretch
case 3:
GridTools::scale (.5, tria);
GridTools::rotate (-3.14159265358/2, tria);
{
plot_shape_functions<2>(degree);
}
-
+
return 0;
}
test<2>(degree);
test<3>(degree);
}
-
+
return 0;
}
test<2>(i);
test<3>(i);
}
-
+
return 0;
}
test<2>(i);
test<3>(i);
}
-
+
return 0;
}
#2 0x00007ffff4f95895 in dealii::deal_II_exceptions::internals::abort (exc=..., nothrow=false)
at /ssd/deal-trunk/deal.II/source/base/exceptions.cc:323
#3 0x00007ffff18ef959 in dealii::deal_II_exceptions::internals::issue_error<dealii::StandardExceptions::ExcIndexRange> (
- handling=dealii::deal_II_exceptions::internals::abort_on_exception, file=0x7ffff6035000 "/ssd/deal-trunk/deal.II/source/fe/fe.cc",
- line=557,
- function=0x7ffff6039240 "unsigned int dealii::FiniteElement<dim, spacedim>::face_to_cell_index(unsigned int, unsigned int, bool, bool, bool) const [with int dim = 3, int spacedim = 3]", cond=0x7ffff6035db0 "face_index < this->dofs_per_face",
+ handling=dealii::deal_II_exceptions::internals::abort_on_exception, file=0x7ffff6035000 "/ssd/deal-trunk/deal.II/source/fe/fe.cc",
+ line=557,
+ function=0x7ffff6039240 "unsigned int dealii::FiniteElement<dim, spacedim>::face_to_cell_index(unsigned int, unsigned int, bool, bool, bool) const [with int dim = 3, int spacedim = 3]", cond=0x7ffff6035db0 "face_index < this->dofs_per_face",
exc_name=0x7ffff6035d78 "ExcIndexRange(face_index, 0, this->dofs_per_face)", e=...)
at /ssd/deal-trunk/deal.II/include/deal.II/base/exceptions.h:272
-#4 0x00007ffff31708c1 in dealii::FiniteElement<3, 3>::face_to_cell_index (this=0xa16f70, face_index=4, face=0, face_orientation=true,
+#4 0x00007ffff31708c1 in dealii::FiniteElement<3, 3>::face_to_cell_index (this=0xa16f70, face_index=4, face=0, face_orientation=true,
face_flip=false, face_rotation=false) at /ssd/deal-trunk/deal.II/source/fe/fe.cc:556
-#5 0x00007ffff2d7fe1c in dealii::VectorTools::internals::compute_edge_projection<dealii::TriaActiveIterator<dealii::DoFCellAccessor<dealii::DoFHandler<3, 3>, false> > > (cell=..., face=0, line=3, hp_fe_values=..., boundary_function=..., first_vector_component=0,
+#5 0x00007ffff2d7fe1c in dealii::VectorTools::internals::compute_edge_projection<dealii::TriaActiveIterator<dealii::DoFCellAccessor<dealii::DoFHandler<3, 3>, false> > > (cell=..., face=0, line=3, hp_fe_values=..., boundary_function=..., first_vector_component=0,
dof_values=std::vector of length 8, capacity 8 = {...}, dofs_processed=std::vector<bool> of length 8, capacity 64 = {...})
at /ssd/deal-trunk/deal.II/include/deal.II/numerics/vector_tools.templates.h:2944
-#6 0x00007ffff2d77846 in dealii::VectorTools::project_boundary_values_curl_conforming<3> (dof_handler=..., first_vector_component=0,
+#6 0x00007ffff2d77846 in dealii::VectorTools::project_boundary_values_curl_conforming<3> (dof_handler=..., first_vector_component=0,
boundary_function=..., boundary_component=0 '\000', constraints=..., mapping=...)
at /ssd/deal-trunk/deal.II/include/deal.II/numerics/vector_tools.templates.h:3543
#7 0x000000000042b479 in test<3> (fe=...) at /ssd/deal-trunk/tests/fe/crash_01.cc:74
/*
Test by Ross Kynch:
-
+
Solves curl(curl(u)) + u = f in 2D
-
+
exact solution is given by:
u(0) = cos(pi*x)*sin(pi*y) + C
u(1) = -sin(pi*x)*cos(pi(y) + C
-
+
f(0) = (2*pi^2 + 1)*cos(pi*x)*sin(pi*x) + C
f(1) = -(2*pi^2 + 1)*sin(pi*x)*cos(pi(y) + C
-
+
where C is some constant. (To change C, edit bc_constant in ExactSolution and
RightHandSide classes.)
The test solves these equations using the Nedelec element of higher order and
computes the error.
-
+
*/
#include "../tests.h"
#include <deal.II/base/quadrature_lib.h>
class MaxwellProblem
{
public:
- MaxwellProblem (const unsigned int order);
- ~MaxwellProblem ();
- void run ();
+ MaxwellProblem (const unsigned int order);
+ ~MaxwellProblem ();
+ void run ();
private:
- double dotprod(const Tensor<1,dim> &A, const Tensor<1,dim> &B) const;
- double dotprod(const Tensor<1,dim> &A, const Vector<double> &B) const;
- void setup_system ();
- void assemble_system ();
- void solve ();
- void process_solution(const unsigned int cycle);
- Triangulation<dim> triangulation;
- DoFHandler<dim> dof_handler;
- FE_Nedelec<dim> fe;
- ConstraintMatrix constraints;
- SparsityPattern sparsity_pattern;
- SparseMatrix<double> system_matrix;
- Vector<double> solution;
- Vector<double> system_rhs;
-
- unsigned int p_order;
- unsigned int quad_order;
-
- ConvergenceTable convergence_table;
+ double dotprod(const Tensor<1,dim> &A, const Tensor<1,dim> &B) const;
+ double dotprod(const Tensor<1,dim> &A, const Vector<double> &B) const;
+ void setup_system ();
+ void assemble_system ();
+ void solve ();
+ void process_solution(const unsigned int cycle);
+ Triangulation<dim> triangulation;
+ DoFHandler<dim> dof_handler;
+ FE_Nedelec<dim> fe;
+ ConstraintMatrix constraints;
+ SparsityPattern sparsity_pattern;
+ SparseMatrix<double> system_matrix;
+ Vector<double> solution;
+ Vector<double> system_rhs;
+
+ unsigned int p_order;
+ unsigned int quad_order;
+
+ ConvergenceTable convergence_table;
};
// EXACT SOLUTION CLASS
template<int dim>
class ExactSolution : public Function<dim>
{
public:
- ExactSolution() : Function<dim>() {}
- virtual double value (const Point<dim> &p,
- const unsigned int component) const;
- virtual void vector_value (const Point<dim> &p,
- Vector<double> &result) const;
- virtual void value_list (const std::vector<Point<dim> > &points,
- std::vector<double> &values,
- const unsigned int component) const;
- virtual void vector_value_list (const std::vector<Point<dim> > &points,
- std::vector<Vector<double> > &values) const;
+ ExactSolution() : Function<dim>() {}
+ virtual double value (const Point<dim> &p,
+ const unsigned int component) const;
+ virtual void vector_value (const Point<dim> &p,
+ Vector<double> &result) const;
+ virtual void value_list (const std::vector<Point<dim> > &points,
+ std::vector<double> &values,
+ const unsigned int component) const;
+ virtual void vector_value_list (const std::vector<Point<dim> > &points,
+ std::vector<Vector<double> > &values) const;
private:
- static const double bc_constant;
+ static const double bc_constant;
};
template <int dim> const double ExactSolution<dim>::bc_constant = 0.1;
class RightHandSide : public Function<dim>
{
public:
- RightHandSide ();
- virtual void vector_value (const Point<dim> &p,
- Vector<double> &values) const;
- virtual void vector_value_list (const std::vector<Point<dim> > &points,
- std::vector<Vector<double> > &value_list) const;
+ RightHandSide ();
+ virtual void vector_value (const Point<dim> &p,
+ Vector<double> &values) const;
+ virtual void vector_value_list (const std::vector<Point<dim> > &points,
+ std::vector<Vector<double> > &value_list) const;
private:
- static const double bc_constant;
+ static const double bc_constant;
};
template <int dim> const double RightHandSide<dim>::bc_constant = 0.1;
double ExactSolution<dim>::value(const Point<dim> &p,
const unsigned int component) const
{
- Assert (dim >= 2, ExcNotImplemented());
- AssertIndexRange(component, dim);
-
- double val = -1000;
- switch(component) {
- case 0: val = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
- case 1: val = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
+ Assert (dim >= 2, ExcNotImplemented());
+ AssertIndexRange(component, dim);
+
+ double val = -1000;
+ switch (component)
+ {
+ case 0:
+ val = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
+ case 1:
+ val = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
}
- return val;
-
+ return val;
+
}
template<int dim>
void ExactSolution<dim>::vector_value(const Point<dim> &p,
Vector<double> &result) const
{
- Assert(dim >= 2, ExcNotImplemented());
- result(0) = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
- result(1) = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
-
+ Assert(dim >= 2, ExcNotImplemented());
+ result(0) = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
+ result(1) = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
+
}
template <int dim>
void ExactSolution<dim>::value_list (const std::vector<Point<dim> > &points,
std::vector<double> &values,
const unsigned int component) const
{
- Assert (values.size() == points.size(), ExcDimensionMismatch(values.size(), points.size()));
- AssertIndexRange(component, dim);
- for (unsigned int i=0; i<points.size(); ++i)
+ Assert (values.size() == points.size(), ExcDimensionMismatch(values.size(), points.size()));
+ AssertIndexRange(component, dim);
+ for (unsigned int i=0; i<points.size(); ++i)
{
- const Point<dim> &p = points[i];
- switch(component)
+ const Point<dim> &p = points[i];
+ switch (component)
{
- case 0:
- values[i] = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
- case 1:
- values[i] = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
+ case 0:
+ values[i] = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
+ case 1:
+ values[i] = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
}
}
}
void ExactSolution<dim>::vector_value_list (const std::vector<Point<dim> > &points,
std::vector<Vector<double> > &values) const
{
- Assert (dim >= 2, ExcNotImplemented());
- Assert (values.size() == points.size(), ExcDimensionMismatch(values.size(), points.size()));
-
- for (unsigned int i=0; i<points.size(); ++i)
+ Assert (dim >= 2, ExcNotImplemented());
+ Assert (values.size() == points.size(), ExcDimensionMismatch(values.size(), points.size()));
+
+ for (unsigned int i=0; i<points.size(); ++i)
{
- const Point<dim> &p = points[i];
- values[i](0) = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
- values[i](1) = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
+ const Point<dim> &p = points[i];
+ values[i](0) = cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
+ values[i](1) = -sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
}
}
// END EXACT SOLUTION MEMBERS
// DEFINE RIGHT HAND SIDE MEMBERS
template <int dim>
RightHandSide<dim>::RightHandSide () :
-Function<dim> (dim)
+ Function<dim> (dim)
{}
template <int dim>
inline
void RightHandSide<dim>::vector_value (const Point<dim> &p,
Vector<double> &values) const
{
- Assert (values.size() == dim, ExcDimensionMismatch (values.size(), dim));
- Assert (dim >= 2, ExcNotImplemented());
-
- //2D solution
- values(0) = (2*numbers::PI*numbers::PI + 1)*cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
- values(1) = -(2*numbers::PI*numbers::PI + 1)*sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
+ Assert (values.size() == dim, ExcDimensionMismatch (values.size(), dim));
+ Assert (dim >= 2, ExcNotImplemented());
+
+ //2D solution
+ values(0) = (2*numbers::PI*numbers::PI + 1)*cos(numbers::PI*p(0))*sin(numbers::PI*p(1)) + bc_constant;
+ values(1) = -(2*numbers::PI*numbers::PI + 1)*sin(numbers::PI*p(0))*cos(numbers::PI*p(1)) + bc_constant;
}
template <int dim>
void RightHandSide<dim>::vector_value_list (const std::vector<Point<dim> > &points,
std::vector<Vector<double> > &value_list) const
{
- Assert (value_list.size() == points.size(), ExcDimensionMismatch (value_list.size(), points.size()));
- const unsigned int n_points = points.size();
- for (unsigned int p=0; p<n_points; ++p)
+ Assert (value_list.size() == points.size(), ExcDimensionMismatch (value_list.size(), points.size()));
+ const unsigned int n_points = points.size();
+ for (unsigned int p=0; p<n_points; ++p)
{
- RightHandSide<dim>::vector_value (points[p], value_list[p]);
+ RightHandSide<dim>::vector_value (points[p], value_list[p]);
}
}
// END RIGHT HAND SIDE MEMBERS
template <int dim>
MaxwellProblem<dim>::MaxwellProblem (const unsigned int order)
-:
-dof_handler (triangulation),
-fe (order)
+ :
+ dof_handler (triangulation),
+ fe (order)
{
- p_order = order;
- quad_order = p_order+2;
+ p_order = order;
+ quad_order = p_order+2;
}
template <int dim>
MaxwellProblem<dim>::~MaxwellProblem ()
{
- dof_handler.clear ();
+ dof_handler.clear ();
}
template<int dim>
double MaxwellProblem<dim>::dotprod(const Tensor<1,dim> &A, const Tensor<1,dim> &B) const
{
- double return_val = 0;
- for(unsigned int k = 0; k < dim; k++) {
- return_val += A[k]*B[k];
+ double return_val = 0;
+ for (unsigned int k = 0; k < dim; k++)
+ {
+ return_val += A[k]*B[k];
}
- return return_val;
+ return return_val;
}
template<int dim>
double MaxwellProblem<dim>::dotprod(const Tensor<1,dim> &A, const Vector<double> &B) const
{
- double return_val = 0;
- for(unsigned int k = 0; k < dim; k++) {
- return_val += A[k]*B(k);
+ double return_val = 0;
+ for (unsigned int k = 0; k < dim; k++)
+ {
+ return_val += A[k]*B(k);
}
- return return_val;
+ return return_val;
}
template <int dim>
void MaxwellProblem<dim>::setup_system ()
{
- dof_handler.distribute_dofs (fe);
- solution.reinit (dof_handler.n_dofs());
- system_rhs.reinit (dof_handler.n_dofs());
- constraints.clear ();
- DoFTools::make_hanging_node_constraints (dof_handler,
- constraints);
- // FE_Nedelec boundary condition.
- VectorTools::project_boundary_values_curl_conforming(dof_handler, 0, ExactSolution<dim>(), 0, constraints);
-
- constraints.close ();
- CompressedSparsityPattern c_sparsity(dof_handler.n_dofs());
- DoFTools::make_sparsity_pattern(dof_handler,
- c_sparsity,
- constraints,false);
-
- sparsity_pattern.copy_from(c_sparsity);
- system_matrix.reinit (sparsity_pattern);
+ dof_handler.distribute_dofs (fe);
+ solution.reinit (dof_handler.n_dofs());
+ system_rhs.reinit (dof_handler.n_dofs());
+ constraints.clear ();
+ DoFTools::make_hanging_node_constraints (dof_handler,
+ constraints);
+ // FE_Nedelec boundary condition.
+ VectorTools::project_boundary_values_curl_conforming(dof_handler, 0, ExactSolution<dim>(), 0, constraints);
+
+ constraints.close ();
+ CompressedSparsityPattern c_sparsity(dof_handler.n_dofs());
+ DoFTools::make_sparsity_pattern(dof_handler,
+ c_sparsity,
+ constraints,false);
+
+ sparsity_pattern.copy_from(c_sparsity);
+ system_matrix.reinit (sparsity_pattern);
}
template <int dim>
void MaxwellProblem<dim>::assemble_system ()
{
- const QGauss<dim> quadrature_formula(quad_order);
- FEValues<dim> fe_values (fe, quadrature_formula,
- update_values | update_gradients |
- update_quadrature_points | update_JxW_values);
- FEValuesViews::Vector<dim> fe_views(fe_values, 0);
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.size();
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
- std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
-
- RightHandSide<dim> right_hand_side;
- std::vector<Vector<double> > rhs_values (n_q_points,
- Vector<double>(dim));
- Tensor<1,dim> value_i, value_j;
-
- typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
- for (; cell!=endc; ++cell)
+ const QGauss<dim> quadrature_formula(quad_order);
+ FEValues<dim> fe_values (fe, quadrature_formula,
+ update_values | update_gradients |
+ update_quadrature_points | update_JxW_values);
+ FEValuesViews::Vector<dim> fe_views(fe_values, 0);
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.size();
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+
+ RightHandSide<dim> right_hand_side;
+ std::vector<Vector<double> > rhs_values (n_q_points,
+ Vector<double>(dim));
+ Tensor<1,dim> value_i, value_j;
+
+ typename DoFHandler<dim>::active_cell_iterator
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
+ for (; cell!=endc; ++cell)
{
- cell_matrix = 0;
- cell_rhs = 0;
- fe_values.reinit (cell);
- right_hand_side.vector_value_list (fe_values.get_quadrature_points(),
- rhs_values);
- for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+ cell_matrix = 0;
+ cell_rhs = 0;
+ fe_values.reinit (cell);
+ right_hand_side.vector_value_list (fe_values.get_quadrature_points(),
+ rhs_values);
+ for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
{
- for (unsigned int i=0; i<dofs_per_cell; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
- value_i[0] = fe_values.shape_value_component(i,q_point,0);
- value_i[1] = fe_values.shape_value_component(i,q_point,1);
- if (dim == 3) {
- value_i[2] = fe_values.shape_value_component(i,q_point,2);
+ value_i[0] = fe_values.shape_value_component(i,q_point,0);
+ value_i[1] = fe_values.shape_value_component(i,q_point,1);
+ if (dim == 3)
+ {
+ value_i[2] = fe_values.shape_value_component(i,q_point,2);
}
- for (unsigned int j=0; j<dofs_per_cell; ++j)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
{
- value_j[0] = fe_values.shape_value_component(j,q_point,0);
- value_j[1] = fe_values.shape_value_component(j,q_point,1);
- if (dim == 3) {
- value_j[2] = fe_values.shape_value_component(j,q_point,2);
+ value_j[0] = fe_values.shape_value_component(j,q_point,0);
+ value_j[1] = fe_values.shape_value_component(j,q_point,1);
+ if (dim == 3)
+ {
+ value_j[2] = fe_values.shape_value_component(j,q_point,2);
}
- cell_matrix(i,j) += ( fe_views.curl(i,q_point)[0]*fe_views.curl(j,q_point)[0]
- + dotprod(value_i,value_j) )*fe_values.JxW(q_point);
-
-
+ cell_matrix(i,j) += ( fe_views.curl(i,q_point)[0]*fe_views.curl(j,q_point)[0]
+ + dotprod(value_i,value_j) )*fe_values.JxW(q_point);
+
+
}
- cell_rhs(i) += dotprod(value_i,rhs_values[q_point])*fe_values.JxW(q_point);
+ cell_rhs(i) += dotprod(value_i,rhs_values[q_point])*fe_values.JxW(q_point);
}
}
- cell->get_dof_indices (local_dof_indices);
- constraints.distribute_local_to_global(cell_matrix,
- cell_rhs,
- local_dof_indices,
- system_matrix, system_rhs);
+ cell->get_dof_indices (local_dof_indices);
+ constraints.distribute_local_to_global(cell_matrix,
+ cell_rhs,
+ local_dof_indices,
+ system_matrix, system_rhs);
}
}
template <int dim>
preconditioner);
constraints.distribute (solution);
*/
-
- SparseDirectUMFPACK A_direct;
- A_direct.initialize(system_matrix);
-
- A_direct.vmult (solution, system_rhs);
- constraints.distribute (solution);
-
+
+ SparseDirectUMFPACK A_direct;
+ A_direct.initialize(system_matrix);
+
+ A_direct.vmult (solution, system_rhs);
+ constraints.distribute (solution);
+
}
template<int dim>
void MaxwellProblem<dim>::process_solution(const unsigned int cycle)
{
- const ExactSolution<dim> exact_solution;
- Vector<double> diff_per_cell(triangulation.n_active_cells());
- VectorTools::integrate_difference(dof_handler, solution, exact_solution,
- diff_per_cell, QGauss<dim>(quad_order), VectorTools::L2_norm);
- const double L2_error = diff_per_cell.l2_norm();
-
- convergence_table.add_value("cycle", cycle);
- convergence_table.add_value("cells", triangulation.n_active_cells());
- convergence_table.add_value("dofs", dof_handler.n_dofs());
- convergence_table.add_value("L2 Error", L2_error);
+ const ExactSolution<dim> exact_solution;
+ Vector<double> diff_per_cell(triangulation.n_active_cells());
+ VectorTools::integrate_difference(dof_handler, solution, exact_solution,
+ diff_per_cell, QGauss<dim>(quad_order), VectorTools::L2_norm);
+ const double L2_error = diff_per_cell.l2_norm();
+
+ convergence_table.add_value("cycle", cycle);
+ convergence_table.add_value("cells", triangulation.n_active_cells());
+ convergence_table.add_value("dofs", dof_handler.n_dofs());
+ convergence_table.add_value("L2 Error", L2_error);
}
template <int dim>
void MaxwellProblem<dim>::run ()
{
- for (unsigned int cycle=0; cycle<3; ++cycle)
+ for (unsigned int cycle=0; cycle<3; ++cycle)
{
- if (cycle == 0)
+ if (cycle == 0)
{
- GridGenerator::hyper_cube (triangulation, -1, 1);
- triangulation.refine_global (2);
+ GridGenerator::hyper_cube (triangulation, -1, 1);
+ triangulation.refine_global (2);
}
- else
- triangulation.refine_global (1);
- setup_system ();
- assemble_system ();
- solve ();
- process_solution (cycle);
+ else
+ triangulation.refine_global (1);
+ setup_system ();
+ assemble_system ();
+ solve ();
+ process_solution (cycle);
}
- convergence_table.set_precision("L2 Error",8);
- convergence_table.set_scientific("L2 Error",true);
- convergence_table.write_text(deallog.get_file_stream());
+ convergence_table.set_precision("L2 Error",8);
+ convergence_table.set_scientific("L2 Error",true);
+ convergence_table.write_text(deallog.get_file_stream());
}
int main ()
deallog << "Face=" << face << std::endl;
for (int flip=0; flip<2; ++flip)
- {
- deallog << " flip=" << (flip == 0 ? "false" : "true")
- << std::endl
- << " ";
- for (unsigned int i = 0; i < dofs_per_face; ++i)
- deallog << fe.face_to_cell_index(i, face,
- true,
- (flip == 0 ? false : true),
- false) << " - ";
- deallog << std::endl;
- }
+ {
+ deallog << " flip=" << (flip == 0 ? "false" : "true")
+ << std::endl
+ << " ";
+ for (unsigned int i = 0; i < dofs_per_face; ++i)
+ deallog << fe.face_to_cell_index(i, face,
+ true,
+ (flip == 0 ? false : true),
+ false) << " - ";
+ deallog << std::endl;
+ }
}
}
deallog << "Face=" << face << std::endl;
for (int flip=0; flip<2; ++flip)
- {
- deallog << " flip=" << (flip == 0 ? "false" : "true")
- << std::endl
- << " ";
- for (unsigned int i = 0; i < dofs_per_face; ++i)
- deallog << fe.face_to_cell_index(i, face,
- true,
- (flip == 0 ? false : true),
- false) << " - ";
- deallog << std::endl;
- }
+ {
+ deallog << " flip=" << (flip == 0 ? "false" : "true")
+ << std::endl
+ << " ";
+ for (unsigned int i = 0; i < dofs_per_face; ++i)
+ deallog << fe.face_to_cell_index(i, face,
+ true,
+ (flip == 0 ? false : true),
+ false) << " - ";
+ deallog << std::endl;
+ }
}
}
void test()
{
FESystem<dim> fe(FE_Q<dim>(2), 1,
- FE_Q<dim>(2), 1);
+ FE_Q<dim>(2), 1);
const unsigned int dofs_per_face = fe.dofs_per_face;
for (unsigned int face=0; face<4; ++face)
deallog << "Face=" << face << std::endl;
for (int flip=0; flip<2; ++flip)
- {
- deallog << " flip=" << (flip == 0 ? "false" : "true")
- << std::endl
- << " ";
- for (unsigned int i = 0; i < dofs_per_face; ++i)
- deallog << fe.face_to_cell_index(i, face,
- true,
- (flip == 0 ? false : true),
- false) << " - ";
- deallog << std::endl;
- }
+ {
+ deallog << " flip=" << (flip == 0 ? "false" : "true")
+ << std::endl
+ << " ";
+ for (unsigned int i = 0; i < dofs_per_face; ++i)
+ deallog << fe.face_to_cell_index(i, face,
+ true,
+ (flip == 0 ? false : true),
+ false) << " - ";
+ deallog << std::endl;
+ }
}
}
deallog << "Face=" << face << std::endl;
for (int flip=0; flip<2; ++flip)
- {
- deallog << " flip=" << (flip == 0 ? "false" : "true")
- << std::endl
- << " ";
- for (unsigned int i = 0; i < dofs_per_face; ++i)
- deallog << fe.face_to_cell_index(i, face,
- true,
- (flip == 0 ? false : true),
- false) << " - ";
- deallog << std::endl;
- }
+ {
+ deallog << " flip=" << (flip == 0 ? "false" : "true")
+ << std::endl
+ << " ";
+ for (unsigned int i = 0; i < dofs_per_face; ++i)
+ deallog << fe.face_to_cell_index(i, face,
+ true,
+ (flip == 0 ? false : true),
+ false) << " - ";
+ deallog << std::endl;
+ }
}
}
void test()
{
FESystem<dim> fe(FE_Q<dim>(3), 1,
- FE_Q<dim>(4), 1);
+ FE_Q<dim>(4), 1);
const unsigned int dofs_per_face = fe.dofs_per_face;
for (unsigned int face=0; face<4; ++face)
deallog << "Face=" << face << std::endl;
for (int flip=0; flip<2; ++flip)
- {
- deallog << " flip=" << (flip == 0 ? "false" : "true")
- << std::endl
- << " ";
- for (unsigned int i = 0; i < dofs_per_face; ++i)
- deallog << fe.face_to_cell_index(i, face,
- true,
- (flip == 0 ? false : true),
- false) << " - ";
- deallog << std::endl;
- }
+ {
+ deallog << " flip=" << (flip == 0 ? "false" : "true")
+ << std::endl
+ << " ";
+ for (unsigned int i = 0; i < dofs_per_face; ++i)
+ deallog << fe.face_to_cell_index(i, face,
+ true,
+ (flip == 0 ? false : true),
+ false) << " - ";
+ deallog << std::endl;
+ }
}
}
deallog << "Face=" << face << std::endl;
for (int flip=0; flip<2; ++flip)
- {
- deallog << " flip=" << (flip == 0 ? "false" : "true")
- << std::endl
- << " ";
- for (unsigned int i = 0; i < dofs_per_face; ++i)
- deallog << fe.face_to_cell_index(i, face,
- true,
- (flip == 0 ? false : true),
- false) << " - ";
- deallog << std::endl;
- }
+ {
+ deallog << " flip=" << (flip == 0 ? "false" : "true")
+ << std::endl
+ << " ";
+ for (unsigned int i = 0; i < dofs_per_face; ++i)
+ deallog << fe.face_to_cell_index(i, face,
+ true,
+ (flip == 0 ? false : true),
+ false) << " - ";
+ deallog << std::endl;
+ }
}
}
template<int dim>
Tensor<1,dim> ones ()
{
- Tensor<1,dim> result;
- for(unsigned int i=0; i<dim; ++i)
- result[i] = 1.0;
- return result;
+ Tensor<1,dim> result;
+ for (unsigned int i=0; i<dim; ++i)
+ result[i] = 1.0;
+ return result;
}
template<int dim>
void test (const Triangulation<dim> &tr,
- const FiniteElement<dim> &fe,
- const double tolerance)
+ const FiniteElement<dim> &fe,
+ const double tolerance)
{
- DoFHandler<dim> dof(tr);
- dof.distribute_dofs(fe);
-
- std::stringstream ss;
-
- deallog << "FE=" << fe.get_name() << std::endl;
-
- const QGauss<dim> quadrature(4);
- FEValues<dim> fe_values (fe, quadrature, update_gradients
- | update_quadrature_points
- | update_JxW_values);
-
- const QGauss<dim-1> face_quadrature(4);
- FEFaceValues<dim> fe_face_values (fe, face_quadrature,
- update_values
- | update_quadrature_points
- | update_normal_vectors
- | update_JxW_values);
-
- for(typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
- cell != dof.end();
- ++cell)
- {
- fe_values.reinit (cell);
-
- deallog << "Cell nodes:" << std::endl;
- for(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- deallog << i << ": ( ";
- for (unsigned int d=0; d<dim; ++d)
- deallog << cell->vertex(i)[d] << " ";
- deallog << ")" << std::endl;
- }
-
- bool cell_ok = true;
-
- for (unsigned int c=0; c<fe.n_components(); ++c)
- {
- FEValuesExtractors::Scalar single_component (c);
-
- for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
- {
- ss << "component=" << c
- << ", dof=" << i
- << std::endl;
-
- Tensor<1,dim> bulk_integral;
- for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
- {
- bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
- }
-
- Tensor<1,dim> boundary_integral;
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- {
- fe_face_values.reinit(cell,face);
- for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
- {
- boundary_integral += fe_face_values[single_component].value (i,q)
- * fe_face_values.normal_vector(q)
- * fe_face_values.JxW(q);
- }
- }
-
- if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
- {
- deallog << "Failed:" << std::endl;
- deallog << ss.str() << std::endl;
- deallog << " bulk integral=" << bulk_integral << std::endl;
- deallog << "boundary integral=" << boundary_integral << std::endl;
- deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
- cell_ok = false;
- }
-
- ss.str("");
- }
- }
-
- deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
- }
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ std::stringstream ss;
+
+ deallog << "FE=" << fe.get_name() << std::endl;
+
+ const QGauss<dim> quadrature(4);
+ FEValues<dim> fe_values (fe, quadrature, update_gradients
+ | update_quadrature_points
+ | update_JxW_values);
+
+ const QGauss<dim-1> face_quadrature(4);
+ FEFaceValues<dim> fe_face_values (fe, face_quadrature,
+ update_values
+ | update_quadrature_points
+ | update_normal_vectors
+ | update_JxW_values);
+
+ for (typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
+ cell != dof.end();
+ ++cell)
+ {
+ fe_values.reinit (cell);
+
+ deallog << "Cell nodes:" << std::endl;
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ deallog << i << ": ( ";
+ for (unsigned int d=0; d<dim; ++d)
+ deallog << cell->vertex(i)[d] << " ";
+ deallog << ")" << std::endl;
+ }
+
+ bool cell_ok = true;
+
+ for (unsigned int c=0; c<fe.n_components(); ++c)
+ {
+ FEValuesExtractors::Scalar single_component (c);
+
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+ {
+ ss << "component=" << c
+ << ", dof=" << i
+ << std::endl;
+
+ Tensor<1,dim> bulk_integral;
+ for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+ {
+ bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
+ }
+
+ Tensor<1,dim> boundary_integral;
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ {
+ fe_face_values.reinit(cell,face);
+ for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
+ {
+ boundary_integral += fe_face_values[single_component].value (i,q)
+ * fe_face_values.normal_vector(q)
+ * fe_face_values.JxW(q);
+ }
+ }
+
+ if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
+ {
+ deallog << "Failed:" << std::endl;
+ deallog << ss.str() << std::endl;
+ deallog << " bulk integral=" << bulk_integral << std::endl;
+ deallog << "boundary integral=" << boundary_integral << std::endl;
+ deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
+ cell_ok = false;
+ }
+
+ ss.str("");
+ }
+ }
+
+ deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
+ }
}
template<int dim>
void test_hyper_cube(const double tolerance)
{
- Triangulation<dim> tr;
- GridGenerator::hyper_cube (tr);
-
- typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
- for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- Point<dim> &point = cell->vertex(i);
- if (std::abs(point(dim-1)-1.0)<1e-5)
- point(dim-1) += 0.15;
- }
-
- FE_ABF<dim> fe(1);
- test(tr, fe, tolerance);
+ Triangulation<dim> tr;
+ GridGenerator::hyper_cube (tr);
+
+ typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ Point<dim> &point = cell->vertex(i);
+ if (std::abs(point(dim-1)-1.0)<1e-5)
+ point(dim-1) += 0.15;
+ }
+
+ FE_ABF<dim> fe(1);
+ test(tr, fe, tolerance);
}
int main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision (3);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
- deallog.attach(logfile);
- deallog.depth_console (0);
- deallog.threshold_double(1.e-7);
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
- test_hyper_cube<2>(1e-6);
+ test_hyper_cube<2>(1e-6);
- deallog << "done..." << std::endl;
+ deallog << "done..." << std::endl;
}
template <int dim>
void test_2d_3d (std::vector<FiniteElement<dim> *> &fe_datas)
{
- // Vector DG elements
+ // Vector DG elements
fe_datas.push_back(new FE_DGRaviartThomas<dim>(0));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
fe_datas.push_back(new FE_DGRaviartThomas<dim>(1));
fe_datas.push_back(new FE_DGNedelec<dim>(1));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
- // Hdiv elements
+ // Hdiv elements
FE_RaviartThomas<dim> *rt0 = new FE_RaviartThomas<dim>(0);
fe_datas.push_back(rt0);
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
fe_datas.push_back(new FE_RaviartThomas<dim>(2));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
fe_datas.push_back(new FESystem<dim>(*rt1, 1,
- FE_DGQ<dim> (1), 1));
+ FE_DGQ<dim> (1), 1));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
fe_datas.push_back(new FE_BDM<dim>(1));
fe_datas.push_back(new FE_BDM<dim>(2));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
- // Hcurl elements
+ // Hcurl elements
FE_Nedelec<dim> *ned0 = new FE_Nedelec<dim>(0);
fe_datas.push_back(ned0);
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
FE_Q<dim> (2), 1));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
- // Face Q elements
+ // Face Q elements
fe_datas.push_back(new FE_FaceQ<dim> (0));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
fe_datas.push_back(new FE_FaceQ<dim> (1));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
fe_datas.push_back(new FE_FaceQ<dim> (3));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
- // Face P elements
+ // Face P elements
fe_datas.push_back(new FE_FaceP<dim> (0));
deallog << (*fe_datas.rbegin())->get_name() << std::endl;
fe_datas.push_back(new FE_FaceP<dim> (1));
template<int dim>
Tensor<1,dim> ones ()
{
- Tensor<1,dim> result;
- for(unsigned int i=0; i<dim; ++i)
- result[i] = 1.0;
- return result;
+ Tensor<1,dim> result;
+ for (unsigned int i=0; i<dim; ++i)
+ result[i] = 1.0;
+ return result;
}
template<int dim>
void test (const Triangulation<dim> &tr,
- const FiniteElement<dim> &fe,
- const double tolerance)
+ const FiniteElement<dim> &fe,
+ const double tolerance)
{
- DoFHandler<dim> dof(tr);
- dof.distribute_dofs(fe);
-
- std::stringstream ss;
-
- deallog << "FE=" << fe.get_name() << std::endl;
-
- const QGauss<dim> quadrature(3);
- FEValues<dim> fe_values (fe, quadrature, update_gradients
- | update_quadrature_points
- | update_JxW_values);
-
- const QGauss<dim-1> face_quadrature(3);
- FEFaceValues<dim> fe_face_values (fe, face_quadrature,
- update_values
- | update_quadrature_points
- | update_normal_vectors
- | update_JxW_values);
-
- for(typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
- cell != dof.end();
- ++cell)
- {
- fe_values.reinit (cell);
-
- deallog << "Cell nodes:" << std::endl;
- for(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- deallog << i << ": ( ";
- for (unsigned int d=0; d<dim; ++d)
- deallog << cell->vertex(i)[d] << " ";
- deallog << ")" << std::endl;
- }
-
- bool cell_ok = true;
-
- for (unsigned int c=0; c<fe.n_components(); ++c)
- {
- FEValuesExtractors::Scalar single_component (c);
-
- for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
- {
- ss << "component=" << c
- << ", dof=" << i
- << std::endl;
-
- Tensor<1,dim> bulk_integral;
- for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
- {
- bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
- }
-
- Tensor<1,dim> boundary_integral;
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- {
- fe_face_values.reinit(cell,face);
- for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
- {
- boundary_integral += fe_face_values[single_component].value (i,q)
- * fe_face_values.normal_vector(q)
- * fe_face_values.JxW(q);
- }
- }
-
- if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
- {
- deallog << "Failed:" << std::endl;
- deallog << ss.str() << std::endl;
- deallog << " bulk integral=" << bulk_integral << std::endl;
- deallog << "boundary integral=" << boundary_integral << std::endl;
- deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
- cell_ok = false;
- }
-
- ss.str("");
- }
- }
-
- deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
- }
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ std::stringstream ss;
+
+ deallog << "FE=" << fe.get_name() << std::endl;
+
+ const QGauss<dim> quadrature(3);
+ FEValues<dim> fe_values (fe, quadrature, update_gradients
+ | update_quadrature_points
+ | update_JxW_values);
+
+ const QGauss<dim-1> face_quadrature(3);
+ FEFaceValues<dim> fe_face_values (fe, face_quadrature,
+ update_values
+ | update_quadrature_points
+ | update_normal_vectors
+ | update_JxW_values);
+
+ for (typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
+ cell != dof.end();
+ ++cell)
+ {
+ fe_values.reinit (cell);
+
+ deallog << "Cell nodes:" << std::endl;
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ deallog << i << ": ( ";
+ for (unsigned int d=0; d<dim; ++d)
+ deallog << cell->vertex(i)[d] << " ";
+ deallog << ")" << std::endl;
+ }
+
+ bool cell_ok = true;
+
+ for (unsigned int c=0; c<fe.n_components(); ++c)
+ {
+ FEValuesExtractors::Scalar single_component (c);
+
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+ {
+ ss << "component=" << c
+ << ", dof=" << i
+ << std::endl;
+
+ Tensor<1,dim> bulk_integral;
+ for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+ {
+ bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
+ }
+
+ Tensor<1,dim> boundary_integral;
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ {
+ fe_face_values.reinit(cell,face);
+ for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
+ {
+ boundary_integral += fe_face_values[single_component].value (i,q)
+ * fe_face_values.normal_vector(q)
+ * fe_face_values.JxW(q);
+ }
+ }
+
+ if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
+ {
+ deallog << "Failed:" << std::endl;
+ deallog << ss.str() << std::endl;
+ deallog << " bulk integral=" << bulk_integral << std::endl;
+ deallog << "boundary integral=" << boundary_integral << std::endl;
+ deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
+ cell_ok = false;
+ }
+
+ ss.str("");
+ }
+ }
+
+ deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
+ }
}
template<int dim>
void test_hyper_ball(const double tolerance)
{
- Triangulation<dim> tr;
- GridGenerator::hyper_ball(tr);
+ Triangulation<dim> tr;
+ GridGenerator::hyper_ball(tr);
- static const HyperBallBoundary<dim> boundary;
- tr.set_boundary (0, boundary);
+ static const HyperBallBoundary<dim> boundary;
+ tr.set_boundary (0, boundary);
- tr.refine_global(1);
+ tr.refine_global(1);
- FE_DGQ<dim> fe(2);
- test(tr, fe, tolerance);
+ FE_DGQ<dim> fe(2);
+ test(tr, fe, tolerance);
}
int main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision (3);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
- deallog.attach(logfile);
- deallog.depth_console (0);
- deallog.threshold_double(1.e-7);
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
- test_hyper_ball<2>(1e-6);
- test_hyper_ball<3>(1e-6);
+ test_hyper_ball<2>(1e-6);
+ test_hyper_ball<3>(1e-6);
- deallog << "done..." << std::endl;
+ deallog << "done..." << std::endl;
}
template<int dim>
Tensor<1,dim> ones ()
{
- Tensor<1,dim> result;
- for(unsigned int i=0; i<dim; ++i)
- result[i] = 1.0;
- return result;
+ Tensor<1,dim> result;
+ for (unsigned int i=0; i<dim; ++i)
+ result[i] = 1.0;
+ return result;
}
template<int dim>
void test (const Triangulation<dim> &tr,
- const FiniteElement<dim> &fe,
- const double tolerance)
+ const FiniteElement<dim> &fe,
+ const double tolerance)
{
- DoFHandler<dim> dof(tr);
- dof.distribute_dofs(fe);
-
- std::stringstream ss;
-
- deallog << "FE=" << fe.get_name() << std::endl;
-
- const QGauss<dim> quadrature(4);
- FEValues<dim> fe_values (fe, quadrature, update_hessians
- | update_quadrature_points
- | update_JxW_values);
-
- const QGauss<dim-1> face_quadrature(4);
- FEFaceValues<dim> fe_face_values (fe, face_quadrature,
- update_gradients
- | update_quadrature_points
- | update_normal_vectors
- | update_JxW_values);
-
- for(typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
- cell != dof.end();
- ++cell)
- {
- fe_values.reinit (cell);
-
- deallog << "Cell nodes:" << std::endl;
- for(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- deallog << i << ": ( ";
- for (unsigned int d=0; d<dim; ++d)
- deallog << cell->vertex(i)[d] << " ";
- deallog << ")" << std::endl;
- }
-
- bool cell_ok = true;
-
- for (unsigned int c=0; c<fe.n_components(); ++c)
- {
- FEValuesExtractors::Scalar single_component (c);
-
- for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
- {
- ss << "component=" << c
- << ", dof=" << i
- << std::endl;
-
- Tensor<2,dim> bulk_integral;
- for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
- {
- bulk_integral += fe_values[single_component].hessian(i,q) * fe_values.JxW(q);
- }
-
- Tensor<2,dim> boundary_integral;
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- {
- fe_face_values.reinit(cell,face);
- for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
- {
- Tensor<1,dim> gradient = fe_face_values[single_component].gradient (i,q);
- Tensor<2,dim> gradient_normal_outer_prod;
-
- outer_product(gradient_normal_outer_prod, gradient, fe_face_values.normal_vector(q));
- boundary_integral += gradient_normal_outer_prod * fe_face_values.JxW(q);
- }
- }
-
- if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
- {
- deallog << "Failed:" << std::endl;
- deallog << ss.str() << std::endl;
- deallog << " bulk integral=" << bulk_integral << std::endl;
- deallog << "boundary integral=" << boundary_integral << std::endl;
- deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
- cell_ok = false;
- }
-
- ss.str("");
- }
- }
-
- deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
- }
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ std::stringstream ss;
+
+ deallog << "FE=" << fe.get_name() << std::endl;
+
+ const QGauss<dim> quadrature(4);
+ FEValues<dim> fe_values (fe, quadrature, update_hessians
+ | update_quadrature_points
+ | update_JxW_values);
+
+ const QGauss<dim-1> face_quadrature(4);
+ FEFaceValues<dim> fe_face_values (fe, face_quadrature,
+ update_gradients
+ | update_quadrature_points
+ | update_normal_vectors
+ | update_JxW_values);
+
+ for (typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
+ cell != dof.end();
+ ++cell)
+ {
+ fe_values.reinit (cell);
+
+ deallog << "Cell nodes:" << std::endl;
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ deallog << i << ": ( ";
+ for (unsigned int d=0; d<dim; ++d)
+ deallog << cell->vertex(i)[d] << " ";
+ deallog << ")" << std::endl;
+ }
+
+ bool cell_ok = true;
+
+ for (unsigned int c=0; c<fe.n_components(); ++c)
+ {
+ FEValuesExtractors::Scalar single_component (c);
+
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+ {
+ ss << "component=" << c
+ << ", dof=" << i
+ << std::endl;
+
+ Tensor<2,dim> bulk_integral;
+ for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+ {
+ bulk_integral += fe_values[single_component].hessian(i,q) * fe_values.JxW(q);
+ }
+
+ Tensor<2,dim> boundary_integral;
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ {
+ fe_face_values.reinit(cell,face);
+ for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
+ {
+ Tensor<1,dim> gradient = fe_face_values[single_component].gradient (i,q);
+ Tensor<2,dim> gradient_normal_outer_prod;
+
+ outer_product(gradient_normal_outer_prod, gradient, fe_face_values.normal_vector(q));
+ boundary_integral += gradient_normal_outer_prod * fe_face_values.JxW(q);
+ }
+ }
+
+ if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
+ {
+ deallog << "Failed:" << std::endl;
+ deallog << ss.str() << std::endl;
+ deallog << " bulk integral=" << bulk_integral << std::endl;
+ deallog << "boundary integral=" << boundary_integral << std::endl;
+ deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
+ cell_ok = false;
+ }
+
+ ss.str("");
+ }
+ }
+
+ deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
+ }
}
template<int dim>
void test_hyper_ball(const double tolerance)
{
- Triangulation<dim> tr;
- GridGenerator::hyper_ball(tr);
+ Triangulation<dim> tr;
+ GridGenerator::hyper_ball(tr);
- static const HyperBallBoundary<dim> boundary;
- tr.set_boundary (0, boundary);
+ static const HyperBallBoundary<dim> boundary;
+ tr.set_boundary (0, boundary);
- tr.refine_global(1);
+ tr.refine_global(1);
- FE_DGQ<dim> fe(2);
- test(tr, fe, tolerance);
+ FE_DGQ<dim> fe(2);
+ test(tr, fe, tolerance);
}
int main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision (3);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
- deallog.attach(logfile);
- deallog.depth_console (0);
- deallog.threshold_double(1.e-7);
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
- test_hyper_ball<2>(1e-6);
- test_hyper_ball<3>(1e-6);
+ test_hyper_ball<2>(1e-6);
+ test_hyper_ball<3>(1e-6);
- deallog << "done..." << std::endl;
+ deallog << "done..." << std::endl;
}
template<int dim>
Tensor<1,dim> ones ()
{
- Tensor<1,dim> result;
- for(unsigned int i=0; i<dim; ++i)
- result[i] = 1.0;
- return result;
+ Tensor<1,dim> result;
+ for (unsigned int i=0; i<dim; ++i)
+ result[i] = 1.0;
+ return result;
}
template<int dim>
void test (const Triangulation<dim> &tr,
- const FiniteElement<dim> &fe,
- const double tolerance)
+ const FiniteElement<dim> &fe,
+ const double tolerance)
{
- DoFHandler<dim> dof(tr);
- dof.distribute_dofs(fe);
-
- std::stringstream ss;
-
- deallog << "FE=" << fe.get_name() << std::endl;
-
- const QGauss<dim> quadrature(4);
- FEValues<dim> fe_values (fe, quadrature, update_gradients
- | update_quadrature_points
- | update_JxW_values);
-
- const QGauss<dim-1> face_quadrature(4);
- FEFaceValues<dim> fe_face_values (fe, face_quadrature,
- update_values
- | update_quadrature_points
- | update_normal_vectors
- | update_JxW_values);
-
- for(typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
- cell != dof.end();
- ++cell)
- {
- fe_values.reinit (cell);
-
- deallog << "Cell nodes:" << std::endl;
- for(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- deallog << i << ": ( ";
- for (unsigned int d=0; d<dim; ++d)
- deallog << cell->vertex(i)[d] << " ";
- deallog << ")" << std::endl;
- }
-
- bool cell_ok = true;
-
- for (unsigned int c=0; c<fe.n_components(); ++c)
- {
- FEValuesExtractors::Scalar single_component (c);
-
- for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
- {
- ss << "component=" << c
- << ", dof=" << i
- << std::endl;
-
- Tensor<1,dim> bulk_integral;
- for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
- {
- bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
- }
-
- Tensor<1,dim> boundary_integral;
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- {
- fe_face_values.reinit(cell,face);
- for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
- {
- boundary_integral += fe_face_values[single_component].value (i,q)
- * fe_face_values.normal_vector(q)
- * fe_face_values.JxW(q);
- }
- }
-
- if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
- {
- deallog << "Failed:" << std::endl;
- deallog << ss.str() << std::endl;
- deallog << " bulk integral=" << bulk_integral << std::endl;
- deallog << "boundary integral=" << boundary_integral << std::endl;
- deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
- cell_ok = false;
- }
-
- ss.str("");
- }
- }
-
- deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
- }
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ std::stringstream ss;
+
+ deallog << "FE=" << fe.get_name() << std::endl;
+
+ const QGauss<dim> quadrature(4);
+ FEValues<dim> fe_values (fe, quadrature, update_gradients
+ | update_quadrature_points
+ | update_JxW_values);
+
+ const QGauss<dim-1> face_quadrature(4);
+ FEFaceValues<dim> fe_face_values (fe, face_quadrature,
+ update_values
+ | update_quadrature_points
+ | update_normal_vectors
+ | update_JxW_values);
+
+ for (typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
+ cell != dof.end();
+ ++cell)
+ {
+ fe_values.reinit (cell);
+
+ deallog << "Cell nodes:" << std::endl;
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ deallog << i << ": ( ";
+ for (unsigned int d=0; d<dim; ++d)
+ deallog << cell->vertex(i)[d] << " ";
+ deallog << ")" << std::endl;
+ }
+
+ bool cell_ok = true;
+
+ for (unsigned int c=0; c<fe.n_components(); ++c)
+ {
+ FEValuesExtractors::Scalar single_component (c);
+
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+ {
+ ss << "component=" << c
+ << ", dof=" << i
+ << std::endl;
+
+ Tensor<1,dim> bulk_integral;
+ for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+ {
+ bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
+ }
+
+ Tensor<1,dim> boundary_integral;
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ {
+ fe_face_values.reinit(cell,face);
+ for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
+ {
+ boundary_integral += fe_face_values[single_component].value (i,q)
+ * fe_face_values.normal_vector(q)
+ * fe_face_values.JxW(q);
+ }
+ }
+
+ if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
+ {
+ deallog << "Failed:" << std::endl;
+ deallog << ss.str() << std::endl;
+ deallog << " bulk integral=" << bulk_integral << std::endl;
+ deallog << "boundary integral=" << boundary_integral << std::endl;
+ deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
+ cell_ok = false;
+ }
+
+ ss.str("");
+ }
+ }
+
+ deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
+ }
}
template<int dim>
void test_hyper_ball(const double tolerance)
{
- Triangulation<dim> tr;
- GridGenerator::hyper_ball(tr);
+ Triangulation<dim> tr;
+ GridGenerator::hyper_ball(tr);
- static const HyperBallBoundary<dim> boundary;
- tr.set_boundary (0, boundary);
+ static const HyperBallBoundary<dim> boundary;
+ tr.set_boundary (0, boundary);
- tr.refine_global(1);
+ tr.refine_global(1);
- FE_Nedelec<dim> fe(2);
- test(tr, fe, tolerance);
+ FE_Nedelec<dim> fe(2);
+ test(tr, fe, tolerance);
}
int main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision (3);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
- deallog.attach(logfile);
- deallog.depth_console (0);
- deallog.threshold_double(1.e-7);
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
- test_hyper_ball<2>(1e-6);
- test_hyper_ball<3>(1e-6);
+ test_hyper_ball<2>(1e-6);
+ test_hyper_ball<3>(1e-6);
- deallog << "done..." << std::endl;
+ deallog << "done..." << std::endl;
}
catch (ExceptionBase &e)
{
deallog << e.get_exc_name() << std::endl;
- }
+ }
}
{
public:
BubbleFunction
- (unsigned int degree, unsigned int direction);
+ (unsigned int degree, unsigned int direction);
virtual double value
- (const Point<dim> &p, const unsigned int component = 0) const;
+ (const Point<dim> &p, const unsigned int component = 0) const;
virtual Tensor<1,dim> gradient
- (const Point<dim> &p, const unsigned int component = 0) const;
+ (const Point<dim> &p, const unsigned int component = 0) const;
private:
unsigned int m_degree;
template <int dim>
BubbleFunction<dim>::BubbleFunction (unsigned int degree,
- unsigned int direction)
-: Function<dim>(),
- m_degree(degree),
- m_direction(direction)
+ unsigned int direction)
+ : Function<dim>(),
+ m_degree(degree),
+ m_direction(direction)
{}
template <int dim>
double BubbleFunction<dim>::value (const Point<dim> &p,
- const unsigned int) const
+ const unsigned int) const
{
double return_value = 1.;
for (unsigned int i=0; i<dim; ++i)
template <int dim>
Tensor<1,dim> BubbleFunction<dim>::gradient (const Point<dim> &p,
- const unsigned int) const
+ const unsigned int) const
{
Tensor<1,dim> grad;
for (unsigned int d=0; d<dim ; ++d)
- {
- grad[d] = 1.;
- //compute grad(\prod_{i=1}^d (1-x_i^2))(p)
- for (unsigned j=0; j<dim; ++j)
- grad[d] *= (d==j ? -2*p(j) : (1-p(j)*p(j)));
- // and multiply with x_i^{r-1}
- grad[d]*=std::pow(p(m_direction),m_degree-1);
- }
-
- if(m_degree>=2)
- {
- //add \prod_{i=1}^d (1-x_i^2))(p)
- double value=1.;
- for (unsigned int j=0; j < dim; ++j)
- value*=(1-p(j)*p(j));
- //and multiply with grad(x_i^{r-1})
+ {
+ grad[d] = 1.;
+ //compute grad(\prod_{i=1}^d (1-x_i^2))(p)
+ for (unsigned j=0; j<dim; ++j)
+ grad[d] *= (d==j ? -2*p(j) : (1-p(j)*p(j)));
+ // and multiply with x_i^{r-1}
+ grad[d]*=std::pow(p(m_direction),m_degree-1);
+ }
+
+ if (m_degree>=2)
+ {
+ //add \prod_{i=1}^d (1-x_i^2))(p)
+ double value=1.;
+ for (unsigned int j=0; j < dim; ++j)
+ value*=(1-p(j)*p(j));
+ //and multiply with grad(x_i^{r-1})
grad[m_direction]+=value*(m_degree-1)*std::pow(p(m_direction),m_degree-2);
- }
+ }
return grad;
}
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
- {
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- cell_matrix(i,j) += (fe_values.shape_value (i, q_point) *
- fe_values.shape_value (j, q_point) *
- fe_values.JxW (q_point));
- cell_rhs(i) += (fe_values.shape_value (i, q_point) *
- bubble_function.value(fe_values.quadrature_point(q_point)) *
- fe_values.JxW (q_point));
- }
+ {
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ cell_matrix(i,j) += (fe_values.shape_value (i, q_point) *
+ fe_values.shape_value (j, q_point) *
+ fe_values.JxW (q_point));
+ cell_rhs(i) += (fe_values.shape_value (i, q_point) *
+ bubble_function.value(fe_values.quadrature_point(q_point)) *
+ fe_values.JxW (q_point));
+ }
cell->get_dof_indices (local_dof_indices);
std::ofstream output
- ((fe->get_name()+"."+Utilities::int_to_string (i,1)+".vtk").c_str());
+ ((fe->get_name()+"."+Utilities::int_to_string (i,1)+".vtk").c_str());
data_out.write_vtk (output);
#endif
make_grid ();
setup_system();
for (unsigned int i=0; i<dim; ++i)
- {
- assemble_system (i);
- solve ();
- output_results (i);
- }
+ {
+ assemble_system (i);
+ solve ();
+ output_results (i);
+ }
}
deallog.depth_file (1);
deallog.threshold_double(1.e-11);
for (unsigned int degree = 1; degree <=3; ++degree)
- {
+ {
// {
// FiniteElement<2> *fe = new FE_Q<2>(degree);
// Step3<2> laplace_problem(fe, degree);
// laplace_problem.run();
// }
- {
- FiniteElement<2> *fe = new FE_Q_Bubbles<2>(degree);
- Step3<2> laplace_problem(fe, degree);
- laplace_problem.run();
- }
+ {
+ FiniteElement<2> *fe = new FE_Q_Bubbles<2>(degree);
+ Step3<2> laplace_problem(fe, degree);
+ laplace_problem.run();
+ }
// {
// FiniteElement<3> *fe = new FE_Q<3>(degree);
// laplace_problem.run();
// }
- {
- FiniteElement<3> *fe = new FE_Q_Bubbles<3>(degree);
- Step3<3> laplace_problem(fe, degree);
- laplace_problem.run();
+ {
+ FiniteElement<3> *fe = new FE_Q_Bubbles<3>(degree);
+ Step3<3> laplace_problem(fe, degree);
+ laplace_problem.run();
+ }
}
- }
return 0;
}
switch (component)
{
- //velocity
+ //velocity
case 0:
return 2*(x-1)*(x-1)*x*x*(y-1)*y*(2*y-1);
break;
case 1:
return -2*(y-1)*(y-1)*y*y*(x-1)*x*(2*x-1);
break;
- //pressure
+ //pressure
case 2:
//discontinuous Boffi
return y*(1-y)*exp((x-.5)*(x-.5))-.5+(x<.5);
switch (component)
{
- //velocity
+ //velocity
case 0:
gradient[0]=x*(x*(x*y*(y*(16*y-24)+8)+y*((36-24*y)*y-12))
+y*(y*(8*y-12)+4));
gradient[1]=x*(x*(x*y*((24-16*y)*y-8)+y*(y*(24*y-36)+12))
+y*((12-8*y)*y-4));
break;
- //pressure
+ //pressure
case 2:
//discontinuous Boffi
gradient[0]=-exp((x-.5)*(x-.5))*(2*x-1)*(y-1)*y;
switch (component)
{
- //velocity
+ //velocity
case 0:
return x*(x*(x*(x*(24*y-12)-48*y+24)
+y*(y*(48*y-72)+48)-12)
template<int dim>
Tensor<1,dim> ones ()
{
- Tensor<1,dim> result;
- for(unsigned int i=0; i<dim; ++i)
- result[i] = 1.0;
- return result;
+ Tensor<1,dim> result;
+ for (unsigned int i=0; i<dim; ++i)
+ result[i] = 1.0;
+ return result;
}
template<int dim>
void test (const Triangulation<dim> &tr,
- const FiniteElement<dim> &fe,
- const double tolerance)
+ const FiniteElement<dim> &fe,
+ const double tolerance)
{
- DoFHandler<dim> dof(tr);
- dof.distribute_dofs(fe);
-
- std::stringstream ss;
-
- deallog << "FE=" << fe.get_name() << std::endl;
-
- const QGauss<dim> quadrature(3);
- FEValues<dim> fe_values (fe, quadrature, update_gradients
- | update_quadrature_points
- | update_JxW_values);
-
- const QGauss<dim-1> face_quadrature(3);
- FEFaceValues<dim> fe_face_values (fe, face_quadrature,
- update_values
- | update_quadrature_points
- | update_normal_vectors
- | update_JxW_values);
-
- for(typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
- cell != dof.end();
- ++cell)
- {
- fe_values.reinit (cell);
-
- deallog << "Cell nodes:" << std::endl;
- for(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- deallog << i << ": ( ";
- for (unsigned int d=0; d<dim; ++d)
- deallog << cell->vertex(i)[d] << " ";
- deallog << ")" << std::endl;
- }
-
- bool cell_ok = true;
-
- for (unsigned int c=0; c<fe.n_components(); ++c)
- {
- FEValuesExtractors::Scalar single_component (c);
-
- for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
- {
- ss << "component=" << c
- << ", dof=" << i
- << std::endl;
-
- Tensor<1,dim> bulk_integral;
- for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
- {
- bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
- }
-
- Tensor<1,dim> boundary_integral;
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- {
- fe_face_values.reinit(cell,face);
- for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
- {
- boundary_integral += fe_face_values[single_component].value (i,q)
- * fe_face_values.normal_vector(q)
- * fe_face_values.JxW(q);
- }
- }
-
- if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
- {
- deallog << "Failed:" << std::endl;
- deallog << ss.str() << std::endl;
- deallog << " bulk integral=" << bulk_integral << std::endl;
- deallog << "boundary integral=" << boundary_integral << std::endl;
- deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
- cell_ok = false;
- }
-
- ss.str("");
- }
- }
-
- deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
- }
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ std::stringstream ss;
+
+ deallog << "FE=" << fe.get_name() << std::endl;
+
+ const QGauss<dim> quadrature(3);
+ FEValues<dim> fe_values (fe, quadrature, update_gradients
+ | update_quadrature_points
+ | update_JxW_values);
+
+ const QGauss<dim-1> face_quadrature(3);
+ FEFaceValues<dim> fe_face_values (fe, face_quadrature,
+ update_values
+ | update_quadrature_points
+ | update_normal_vectors
+ | update_JxW_values);
+
+ for (typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
+ cell != dof.end();
+ ++cell)
+ {
+ fe_values.reinit (cell);
+
+ deallog << "Cell nodes:" << std::endl;
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ deallog << i << ": ( ";
+ for (unsigned int d=0; d<dim; ++d)
+ deallog << cell->vertex(i)[d] << " ";
+ deallog << ")" << std::endl;
+ }
+
+ bool cell_ok = true;
+
+ for (unsigned int c=0; c<fe.n_components(); ++c)
+ {
+ FEValuesExtractors::Scalar single_component (c);
+
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+ {
+ ss << "component=" << c
+ << ", dof=" << i
+ << std::endl;
+
+ Tensor<1,dim> bulk_integral;
+ for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+ {
+ bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
+ }
+
+ Tensor<1,dim> boundary_integral;
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ {
+ fe_face_values.reinit(cell,face);
+ for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
+ {
+ boundary_integral += fe_face_values[single_component].value (i,q)
+ * fe_face_values.normal_vector(q)
+ * fe_face_values.JxW(q);
+ }
+ }
+
+ if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
+ {
+ deallog << "Failed:" << std::endl;
+ deallog << ss.str() << std::endl;
+ deallog << " bulk integral=" << bulk_integral << std::endl;
+ deallog << "boundary integral=" << boundary_integral << std::endl;
+ deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
+ cell_ok = false;
+ }
+
+ ss.str("");
+ }
+ }
+
+ deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
+ }
}
template<int dim>
void test_hyper_ball(const double tolerance)
{
- Triangulation<dim> tr;
- GridGenerator::hyper_ball(tr);
+ Triangulation<dim> tr;
+ GridGenerator::hyper_ball(tr);
- static const HyperBallBoundary<dim> boundary;
- tr.set_boundary (0, boundary);
+ static const HyperBallBoundary<dim> boundary;
+ tr.set_boundary (0, boundary);
- tr.refine_global(1);
+ tr.refine_global(1);
- FE_Q<dim> fe(2);
- test(tr, fe, tolerance);
+ FE_Q<dim> fe(2);
+ test(tr, fe, tolerance);
}
int main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision (3);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
- deallog.attach(logfile);
- deallog.depth_console (0);
- deallog.threshold_double(1.e-7);
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
- test_hyper_ball<2>(1e-6);
- test_hyper_ball<3>(1e-6);
+ test_hyper_ball<2>(1e-6);
+ test_hyper_ball<3>(1e-6);
- deallog << "done..." << std::endl;
+ deallog << "done..." << std::endl;
}
template<int dim>
Tensor<1,dim> ones ()
{
- Tensor<1,dim> result;
- for(unsigned int i=0; i<dim; ++i)
- result[i] = 1.0;
- return result;
+ Tensor<1,dim> result;
+ for (unsigned int i=0; i<dim; ++i)
+ result[i] = 1.0;
+ return result;
}
template<int dim>
void test (const Triangulation<dim> &tr,
- const FiniteElement<dim> &fe,
- const double tolerance)
+ const FiniteElement<dim> &fe,
+ const double tolerance)
{
- DoFHandler<dim> dof(tr);
- dof.distribute_dofs(fe);
-
- std::stringstream ss;
-
- deallog << "FE=" << fe.get_name() << std::endl;
-
- const QGauss<dim> quadrature(4);
- FEValues<dim> fe_values (fe, quadrature, update_hessians
- | update_quadrature_points
- | update_JxW_values);
-
- const QGauss<dim-1> face_quadrature(4);
- FEFaceValues<dim> fe_face_values (fe, face_quadrature,
- update_gradients
- | update_quadrature_points
- | update_normal_vectors
- | update_JxW_values);
-
- for(typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
- cell != dof.end();
- ++cell)
- {
- fe_values.reinit (cell);
-
- deallog << "Cell nodes:" << std::endl;
- for(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- deallog << i << ": ( ";
- for (unsigned int d=0; d<dim; ++d)
- deallog << cell->vertex(i)[d] << " ";
- deallog << ")" << std::endl;
- }
-
- bool cell_ok = true;
-
- for (unsigned int c=0; c<fe.n_components(); ++c)
- {
- FEValuesExtractors::Scalar single_component (c);
-
- for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
- {
- ss << "component=" << c
- << ", dof=" << i
- << std::endl;
-
- Tensor<2,dim> bulk_integral;
- for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
- {
- bulk_integral += fe_values[single_component].hessian(i,q) * fe_values.JxW(q);
- }
-
- Tensor<2,dim> boundary_integral;
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- {
- fe_face_values.reinit(cell,face);
- for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
- {
- Tensor<1,dim> gradient = fe_face_values[single_component].gradient (i,q);
- Tensor<2,dim> gradient_normal_outer_prod;
-
- outer_product(gradient_normal_outer_prod, gradient, fe_face_values.normal_vector(q));
- boundary_integral += gradient_normal_outer_prod * fe_face_values.JxW(q);
- }
- }
-
- if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
- {
- deallog << "Failed:" << std::endl;
- deallog << ss.str() << std::endl;
- deallog << " bulk integral=" << bulk_integral << std::endl;
- deallog << "boundary integral=" << boundary_integral << std::endl;
- deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
- cell_ok = false;
- }
-
- ss.str("");
- }
- }
-
- deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
- }
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ std::stringstream ss;
+
+ deallog << "FE=" << fe.get_name() << std::endl;
+
+ const QGauss<dim> quadrature(4);
+ FEValues<dim> fe_values (fe, quadrature, update_hessians
+ | update_quadrature_points
+ | update_JxW_values);
+
+ const QGauss<dim-1> face_quadrature(4);
+ FEFaceValues<dim> fe_face_values (fe, face_quadrature,
+ update_gradients
+ | update_quadrature_points
+ | update_normal_vectors
+ | update_JxW_values);
+
+ for (typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
+ cell != dof.end();
+ ++cell)
+ {
+ fe_values.reinit (cell);
+
+ deallog << "Cell nodes:" << std::endl;
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ deallog << i << ": ( ";
+ for (unsigned int d=0; d<dim; ++d)
+ deallog << cell->vertex(i)[d] << " ";
+ deallog << ")" << std::endl;
+ }
+
+ bool cell_ok = true;
+
+ for (unsigned int c=0; c<fe.n_components(); ++c)
+ {
+ FEValuesExtractors::Scalar single_component (c);
+
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+ {
+ ss << "component=" << c
+ << ", dof=" << i
+ << std::endl;
+
+ Tensor<2,dim> bulk_integral;
+ for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+ {
+ bulk_integral += fe_values[single_component].hessian(i,q) * fe_values.JxW(q);
+ }
+
+ Tensor<2,dim> boundary_integral;
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ {
+ fe_face_values.reinit(cell,face);
+ for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
+ {
+ Tensor<1,dim> gradient = fe_face_values[single_component].gradient (i,q);
+ Tensor<2,dim> gradient_normal_outer_prod;
+
+ outer_product(gradient_normal_outer_prod, gradient, fe_face_values.normal_vector(q));
+ boundary_integral += gradient_normal_outer_prod * fe_face_values.JxW(q);
+ }
+ }
+
+ if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
+ {
+ deallog << "Failed:" << std::endl;
+ deallog << ss.str() << std::endl;
+ deallog << " bulk integral=" << bulk_integral << std::endl;
+ deallog << "boundary integral=" << boundary_integral << std::endl;
+ deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
+ cell_ok = false;
+ }
+
+ ss.str("");
+ }
+ }
+
+ deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
+ }
}
template<int dim>
void test_hyper_ball(const double tolerance)
{
- Triangulation<dim> tr;
- GridGenerator::hyper_ball(tr);
+ Triangulation<dim> tr;
+ GridGenerator::hyper_ball(tr);
- static const HyperBallBoundary<dim> boundary;
- tr.set_boundary (0, boundary);
+ static const HyperBallBoundary<dim> boundary;
+ tr.set_boundary (0, boundary);
- tr.refine_global(1);
+ tr.refine_global(1);
- FE_Q<dim> fe(2);
- test(tr, fe, tolerance);
+ FE_Q<dim> fe(2);
+ test(tr, fe, tolerance);
}
int main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision (3);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
- deallog.attach(logfile);
- deallog.depth_console (0);
- deallog.threshold_double(1.e-7);
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
- test_hyper_ball<2>(1e-6);
- test_hyper_ball<3>(1e-6);
+ test_hyper_ball<2>(1e-6);
+ test_hyper_ball<3>(1e-6);
- deallog << "done..." << std::endl;
+ deallog << "done..." << std::endl;
}
template<int dim>
Tensor<1,dim> ones ()
{
- Tensor<1,dim> result;
- for(unsigned int i=0; i<dim; ++i)
- result[i] = 1.0;
- return result;
+ Tensor<1,dim> result;
+ for (unsigned int i=0; i<dim; ++i)
+ result[i] = 1.0;
+ return result;
}
template<int dim>
void test (const Triangulation<dim> &tr,
- const FiniteElement<dim> &fe,
- const double tolerance)
+ const FiniteElement<dim> &fe,
+ const double tolerance)
{
- DoFHandler<dim> dof(tr);
- dof.distribute_dofs(fe);
-
- std::stringstream ss;
-
- deallog << "FE=" << fe.get_name() << std::endl;
-
- const QGauss<dim> quadrature(4);
- FEValues<dim> fe_values (fe, quadrature, update_gradients
- | update_quadrature_points
- | update_JxW_values);
-
- const QGauss<dim-1> face_quadrature(4);
- FEFaceValues<dim> fe_face_values (fe, face_quadrature,
- update_values
- | update_quadrature_points
- | update_normal_vectors
- | update_JxW_values);
-
- for(typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
- cell != dof.end();
- ++cell)
- {
- fe_values.reinit (cell);
-
- deallog << "Cell nodes:" << std::endl;
- for(unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- deallog << i << ": ( ";
- for (unsigned int d=0; d<dim; ++d)
- deallog << cell->vertex(i)[d] << " ";
- deallog << ")" << std::endl;
- }
-
- bool cell_ok = true;
-
- for (unsigned int c=0; c<fe.n_components(); ++c)
- {
- FEValuesExtractors::Scalar single_component (c);
-
- for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
- {
- ss << "component=" << c
- << ", dof=" << i
- << std::endl;
-
- Tensor<1,dim> bulk_integral;
- for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
- {
- bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
- }
-
- Tensor<1,dim> boundary_integral;
- for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
- {
- fe_face_values.reinit(cell,face);
- for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
- {
- boundary_integral += fe_face_values[single_component].value (i,q)
- * fe_face_values.normal_vector(q)
- * fe_face_values.JxW(q);
- }
- }
-
- if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
- {
- deallog << "Failed:" << std::endl;
- deallog << ss.str() << std::endl;
- deallog << " bulk integral=" << bulk_integral << std::endl;
- deallog << "boundary integral=" << boundary_integral << std::endl;
- deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
- cell_ok = false;
- }
-
- ss.str("");
- }
- }
-
- deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
- }
+ DoFHandler<dim> dof(tr);
+ dof.distribute_dofs(fe);
+
+ std::stringstream ss;
+
+ deallog << "FE=" << fe.get_name() << std::endl;
+
+ const QGauss<dim> quadrature(4);
+ FEValues<dim> fe_values (fe, quadrature, update_gradients
+ | update_quadrature_points
+ | update_JxW_values);
+
+ const QGauss<dim-1> face_quadrature(4);
+ FEFaceValues<dim> fe_face_values (fe, face_quadrature,
+ update_values
+ | update_quadrature_points
+ | update_normal_vectors
+ | update_JxW_values);
+
+ for (typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
+ cell != dof.end();
+ ++cell)
+ {
+ fe_values.reinit (cell);
+
+ deallog << "Cell nodes:" << std::endl;
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ deallog << i << ": ( ";
+ for (unsigned int d=0; d<dim; ++d)
+ deallog << cell->vertex(i)[d] << " ";
+ deallog << ")" << std::endl;
+ }
+
+ bool cell_ok = true;
+
+ for (unsigned int c=0; c<fe.n_components(); ++c)
+ {
+ FEValuesExtractors::Scalar single_component (c);
+
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
+ {
+ ss << "component=" << c
+ << ", dof=" << i
+ << std::endl;
+
+ Tensor<1,dim> bulk_integral;
+ for (unsigned int q=0; q<fe_values.n_quadrature_points; ++q)
+ {
+ bulk_integral += fe_values[single_component].gradient(i,q) * fe_values.JxW(q);
+ }
+
+ Tensor<1,dim> boundary_integral;
+ for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
+ {
+ fe_face_values.reinit(cell,face);
+ for (unsigned int q=0; q<fe_face_values.n_quadrature_points; ++q)
+ {
+ boundary_integral += fe_face_values[single_component].value (i,q)
+ * fe_face_values.normal_vector(q)
+ * fe_face_values.JxW(q);
+ }
+ }
+
+ if ((bulk_integral-boundary_integral).norm_square() > tolerance * (bulk_integral.norm() + boundary_integral.norm()))
+ {
+ deallog << "Failed:" << std::endl;
+ deallog << ss.str() << std::endl;
+ deallog << " bulk integral=" << bulk_integral << std::endl;
+ deallog << "boundary integral=" << boundary_integral << std::endl;
+ deallog << "Error! difference between bulk and surface integrals is greater than " << tolerance << "!\n\n" << std::endl;
+ cell_ok = false;
+ }
+
+ ss.str("");
+ }
+ }
+
+ deallog << (cell_ok? "OK: cell bulk and boundary integrals match...\n" : "Failed divergence test...\n") << std::endl;
+ }
}
template<int dim>
void test_hyper_cube(const double tolerance)
{
- Triangulation<dim> tr;
- GridGenerator::hyper_cube (tr);
-
- typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
- for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
- {
- Point<dim> &point = cell->vertex(i);
- if (std::abs(point(dim-1)-1.0)<1e-5)
- point(dim-1) += 0.15;
- }
-
- FE_RaviartThomas<dim> fe(2);
- test(tr, fe, tolerance);
+ Triangulation<dim> tr;
+ GridGenerator::hyper_cube (tr);
+
+ typename Triangulation<dim>::active_cell_iterator cell = tr.begin_active();
+ for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
+ {
+ Point<dim> &point = cell->vertex(i);
+ if (std::abs(point(dim-1)-1.0)<1e-5)
+ point(dim-1) += 0.15;
+ }
+
+ FE_RaviartThomas<dim> fe(2);
+ test(tr, fe, tolerance);
}
int main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision (3);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision (3);
- deallog.attach(logfile);
- deallog.depth_console (0);
- deallog.threshold_double(1.e-7);
+ deallog.attach(logfile);
+ deallog.depth_console (0);
+ deallog.threshold_double(1.e-7);
- test_hyper_cube<2>(1e-6);
- test_hyper_cube<3>(1e-6);
+ test_hyper_cube<2>(1e-6);
+ test_hyper_cube<3>(1e-6);
- deallog << "done..." << std::endl;
+ deallog << "done..." << std::endl;
}
struct MyFESystem
{
MyFESystem (const std::vector<const FiniteElement<dim>*> &fes,
- const std::vector<unsigned int> &multiplicities)
- {
- deallog << "Constructing FESystem from list." << std::endl;
- }
+ const std::vector<unsigned int> &multiplicities)
+ {
+ deallog << "Constructing FESystem from list." << std::endl;
+ }
};
-
+
template <int dim>
-class MySimulator {
+class MySimulator
+{
public:
MySimulator (const unsigned int polynomial_degree);
private:
MyFESystem<dim> fe;
- struct VectorElementDestroyer {
+ struct VectorElementDestroyer
+ {
const std::vector<const FiniteElement<dim>*> data;
VectorElementDestroyer (const std::vector<const FiniteElement<dim>*> &pointers);
~VectorElementDestroyer (); // destructor to delete the pointers
- const std::vector<const FiniteElement<dim>*> & get_data () const;
+ const std::vector<const FiniteElement<dim>*> &get_data () const;
};
static std::vector<const FiniteElement<dim>*>
template <int dim>
MySimulator<dim>::VectorElementDestroyer::
VectorElementDestroyer (const std::vector<const FiniteElement<dim>*> &pointers)
-: data(pointers)
+ : data(pointers)
{}
template <int dim>
template <int dim>
MySimulator<dim>::MySimulator (const unsigned int polynomial_degree)
-:
-fe (VectorElementDestroyer(create_fe_list (polynomial_degree)).get_data(),
- create_fe_multiplicities ())
+ :
+ fe (VectorElementDestroyer(create_fe_list (polynomial_degree)).get_data(),
+ create_fe_multiplicities ())
{}
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test_projection<1>(logfile);
test_projection<2>(logfile);
test_projection<3>(logfile);
#include <deal.II/fe/fe_tools.h>
-void logvec (const std::vector<types::global_dof_index>& v, const std::vector<types::global_dof_index>& w)
+void logvec (const std::vector<types::global_dof_index> &v, const std::vector<types::global_dof_index> &w)
{
deallog << '[';
for (unsigned int i=0; i<w.size(); ++i)
{
std::vector<types::global_dof_index> v(fe.dofs_per_cell);
std::vector<types::global_dof_index> w(fe.n_blocks());
-
+
deallog << fe.get_name() << std::endl;
-
+
FETools::compute_block_renumbering(fe, v, w, false);
logvec(v,w);
FETools::compute_block_renumbering(fe, v, w, true);
test_renumbering(FESystem<dim>(rt1,1,q1,1));
test_renumbering(FESystem<dim>(rt1,2,q1,2));
test_renumbering(FESystem<dim>(n1,1,q1,1));
-
+
deallog.pop();
}
Tensor<1,3> curl (const Tensor<2,3> &grads)
{
return Point<3>(grads[2][1] - grads[1][2],
- grads[0][2] - grads[2][0],
- grads[1][0] - grads[0][1]);
+ grads[0][2] - grads[2][0],
+ grads[1][0] - grads[0][1]);
}
for (unsigned int q=0; q<quadrature.size(); ++q)
{
deallog << " curls[q]= " << curls[q] << std::endl
- << " grads[q]= " << grads[q] << std::endl;
+ << " grads[q]= " << grads[q] << std::endl;
Assert ((curl(grads[q]) - curls[q]).norm()
- <= 1e-10,
- ExcInternalError());
+ <= 1e-10,
+ ExcInternalError());
}
}
Tensor<1,3> curl (const Tensor<2,3> &grads)
{
return Point<3>(grads[2][1] - grads[1][2],
- grads[0][2] - grads[2][0],
- grads[1][0] - grads[0][1]);
+ grads[0][2] - grads[2][0],
+ grads[1][0] - grads[0][1]);
}
for (unsigned int q=0; q<quadrature.size(); ++q)
{
deallog << " curls[q]= " << curls[q] << std::endl
- << " grads[q]= " << grads[q] << std::endl;
+ << " grads[q]= " << grads[q] << std::endl;
Assert ((curl(grads[q]) - curls[q]).norm()
- <= 1e-10,
- ExcInternalError());
+ <= 1e-10,
+ ExcInternalError());
}
}
FEValues<dim> feval(fe, quadrature, update_values);
std::vector<Vector<float> > local(quadrature.size(),
- Vector<float>(fe.n_components()));
+ Vector<float>(fe.n_components()));
typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
const typename DoFHandler<dim>::active_cell_iterator end = dof.end();
// Some of the finite element types are commented out, since their
// implementation or instantiation for codimension != 0 is still
// missing. This was opened as issue #92.
-
+
// gen.generate("FE_Q_Hierarchical(1)");
// gen.generate("FE_DGPNonparametric(1)");
gen.generate("FE_DGQ(1)");
// test get_name()
-
+
#include "../tests.h"
#include <deal.II/base/logstream.h>
#include <deal.II/fe/fe_q.h>
void test(const FiniteElement<dim> &fe)
{
deallog << fe.get_name() << std::endl;
-
+
}
test(fe);
}
-
+
return 0;
}
// test get_name()
-
+
#include "../tests.h"
#include <deal.II/base/logstream.h>
#include <deal.II/fe/fe_q.h>
test(fe);
}
-
+
return 0;
}
template <int dim>
void check_q_bubbles(const Function<dim> &f,
- const unsigned int degree)
+ const unsigned int degree)
{
FE_Q_Bubbles<dim> fe(degree);
deallog << fe.get_name() << ' ';
template <int dim>
void do_test(const Triangulation<dim> &tria,
- const Mapping<dim> &mapping)
+ const Mapping<dim> &mapping)
{
- FE_Nothing<dim> dummy;
- // choose a point that is not right in the
- // middle of the cell so that the Jacobian
- // contains many nonzero entries
- Point<dim> quad_p;
- for (int d=0; d<dim; ++d)
- quad_p(d) = 0.42 + 0.11 * d;
- Quadrature<dim> quad(quad_p);
-
- {
- deallog << dim << "D Jacobians:" << std::endl;
- FEValues<dim> fe_val(mapping, dummy, quad, update_jacobians);
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- {
- fe_val.reinit (cell);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_val.jacobian(0)[d][e] << " ";
- deallog << std::endl;
- }
- deallog << std::endl;
- }
- {
- deallog << dim << "D inverse Jacobians:" << std::endl;
- FEValues<dim> fe_val(mapping, dummy, quad, update_inverse_jacobians);
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- {
- fe_val.reinit (cell);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
- deallog << std::endl;
- }
- deallog << std::endl;
- }
- {
- deallog << dim << "D Jacobian gradients:" << std::endl;
- FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_grads);
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- {
- fe_val.reinit (cell);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_val.jacobian_grad(0)[d][e][f] << " ";
- deallog << std::endl;
- }
- deallog << std::endl;
- }
- {
- deallog << dim << "D Jacobian pushed forward gradients:" << std::endl;
- FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_pushed_forward_grads);
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- {
- fe_val.reinit (cell);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
- deallog << std::endl;
- }
- deallog << std::endl;
- }
- {
- deallog << dim << "D Jacobian hessians:" << std::endl;
- FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_2nd_derivatives);
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- {
- fe_val.reinit (cell);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
- }
- deallog << std::endl;
- }
- {
- deallog << dim << "D Jacobian pushed forward hessians:" << std::endl;
- FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- {
- fe_val.reinit (cell);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
- }
- deallog << std::endl;
- }
- {
- deallog << dim << "D Jacobian hessian gradients:" << std::endl;
- FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_3rd_derivatives);
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- {
- fe_val.reinit (cell);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
- }
- deallog << std::endl;
- }
- {
- deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl;
- FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- {
- fe_val.reinit (cell);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
- }
- deallog << std::endl;
- }
+ FE_Nothing<dim> dummy;
+ // choose a point that is not right in the
+ // middle of the cell so that the Jacobian
+ // contains many nonzero entries
+ Point<dim> quad_p;
+ for (int d=0; d<dim; ++d)
+ quad_p(d) = 0.42 + 0.11 * d;
+ Quadrature<dim> quad(quad_p);
+
+ {
+ deallog << dim << "D Jacobians:" << std::endl;
+ FEValues<dim> fe_val(mapping, dummy, quad, update_jacobians);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ {
+ fe_val.reinit (cell);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_val.jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+ }
+ deallog << std::endl;
+ }
+ {
+ deallog << dim << "D inverse Jacobians:" << std::endl;
+ FEValues<dim> fe_val(mapping, dummy, quad, update_inverse_jacobians);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ {
+ fe_val.reinit (cell);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+ }
+ deallog << std::endl;
+ }
+ {
+ deallog << dim << "D Jacobian gradients:" << std::endl;
+ FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_grads);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ {
+ fe_val.reinit (cell);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_val.jacobian_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+ }
+ deallog << std::endl;
+ }
+ {
+ deallog << dim << "D Jacobian pushed forward gradients:" << std::endl;
+ FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_pushed_forward_grads);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ {
+ fe_val.reinit (cell);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+ }
+ deallog << std::endl;
+ }
+ {
+ deallog << dim << "D Jacobian hessians:" << std::endl;
+ FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_2nd_derivatives);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ {
+ fe_val.reinit (cell);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+ }
+ deallog << std::endl;
+ }
+ {
+ deallog << dim << "D Jacobian pushed forward hessians:" << std::endl;
+ FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ {
+ fe_val.reinit (cell);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+ }
+ deallog << std::endl;
+ }
+ {
+ deallog << dim << "D Jacobian hessian gradients:" << std::endl;
+ FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_3rd_derivatives);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ {
+ fe_val.reinit (cell);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+ }
+ deallog << std::endl;
+ }
+ {
+ deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl;
+ FEValues<dim> fe_val(mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ {
+ fe_val.reinit (cell);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+ }
+ deallog << std::endl;
+ }
}
template<int dim>
void test()
{
- Triangulation<dim> tria;
- GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
-
- {
- deallog << "========== MappingQ ==========" << std::endl;
- MappingQ<dim> mapping(5);
- do_test(tria, mapping);
- }
-
- {
- deallog << "========== MappingFEField ==========" << std::endl;
- FESystem<dim> fe_euler(FE_Q<dim> (QGaussLobatto<1>(4)), dim);
- DoFHandler<dim> map_dh(tria);
- map_dh.distribute_dofs (fe_euler);
-
- Vector<double> euler_vec(map_dh.n_dofs());
- VectorTools::get_position_vector(map_dh, euler_vec);
-
- MappingFEField<dim> mapping(map_dh, euler_vec);
- do_test(tria, mapping);
- }
+ Triangulation<dim> tria;
+ GridGenerator::hyper_ball (tria);
+ static const HyperBallBoundary<dim> boundary;
+ tria.set_boundary (0, boundary);
+
+ {
+ deallog << "========== MappingQ ==========" << std::endl;
+ MappingQ<dim> mapping(5);
+ do_test(tria, mapping);
+ }
+
+ {
+ deallog << "========== MappingFEField ==========" << std::endl;
+ FESystem<dim> fe_euler(FE_Q<dim> (QGaussLobatto<1>(4)), dim);
+ DoFHandler<dim> map_dh(tria);
+ map_dh.distribute_dofs (fe_euler);
+
+ Vector<double> euler_vec(map_dh.n_dofs());
+ VectorTools::get_position_vector(map_dh, euler_vec);
+
+ MappingFEField<dim> mapping(map_dh, euler_vec);
+ do_test(tria, mapping);
+ }
}
int
main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision(8) << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision(8) << std::fixed;
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test<2>();
- test<3>();
+ test<2>();
+ test<3>();
- return 0;
+ return 0;
}
template<int dim>
void test()
{
- Triangulation<dim> tria;
- GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
- tria.begin_active()->set_refine_flag();
- tria.execute_coarsening_and_refinement();
-
- MappingQ<dim> mapping(5);
- FE_Nothing<dim> dummy;
- // choose a point that is not right in the middle of the cell so that the
- // Jacobian contains many nonzero entries
- Point<dim-1> quad_p;
- for (int d=0; d<dim-1; ++d)
- quad_p(d) = 0.42 + 0.11 * d;
- Quadrature<dim-1> quad(quad_p);
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobians);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobians);
-
- deallog << dim << "D Jacobians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_val.jacobian(0)[d][e] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_sub_val.jacobian(0)[d][e] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_inverse_jacobians);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_inverse_jacobians);
-
- deallog << dim << "D inverse Jacobians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
- deallog << std::endl;
-
- // Also check the inverse Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_sub_val.inverse_jacobian(0)[d][e] << " ";
- deallog << std::endl;
- }
-
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_grads);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_grads);
-
- deallog << dim << "D Jacobian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_val.jacobian_grad(0)[d][e][f] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_sub_val.jacobian_grad(0)[d][e][f] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
-
- deallog << dim << "D Jacobian pushed forward gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_sub_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
-
- deallog << dim << "D Jacobian hessians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_sub_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
-
- deallog << dim << "D Jacobian pushed forward hessians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_sub_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
-
- deallog << dim << "D Jacobian hessian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_sub_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
-
- deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_sub_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
+ Triangulation<dim> tria;
+ GridGenerator::hyper_ball (tria);
+ static const HyperBallBoundary<dim> boundary;
+ tria.set_boundary (0, boundary);
+ tria.begin_active()->set_refine_flag();
+ tria.execute_coarsening_and_refinement();
+
+ MappingQ<dim> mapping(5);
+ FE_Nothing<dim> dummy;
+ // choose a point that is not right in the middle of the cell so that the
+ // Jacobian contains many nonzero entries
+ Point<dim-1> quad_p;
+ for (int d=0; d<dim-1; ++d)
+ quad_p(d) = 0.42 + 0.11 * d;
+ Quadrature<dim-1> quad(quad_p);
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobians);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobians);
+
+ deallog << dim << "D Jacobians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_val.jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_sub_val.jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_inverse_jacobians);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_inverse_jacobians);
+
+ deallog << dim << "D inverse Jacobians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+
+ // Also check the inverse Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_sub_val.inverse_jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+ }
+
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_grads);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_grads);
+
+ deallog << dim << "D Jacobian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_val.jacobian_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_sub_val.jacobian_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
+
+ deallog << dim << "D Jacobian pushed forward gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_sub_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
+
+ deallog << dim << "D Jacobian hessians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_sub_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
+
+ deallog << dim << "D Jacobian pushed forward hessians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_sub_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
+
+ deallog << dim << "D Jacobian hessian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_sub_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
+
+ deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_sub_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
}
int
main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision(8) << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision(8) << std::fixed;
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test<2>();
- test<3>();
+ test<2>();
+ test<3>();
- return 0;
+ return 0;
}
template<int dim>
void test()
{
- Triangulation<dim> tria;
- GridGenerator::hyper_cube (tria);
- tria.refine_global(1);
- tria.begin_active()->set_refine_flag();
- tria.execute_coarsening_and_refinement();
-
- MappingCartesian<dim> mapping;
- FE_Nothing<dim> dummy;
- // choose a point that is not right in the middle of the cell so that the
- // Jacobian contains many nonzero entries
- Point<dim-1> quad_p;
- for (int d=0; d<dim-1; ++d)
- quad_p(d) = 0.42 + 0.11 * d;
- Quadrature<dim-1> quad(quad_p);
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobians);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobians);
-
- deallog << dim << "D Jacobians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_val.jacobian(0)[d][e] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_sub_val.jacobian(0)[d][e] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_inverse_jacobians);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_inverse_jacobians);
-
- deallog << dim << "D inverse Jacobians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
- deallog << std::endl;
-
- // Also check the inverse Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_sub_val.inverse_jacobian(0)[d][e] << " ";
- deallog << std::endl;
- }
-
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_grads);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_grads);
-
- deallog << dim << "D Jacobian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_val.jacobian_grad(0)[d][e][f] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_sub_val.jacobian_grad(0)[d][e][f] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
-
- deallog << dim << "D Jacobian pushed forward gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_sub_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
-
- deallog << dim << "D Jacobian hessians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_sub_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
-
- deallog << dim << "D Jacobian pushed forward hessians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_sub_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
-
- deallog << dim << "D Jacobian hessian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_sub_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
-
- deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_sub_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube (tria);
+ tria.refine_global(1);
+ tria.begin_active()->set_refine_flag();
+ tria.execute_coarsening_and_refinement();
+
+ MappingCartesian<dim> mapping;
+ FE_Nothing<dim> dummy;
+ // choose a point that is not right in the middle of the cell so that the
+ // Jacobian contains many nonzero entries
+ Point<dim-1> quad_p;
+ for (int d=0; d<dim-1; ++d)
+ quad_p(d) = 0.42 + 0.11 * d;
+ Quadrature<dim-1> quad(quad_p);
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobians);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobians);
+
+ deallog << dim << "D Jacobians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_val.jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_sub_val.jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_inverse_jacobians);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_inverse_jacobians);
+
+ deallog << dim << "D inverse Jacobians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+
+ // Also check the inverse Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_sub_val.inverse_jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+ }
+
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_grads);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_grads);
+
+ deallog << dim << "D Jacobian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_val.jacobian_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_sub_val.jacobian_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
+
+ deallog << dim << "D Jacobian pushed forward gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_sub_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
+
+ deallog << dim << "D Jacobian hessians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_sub_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
+
+ deallog << dim << "D Jacobian pushed forward hessians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_sub_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
+
+ deallog << dim << "D Jacobian hessian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_sub_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
+
+ deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_sub_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
}
int
main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision(8) << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision(8) << std::fixed;
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test<2>();
- test<3>();
+ test<2>();
+ test<3>();
- return 0;
+ return 0;
}
template<int dim>
void test()
{
- Triangulation<dim> tria;
- GridGenerator::hyper_ball (tria);
- static const HyperBallBoundary<dim> boundary;
- tria.set_boundary (0, boundary);
- tria.begin_active()->set_refine_flag();
- tria.execute_coarsening_and_refinement();
-
- // create Euler vector field and MappingFEField
- FESystem<dim> fe_euler(FE_Q<dim> (QGaussLobatto<1>(4)), dim);
- DoFHandler<dim> map_dh(tria);
- map_dh.distribute_dofs (fe_euler);
-
- Vector<double> euler_vec(map_dh.n_dofs());
- VectorTools::get_position_vector(map_dh, euler_vec);
-
- MappingFEField<dim> mapping(map_dh, euler_vec);
-
- FE_Nothing<dim> dummy;
- // choose a point that is not right in the middle of the cell so that the
- // Jacobian contains many nonzero entries
- Point<dim-1> quad_p;
- for (int d=0; d<dim-1; ++d)
- quad_p(d) = 0.42 + 0.11 * d;
- Quadrature<dim-1> quad(quad_p);
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobians);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobians);
-
- deallog << dim << "D Jacobians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_val.jacobian(0)[d][e] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_sub_val.jacobian(0)[d][e] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_inverse_jacobians);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_inverse_jacobians);
-
- deallog << dim << "D inverse Jacobians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
- deallog << std::endl;
-
- // Also check the inverse Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- deallog << fe_sub_val.inverse_jacobian(0)[d][e] << " ";
- deallog << std::endl;
- }
-
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_grads);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_grads);
-
- deallog << dim << "D Jacobian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_val.jacobian_grad(0)[d][e][f] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_sub_val.jacobian_grad(0)[d][e][f] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
-
- deallog << dim << "D Jacobian pushed forward gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- deallog << fe_sub_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
-
- deallog << dim << "D Jacobian hessians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_sub_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
-
- deallog << dim << "D Jacobian pushed forward hessians:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- deallog << fe_sub_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
-
- deallog << dim << "D Jacobian hessian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_sub_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
-
- {
- FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
- FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
-
- deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(), endc = tria.end();
- for ( ; cell != endc; ++cell)
- for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- {
- fe_val.reinit (cell, f);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
-
- // Also check the Jacobian with FESubfaceValues
- if (cell->at_boundary(f) == false &&
- cell->neighbor(f)->level() < cell->level())
- {
- fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
- cell->neighbor_of_coarser_neighbor(f).second);
-
- for (unsigned int d=0; d<dim; ++d)
- for (unsigned int e=0; e<dim; ++e)
- for (unsigned int f=0; f<dim; ++f)
- for (unsigned int g=0; g<dim; ++g)
- for (unsigned int h=0; h<dim; ++h)
- deallog << fe_sub_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
- deallog << std::endl;
- }
- }
- deallog << std::endl;
- }
+ Triangulation<dim> tria;
+ GridGenerator::hyper_ball (tria);
+ static const HyperBallBoundary<dim> boundary;
+ tria.set_boundary (0, boundary);
+ tria.begin_active()->set_refine_flag();
+ tria.execute_coarsening_and_refinement();
+
+ // create Euler vector field and MappingFEField
+ FESystem<dim> fe_euler(FE_Q<dim> (QGaussLobatto<1>(4)), dim);
+ DoFHandler<dim> map_dh(tria);
+ map_dh.distribute_dofs (fe_euler);
+
+ Vector<double> euler_vec(map_dh.n_dofs());
+ VectorTools::get_position_vector(map_dh, euler_vec);
+
+ MappingFEField<dim> mapping(map_dh, euler_vec);
+
+ FE_Nothing<dim> dummy;
+ // choose a point that is not right in the middle of the cell so that the
+ // Jacobian contains many nonzero entries
+ Point<dim-1> quad_p;
+ for (int d=0; d<dim-1; ++d)
+ quad_p(d) = 0.42 + 0.11 * d;
+ Quadrature<dim-1> quad(quad_p);
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobians);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobians);
+
+ deallog << dim << "D Jacobians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_val.jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_sub_val.jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_inverse_jacobians);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_inverse_jacobians);
+
+ deallog << dim << "D inverse Jacobians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_val.inverse_jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+
+ // Also check the inverse Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ deallog << fe_sub_val.inverse_jacobian(0)[d][e] << " ";
+ deallog << std::endl;
+ }
+
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_grads);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_grads);
+
+ deallog << dim << "D Jacobian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_val.jacobian_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_sub_val.jacobian_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_grads);
+
+ deallog << dim << "D Jacobian pushed forward gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ deallog << fe_sub_val.jacobian_pushed_forward_grad(0)[d][e][f] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_2nd_derivatives);
+
+ deallog << dim << "D Jacobian hessians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_sub_val.jacobian_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_2nd_derivatives);
+
+ deallog << dim << "D Jacobian pushed forward hessians:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ deallog << fe_sub_val.jacobian_pushed_forward_2nd_derivative(0)[d][e][f][g] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_3rd_derivatives);
+
+ deallog << dim << "D Jacobian hessian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_sub_val.jacobian_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
+
+ {
+ FEFaceValues<dim> fe_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
+ FESubfaceValues<dim> fe_sub_val (mapping, dummy, quad, update_jacobian_pushed_forward_3rd_derivatives);
+
+ deallog << dim << "D Jacobian pushed forward hessian gradients:" << std::endl;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(), endc = tria.end();
+ for ( ; cell != endc; ++cell)
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ fe_val.reinit (cell, f);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+
+ // Also check the Jacobian with FESubfaceValues
+ if (cell->at_boundary(f) == false &&
+ cell->neighbor(f)->level() < cell->level())
+ {
+ fe_sub_val.reinit(cell->neighbor(f), cell->neighbor_face_no(f),
+ cell->neighbor_of_coarser_neighbor(f).second);
+
+ for (unsigned int d=0; d<dim; ++d)
+ for (unsigned int e=0; e<dim; ++e)
+ for (unsigned int f=0; f<dim; ++f)
+ for (unsigned int g=0; g<dim; ++g)
+ for (unsigned int h=0; h<dim; ++h)
+ deallog << fe_sub_val.jacobian_pushed_forward_3rd_derivative(0)[d][e][f][g][h] << " ";
+ deallog << std::endl;
+ }
+ }
+ deallog << std::endl;
+ }
}
int
main()
{
- std::ofstream logfile ("output");
- deallog << std::setprecision(8) << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog << std::setprecision(8) << std::fixed;
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test<2>();
- test<3>();
+ test<2>();
+ test<3>();
- return 0;
+ return 0;
}
#define PRECISION 2
template<int dim, int spacedim>
-void test(const unsigned int degree) {
+void test(const unsigned int degree)
+{
deallog << "dim = " << dim << ", spacedim = " << spacedim << std::endl;
deallog << "degree = " << degree << std::endl;
cell = dof_sys.begin_active(),
endc = dof_sys.end();
- for (; cell!=endc; ++cell) {
- fe_values.reinit (cell);
- deallog << "Cell " << cell << ": OK" << std::endl;
- }
+ for (; cell!=endc; ++cell)
+ {
+ fe_values.reinit (cell);
+ deallog << "Cell " << cell << ": OK" << std::endl;
+ }
}
int main()
{
initlog();
- for(unsigned int d=1; d<4; ++d) {
- test<2,2>(d);
- test<2,3>(d);
- test<3,3>(d);
- }
+ for (unsigned int d=1; d<4; ++d)
+ {
+ test<2,2>(d);
+ test<2,3>(d);
+ test<3,3>(d);
+ }
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
-
- Triangulation<dim, spacedim> triangulation;
- GridGenerator::hyper_cube (triangulation);
-
- const unsigned int n_points = 4;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Bernstein<dim,spacedim> feb(1);
- const FESystem<dim,spacedim> fesystem(feb, spacedim);
- DoFHandler<dim,spacedim> dhb(triangulation);
- dhb.distribute_dofs(fesystem);
- Vector<double> eulerq(dhb.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhb, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
-
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+
+ Triangulation<dim, spacedim> triangulation;
+ GridGenerator::hyper_cube (triangulation);
+
+ const unsigned int n_points = 4;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Bernstein<dim,spacedim> feb(1);
+ const FESystem<dim,spacedim> fesystem(feb, spacedim);
+ DoFHandler<dim,spacedim> dhb(triangulation);
+ dhb.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhb.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhb, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
+
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
//Move a vertex a little bit
const unsigned int n_dx = 5;
// in a loop, make the cell more
// and more distorted
for (unsigned int j=0; j<n_dx; ++j)
- {
- deallog << "Vertex displacement: " << double(j)*direction << std::endl;
- cell->vertex(0) = double(j)*direction;
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
{
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
-
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- Assert (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ deallog << "Vertex displacement: " << double(j)*direction << std::endl;
+ cell->vertex(0) = double(j)*direction;
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ Assert (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
}
- }
deallog << "OK" << std::endl;
}
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
- test_real_to_unit_cell<3,3>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<1,3>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<1,3>();
+ test_real_to_unit_cell<2,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_indicator (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Bernstein<dim,spacedim> feb(2);
- const FESystem<dim,spacedim> fesystem(feb, spacedim);
- DoFHandler<dim,spacedim> dhb(triangulation);
- dhb.distribute_dofs(fesystem);
- Vector<double> eulerq(dhb.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhb, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
-
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
- {
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
- }
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Bernstein<dim,spacedim> feb(2);
+ const FESystem<dim,spacedim> fesystem(feb, spacedim);
+ DoFHandler<dim,spacedim> dhb(triangulation);
+ dhb.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhb.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhb, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
+
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
deallog << "OK" << std::endl;
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<2,3>();
-
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<2,3>();
+
// test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_indicator (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FESystem<dim,spacedim> fesystem(FE_Q<dim,spacedim>(1),1, FE_Bernstein<dim,spacedim>(2),spacedim);
-
- DoFHandler<dim,spacedim> dhb(triangulation);
- dhb.distribute_dofs(fesystem);
- Vector<double> eulerq(dhb.n_dofs());
-
- // Let's use only the last spacedim components
- ComponentMask mask(spacedim+1, true);
- mask.set(0, false);
-
- VectorTools::get_position_vector(dhb, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
-
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FESystem<dim,spacedim> fesystem(FE_Q<dim,spacedim>(1),1, FE_Bernstein<dim,spacedim>(2),spacedim);
+
+ DoFHandler<dim,spacedim> dhb(triangulation);
+ dhb.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhb.n_dofs());
+
+// Let's use only the last spacedim components
+ ComponentMask mask(spacedim+1, true);
+ mask.set(0, false);
+
+ VectorTools::get_position_vector(dhb, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+
for (unsigned int i=0; i<unit_points.size(); ++i)
{
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
int main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
- test_real_to_unit_cell<3,3>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<2,3>();
// test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_indicator (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Bernstein<dim,spacedim> feb(3);
- const FESystem<dim,spacedim> fesystem(feb, spacedim);
- DoFHandler<dim,spacedim> dhb(triangulation);
- dhb.distribute_dofs(fesystem);
- Vector<double> eulerq(dhb.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhb, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
-
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
- {
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
- }
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Bernstein<dim,spacedim> feb(3);
+ const FESystem<dim,spacedim> fesystem(feb, spacedim);
+ DoFHandler<dim,spacedim> dhb(triangulation);
+ dhb.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhb.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhb, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
+
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
deallog << "OK" << std::endl;
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<2,3>();
// test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_indicator (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Bernstein<dim,spacedim> feb(4);
- const FESystem<dim,spacedim> fesystem(feb, spacedim);
- DoFHandler<dim,spacedim> dhb(triangulation);
- dhb.distribute_dofs(fesystem);
- Vector<double> eulerq(dhb.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhb, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
- {
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
- }
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Bernstein<dim,spacedim> feb(4);
+ const FESystem<dim,spacedim> fesystem(feb, spacedim);
+ DoFHandler<dim,spacedim> dhb(triangulation);
+ dhb.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhb.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhb, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
deallog << "OK" << std::endl;
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<2,3>();
//test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_indicator (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Bernstein<dim,spacedim> feb(5);
- const FESystem<dim,spacedim> fesystem(feb, spacedim);
- DoFHandler<dim,spacedim> dhb(triangulation);
- dhb.distribute_dofs(fesystem);
- Vector<double> eulerq(dhb.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhb, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
- {
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
- }
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Bernstein<dim,spacedim> feb(5);
+ const FESystem<dim,spacedim> fesystem(feb, spacedim);
+ DoFHandler<dim,spacedim> dhb(triangulation);
+ dhb.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhb.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhb, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhb, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
deallog << "OK" << std::endl;
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
test_real_to_unit_cell<3,3>();
test_real_to_unit_cell<1,2>();
//test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
-
- Triangulation<dim, spacedim> triangulation;
- GridGenerator::hyper_cube (triangulation);
-
- const unsigned int n_points = 4;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Q<dim,spacedim> feq(1);
- const FESystem<dim,spacedim> fesystem(feq, spacedim);
- DoFHandler<dim,spacedim> dhq(triangulation);
- dhq.distribute_dofs(fesystem);
- Vector<double> eulerq(dhq.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhq, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+
+ Triangulation<dim, spacedim> triangulation;
+ GridGenerator::hyper_cube (triangulation);
+
+ const unsigned int n_points = 4;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Q<dim,spacedim> feq(1);
+ const FESystem<dim,spacedim> fesystem(feq, spacedim);
+ DoFHandler<dim,spacedim> dhq(triangulation);
+ dhq.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhq.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhq, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
//Move a vertex a little bit
const unsigned int n_dx = 5;
// in a loop, make the cell more
// and more distorted
for (unsigned int j=0; j<n_dx; ++j)
- {
- deallog << "Vertex displacement: " << double(j)*direction << std::endl;
- cell->vertex(0) = double(j)*direction;
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
{
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
-
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- Assert (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ deallog << "Vertex displacement: " << double(j)*direction << std::endl;
+ cell->vertex(0) = double(j)*direction;
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ Assert (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
}
- }
deallog << "OK" << std::endl;
}
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
- test_real_to_unit_cell<3,3>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<1,3>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<1,3>();
+ test_real_to_unit_cell<2,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_indicator (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Q<dim,spacedim> feq(2);
- const FESystem<dim,spacedim> fesystem(feq, spacedim);
- DoFHandler<dim,spacedim> dhq(triangulation);
- dhq.distribute_dofs(fesystem);
- Vector<double> eulerq(dhq.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhq, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
- {
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
- }
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Q<dim,spacedim> feq(2);
+ const FESystem<dim,spacedim> fesystem(feq, spacedim);
+ DoFHandler<dim,spacedim> dhq(triangulation);
+ dhq.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhq.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhq, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
deallog << "OK" << std::endl;
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<1,2>();
test_real_to_unit_cell<2,3>();
// test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
-
- Triangulation<dim, spacedim> triangulation;
- GridGenerator::hyper_cube (triangulation);
-
- const unsigned int n_points = 4;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FESystem<dim,spacedim> fesystem(FE_Q<dim,spacedim>(1),1, FE_Q<dim,spacedim>(2),spacedim);
-
- DoFHandler<dim,spacedim> dhq(triangulation);
- dhq.distribute_dofs(fesystem);
- Vector<double> eulerq(dhq.n_dofs());
-
- // Let's use only the last spacedim components
- ComponentMask mask(spacedim+1, true);
- mask.set(0, false);
-
- VectorTools::get_position_vector(dhq, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+
+ Triangulation<dim, spacedim> triangulation;
+ GridGenerator::hyper_cube (triangulation);
+
+ const unsigned int n_points = 4;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FESystem<dim,spacedim> fesystem(FE_Q<dim,spacedim>(1),1, FE_Q<dim,spacedim>(2),spacedim);
+
+ DoFHandler<dim,spacedim> dhq(triangulation);
+ dhq.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhq.n_dofs());
+
+// Let's use only the last spacedim components
+ ComponentMask mask(spacedim+1, true);
+ mask.set(0, false);
+
+ VectorTools::get_position_vector(dhq, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
//Move a vertex a little bit
const unsigned int n_dx = 5;
// in a loop, make the cell more
// and more distorted
for (unsigned int j=0; j<n_dx; ++j)
- {
- deallog << "Vertex displacement: " << double(j)*direction << std::endl;
- cell->vertex(0) = double(j)*direction;
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
{
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
-
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- Assert (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ deallog << "Vertex displacement: " << double(j)*direction << std::endl;
+ cell->vertex(0) = double(j)*direction;
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ Assert (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
}
- }
deallog << "OK" << std::endl;
}
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
- test_real_to_unit_cell<3,3>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<1,3>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<1,3>();
+ test_real_to_unit_cell<2,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_indicator (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Q<dim,spacedim> feq(3);
- const FESystem<dim,spacedim> fesystem(feq, spacedim);
- DoFHandler<dim,spacedim> dhq(triangulation);
- dhq.distribute_dofs(fesystem);
- Vector<double> eulerq(dhq.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhq, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
- {
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
- }
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Q<dim,spacedim> feq(3);
+ const FESystem<dim,spacedim> fesystem(feq, spacedim);
+ DoFHandler<dim,spacedim> dhq(triangulation);
+ dhq.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhq.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhq, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
deallog << "OK" << std::endl;
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<2,3>();
//test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_indicator (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Q<dim,spacedim> feq(4);
- const FESystem<dim,spacedim> fesystem(feq, spacedim);
- DoFHandler<dim,spacedim> dhq(triangulation);
- dhq.distribute_dofs(fesystem);
- Vector<double> eulerq(dhq.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhq, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
- {
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
- }
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Q<dim,spacedim> feq(4);
+ const FESystem<dim,spacedim> fesystem(feq, spacedim);
+ DoFHandler<dim,spacedim> dhq(triangulation);
+ dhq.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhq.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhq, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
deallog << "OK" << std::endl;
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<2,3>();
// test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
template<int dim, int spacedim>
void test_real_to_unit_cell()
{
- deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
+ deallog << "dim=" << dim << ", spacedim=" << spacedim << std::endl;
// define a boundary that fits the
// the vertices of the hyper cube
triangulation.begin_active()->face(0)->set_boundary_id (1);
- const unsigned int n_points = 5;
- std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
-
- switch (dim)
- {
- case 1:
- for (unsigned int x=0; x<n_points; ++x)
- unit_points[x][0] = double(x)/double(n_points);
- break;
-
- case 2:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- {
- unit_points[y * n_points + x][0] = double(x)/double(n_points);
- unit_points[y * n_points + x][1] = double(y)/double(n_points);
- }
- break;
-
- case 3:
- for (unsigned int x=0; x<n_points; ++x)
- for (unsigned int y=0; y<n_points; ++y)
- for (unsigned int z=0; z<n_points; ++z)
- {
- unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
- unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
- }
- break;
- }
-
- const FE_Q<dim,spacedim> feq(5);
- const FESystem<dim,spacedim> fesystem(feq, spacedim);
- DoFHandler<dim,spacedim> dhq(triangulation);
- dhq.distribute_dofs(fesystem);
- Vector<double> eulerq(dhq.n_dofs());
- const ComponentMask mask(spacedim, true);
-
- VectorTools::get_position_vector(dhq, eulerq, mask);
- MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
-
- typename Triangulation<dim, spacedim >::active_cell_iterator
- cell = triangulation.begin_active();
-
- for (unsigned int i=0; i<unit_points.size(); ++i)
- {
- // for each of the points,
- // verify that if we apply
- // the forward map and then
- // pull back that we get
- // the same point again
-
- const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
- const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
-
- AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
- }
+ const unsigned int n_points = 5;
+ std::vector< Point<dim> > unit_points(Utilities::fixed_power<dim>(n_points));
+
+ switch (dim)
+ {
+ case 1:
+ for (unsigned int x=0; x<n_points; ++x)
+ unit_points[x][0] = double(x)/double(n_points);
+ break;
+
+ case 2:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ {
+ unit_points[y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[y * n_points + x][1] = double(y)/double(n_points);
+ }
+ break;
+
+ case 3:
+ for (unsigned int x=0; x<n_points; ++x)
+ for (unsigned int y=0; y<n_points; ++y)
+ for (unsigned int z=0; z<n_points; ++z)
+ {
+ unit_points[z * n_points * n_points + y * n_points + x][0] = double(x)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][1] = double(y)/double(n_points);
+ unit_points[z * n_points * n_points + y * n_points + x][2] = double(z)/double(n_points);
+ }
+ break;
+ }
+
+ const FE_Q<dim,spacedim> feq(5);
+ const FESystem<dim,spacedim> fesystem(feq, spacedim);
+ DoFHandler<dim,spacedim> dhq(triangulation);
+ dhq.distribute_dofs(fesystem);
+ Vector<double> eulerq(dhq.n_dofs());
+ const ComponentMask mask(spacedim, true);
+
+ VectorTools::get_position_vector(dhq, eulerq, mask);
+ MappingFEField<dim,spacedim> map(dhq, eulerq, mask);
+
+ typename Triangulation<dim, spacedim >::active_cell_iterator
+ cell = triangulation.begin_active();
+
+ for (unsigned int i=0; i<unit_points.size(); ++i)
+ {
+ // for each of the points,
+ // verify that if we apply
+ // the forward map and then
+ // pull back that we get
+ // the same point again
+
+ const Point<spacedim> p = map.transform_unit_to_real_cell(cell,unit_points[i]);
+ const Point<dim> p_unit = map.transform_real_to_unit_cell(cell,p);
+
+ AssertThrow (unit_points[i].distance(p_unit) < 1e-10, ExcInternalError());
+ }
deallog << "OK" << std::endl;
int
main()
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
- test_real_to_unit_cell<1,1>();
- test_real_to_unit_cell<2,2>();
+ test_real_to_unit_cell<1,1>();
+ test_real_to_unit_cell<2,2>();
test_real_to_unit_cell<3,3>();
- test_real_to_unit_cell<1,2>();
- test_real_to_unit_cell<2,3>();
+ test_real_to_unit_cell<1,2>();
+ test_real_to_unit_cell<2,3>();
//test_real_to_unit_cell<1,3>();
- return 0;
+ return 0;
}
cell = triangulation.begin_active(),
endc = triangulation.end();
deallog<<"The test point has real coordinates: "<<testp
- <<", and unit coordinates: "
- <<mapping.transform_real_to_unit_cell(cell, testp)<<std::endl;
+ <<", and unit coordinates: "
+ <<mapping.transform_real_to_unit_cell(cell, testp)<<std::endl;
for (; cell!=endc; ++cell)
for (unsigned int face=0; face<GeometryInfo<2>::faces_per_cell; ++face)
- {
- deallog<<"For face: "<<face<<", the test point projects to: "
- <<mapping.project_real_point_to_unit_point_on_face(cell, face, testp)<<std::endl;
- }
+ {
+ deallog<<"For face: "<<face<<", the test point projects to: "
+ <<mapping.project_real_point_to_unit_point_on_face(cell, face, testp)<<std::endl;
+ }
}
void dim3_grid ()
{
cell = triangulation.begin_active(),
endc = triangulation.end();
deallog<<"The test point has real coordinates: "<<testp
- <<", and unit coordinates: "
- <<mapping.transform_real_to_unit_cell(cell, testp)<<std::endl;
+ <<", and unit coordinates: "
+ <<mapping.transform_real_to_unit_cell(cell, testp)<<std::endl;
for (; cell!=endc; ++cell)
for (unsigned int face=0; face<GeometryInfo<3>::faces_per_cell; ++face)
- {
- deallog<<"For face: "<<face<<", the test point projects to: "
- <<mapping.project_real_point_to_unit_point_on_face(cell, face, testp)<<std::endl;
- }
+ {
+ deallog<<"For face: "<<face<<", the test point projects to: "
+ <<mapping.project_real_point_to_unit_point_on_face(cell, face, testp)<<std::endl;
+ }
}
void dim3_parallelepiped_grid ()
{
cell = triangulation.begin_active(),
endc = triangulation.end();
deallog<<"The test point has real coordinates: "<<testp
- <<", and unit coordinates: "
- <<mapping.transform_real_to_unit_cell(cell, testp)<<std::endl;
+ <<", and unit coordinates: "
+ <<mapping.transform_real_to_unit_cell(cell, testp)<<std::endl;
for (; cell!=endc; ++cell)
for (unsigned int face=0; face<GeometryInfo<3>::faces_per_cell; ++face)
- {
- deallog<<"For face: "<<face<<", the test point projects to: "
- <<mapping.project_real_point_to_unit_point_on_face(cell, face, testp)<<std::endl;
- }
+ {
+ deallog<<"For face: "<<face<<", the test point projects to: "
+ <<mapping.project_real_point_to_unit_point_on_face(cell, face, testp)<<std::endl;
+ }
}
int main ()
{
{
switch (transform)
{
- // first round: take
- // original grid
+ // first round: take
+ // original grid
case 0:
break;
- // second round: rotate
- // triangulation
+ // second round: rotate
+ // triangulation
case 1:
GridTools::rotate (3.14159265358/2, tria);
break;
- // third round: inflate
- // by a factor of 2
+ // third round: inflate
+ // by a factor of 2
case 2:
GridTools::scale (2, tria);
break;
- // third round: scale
- // back, rotate back,
- // stretch
+ // third round: scale
+ // back, rotate back,
+ // stretch
case 3:
GridTools::scale (.5, tria);
GridTools::rotate (-3.14159265358/2, tria);
GridGenerator::subdivided_hyper_rectangle (triangulation, subdivisions,
Point<dim>(),
(dim == 3 ?
- Point<dim>(2,1,1) :
- Point<dim>(2,1)));
+ Point<dim>(2,1,1) :
+ Point<dim>(2,1)));
(++triangulation.begin_active())->set_refine_flag ();
triangulation.execute_coarsening_and_refinement ();
bool is_zero_column = true;
for (unsigned int i=0; i<face_int_matrix.n(); ++i)
- {
- is_zero_column = true;
- for (unsigned int j=0; j<face_int_matrix.m(); ++j)
{
- if(fabs(face_int_matrix(j, i)) > 1e-10)
- {
- is_zero_column = false;
- break;
- }
+ is_zero_column = true;
+ for (unsigned int j=0; j<face_int_matrix.m(); ++j)
+ {
+ if (fabs(face_int_matrix(j, i)) > 1e-10)
+ {
+ is_zero_column = false;
+ break;
+ }
+ }
+
+ if (is_zero_column)
+ {
+ deallog << "Column " << i
+ << " has no non-zero elements."
+ << std::endl;
+ }
}
- if(is_zero_column)
- {
- deallog << "Column " << i
- << " has no non-zero elements."
- << std::endl;
- }
- }
-
- if(!is_zero_column)
+ if (!is_zero_column)
deallog << "OK" << std::endl;
else
deallog << "Failed" << std::endl;
// By Ross Kynch
//
// Test to confirm that FE_Nedelec works on deformed elements in 2D when using
-// Dirichlet boundary conditions (n x E = f, type). This is handled by the
+// Dirichlet boundary conditions (n x E = f, type). This is handled by the
// function project_boundary_values_curl_conforming_l2().
-//
+//
// This test solves the real valued curl-curl equation in 2D:
//
// curl(curl(E)) + E = Js
SimplePolynomial() : Function<dim>() {}
void vector_value_list (const std::vector<Point<dim> > &points,
std::vector<Vector<double> > &values) const;
-
+
void rhs_value_list (const std::vector<Point<dim> > &points,
- std::vector<Vector<double> > &values) const;
-
+ std::vector<Vector<double> > &values) const;
+
};
template<int dim>
void SimplePolynomial<dim>::vector_value_list (const std::vector<Point<dim> > &points,
Assert (values.size() == points.size(),
ExcDimensionMismatch(values.size(), points.size()));
for (unsigned int i=0; i<points.size(); ++i)
- {
- const Point<dim> &p = points[i];
- // non-zero curl-curl:
- values[i][0] = 0.0;
- values[i][1] = p[0]*p[0];
+ {
+ const Point<dim> &p = points[i];
+ // non-zero curl-curl:
+ values[i][0] = 0.0;
+ values[i][1] = p[0]*p[0];
+
+ }
- }
-
}
-
+
template<int dim>
void SimplePolynomial<dim>::rhs_value_list (const std::vector<Point<dim> > &points,
- std::vector<Vector<double> > &values) const
+ std::vector<Vector<double> > &values) const
{
Assert (dim == 2, ExcNotImplemented());
Assert (values.size() == points.size(),
ExcDimensionMismatch(values.size(), points.size()));
-
+
for (unsigned int i=0; i<points.size(); ++i)
- {
- const Point<dim> &p = points[i];
- // non-zero curl-curl:
- values[i][0] = 0.0;
- values[i][1] = -2.0 + p[0]*p[0];
- }
-
+ {
+ const Point<dim> &p = points[i];
+ // non-zero curl-curl:
+ values[i][0] = 0.0;
+ values[i][1] = -2.0 + p[0]*p[0];
+ }
+
}
-
+
template<int dim>
class polytest
{
public:
polytest(unsigned int degree);
~polytest ();
-
+
void run();
-
+
private:
void setup_system();
- void assemble_system();
+ void assemble_system();
void solve();
-
+
void output_error();
-
+
unsigned int p_order;
unsigned int quad_order;
-
+
Triangulation<dim> tria;
DoFHandler<dim> dof_handler;
FE_Nedelec<dim> fe;
Vector<double> system_rhs;
};
-
+
template<int dim>
polytest<dim>::polytest (unsigned int degree)
- :
- p_order(degree),
- quad_order(2*degree + 3),
- dof_handler(tria),
- fe (degree)
- {
+ :
+ p_order(degree),
+ quad_order(2*degree + 3),
+ dof_handler(tria),
+ fe (degree)
+ {
}
template <int dim>
polytest<dim>::~polytest ()
{
dof_handler.clear ();
}
-
+
template<int dim>
void polytest<dim>::setup_system()
{
dof_handler.distribute_dofs (fe);
solution.reinit (dof_handler.n_dofs());
system_rhs.reinit (dof_handler.n_dofs());
-
-
+
+
constraints.clear ();
SimplePolynomial<dim> boundary_function;
-
+
VectorTools::project_boundary_values_curl_conforming_l2 (dof_handler,
0,
boundary_function,
DoFTools::make_sparsity_pattern(dof_handler,
c_sparsity,
constraints,false);
-
+
sparsity_pattern.copy_from(c_sparsity);
system_matrix.reinit (sparsity_pattern);
}
-
+
template<int dim>
void polytest<dim>::assemble_system()
{
FEValues<dim> fe_values_test (fe, test_quad,
update_values | update_gradients |
update_quadrature_points | update_JxW_values);
-
+
const QGauss<dim> quadrature_formula(quad_order);
const unsigned int n_q_points = quadrature_formula.size();
-
+
const QGauss<dim-1> face_quadrature_formula(quad_order);
const unsigned int n_face_q_points = face_quadrature_formula.size();
-
+
FEValues<dim> fe_values (fe, quadrature_formula,
update_values | update_gradients |
update_quadrature_points | update_JxW_values);
-
+
FEFaceValues<dim> fe_face_values(fe, face_quadrature_formula,
update_values | update_quadrature_points |
update_normal_vectors | update_JxW_values);
-
+
const FEValuesExtractors::Vector vec(0);
-
+
const unsigned int dofs_per_cell = fe.dofs_per_cell;
-
-
+
+
FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
Vector<double> cell_rhs (dofs_per_cell);
-
+
std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
-
+
SimplePolynomial<dim> right_hand_side;
std::vector<Vector<double> > rhs_value_list(n_q_points,
Vector<double>(fe.n_components()));
typename DoFHandler<dim>::active_cell_iterator cell, endc;
- endc = dof_handler.end();
+ endc = dof_handler.end();
cell = dof_handler.begin_active();
for (; cell!=endc; ++cell)
- {
- fe_values_test.reinit(cell);
- fe_values.reinit (cell);
- cell_matrix=0;
- cell_rhs=0;
-
- right_hand_side.rhs_value_list(fe_values.get_quadrature_points(), rhs_value_list);
- for (unsigned int q=0; q<n_q_points; ++q)
{
- Tensor<1,dim> rhs_value;
- for (unsigned int d=0; d<dim; ++d)
- {
- rhs_value[d] = rhs_value_list[q](d);
- }
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- {
- for (unsigned int i=0; i<dofs_per_cell; ++i)
+ fe_values_test.reinit(cell);
+ fe_values.reinit (cell);
+ cell_matrix=0;
+ cell_rhs=0;
+
+ right_hand_side.rhs_value_list(fe_values.get_quadrature_points(), rhs_value_list);
+ for (unsigned int q=0; q<n_q_points; ++q)
{
- cell_matrix(i,j)+= (
- fe_values[vec].curl(i,q)*fe_values[vec].curl(j,q)
- + fe_values[vec].value(i,q)*fe_values[vec].value(j,q)
- )*fe_values.JxW(q);
+ Tensor<1,dim> rhs_value;
+ for (unsigned int d=0; d<dim; ++d)
+ {
+ rhs_value[d] = rhs_value_list[q](d);
+ }
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ {
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ {
+ cell_matrix(i,j)+= (
+ fe_values[vec].curl(i,q)*fe_values[vec].curl(j,q)
+ + fe_values[vec].value(i,q)*fe_values[vec].value(j,q)
+ )*fe_values.JxW(q);
+ }
+ cell_rhs(j) += rhs_value*fe_values[vec].value(j,q)*fe_values.JxW(q);
+ }
}
- cell_rhs(j) += rhs_value*fe_values[vec].value(j,q)*fe_values.JxW(q);
- }
+ cell->get_dof_indices (local_dof_indices);
+ constraints.distribute_local_to_global(cell_matrix,
+ cell_rhs,
+ local_dof_indices,
+ system_matrix, system_rhs);
}
- cell->get_dof_indices (local_dof_indices);
- constraints.distribute_local_to_global(cell_matrix,
- cell_rhs,
- local_dof_indices,
- system_matrix, system_rhs);
- }
- }
-
+ }
+
template<int dim>
void polytest<dim>::solve()
{
SparseDirectUMFPACK direct;
direct.initialize(system_matrix);
-
+
direct.vmult (solution, system_rhs);
- constraints.distribute (solution);
- }
-
+ constraints.distribute (solution);
+ }
+
template<int dim>
void polytest<dim>::output_error()
{
VectorTools::integrate_difference(dof_handler, solution, exact_solution,
diff_per_cell, QGauss<dim>(quad_order), VectorTools::L2_norm);
const double L2_error = diff_per_cell.l2_norm();
-
- deallog << "p=" << p_order << " L2_error: " << L2_error << std::endl;
+
+ deallog << "p=" << p_order << " L2_error: " << L2_error << std::endl;
}
template<int dim>
tria.refine_global(1);
// DISTORT ALL:
- GridTools::distort_random (0.2, tria, false);
-
+ GridTools::distort_random (0.2, tria, false);
+
setup_system();
assemble_system();
solve();
int main ()
{
const unsigned int dim(2);
-
+
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
-
+
for (unsigned int p=0; p<3; ++p)
- {
- polytest::polytest<dim> poly(p);
- poly.run();
- }
+ {
+ polytest::polytest<dim> poly(p);
+ poly.run();
+ }
}
}
deallog << "p = " << p_order << std::endl;
-
+
//convergence_table.set_precision("L2 Error",4);
convergence_table.set_scientific("L2 Error",true);
-
+
//convergence_table.set_precision("H(curl) Error",4);
convergence_table.set_scientific("H(curl) Error",true);
int main ()
{
using namespace Maxwell;
-
+
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
-
+
for (unsigned int p=0; p<3; ++p)
{
MaxwellProblem<3> (p).run();
// written out a little bit, only
// write every so-many-th element
SparseMatrix<double>::const_iterator p2 = A2.begin(),
- p3 = A3.begin();
+ p3 = A3.begin();
for (unsigned int i=0; i<A2.n_nonzero_elements(); ++i, ++p2, ++p3)
{
if (i % (dim*dim*dim) == 0)
deallog<<fe.get_name()<<std::endl;
const unsigned int dpc = fe.dofs_per_cell;
- if(nested_size==0)
+ if (nested_size==0)
nested_size=dpc;
// loop over all possible refinement cases
unsigned int ref_case = (isotropic_only)
- ? RefinementCase<dim>::isotropic_refinement
- : RefinementCase<dim>::cut_x;
- for (;ref_case <= RefinementCase<dim>::isotropic_refinement;++ref_case)
- {
- deallog << "RefinementCase " << ref_case << std::endl;
- // create a respective refinement on the triangulation
- Triangulation<dim, spacedim> tr;
- GridGenerator::hyper_cube (tr, 0, 1);
- tr.begin_active()->set_refine_flag(RefinementCase<dim>(ref_case));
- tr.execute_coarsening_and_refinement();
-
- DoFHandler<dim, spacedim> dh(tr);
- dh.distribute_dofs(fe);
-
- const unsigned int n_dofs = dh.n_dofs();
-
- FullMatrix<double> restriction_global(dpc,n_dofs);
- FullMatrix<double> prolongation_global(n_dofs,dpc);
-
- std::vector<types::global_dof_index> ldi (dpc);
-
- //now create the matrix coarse to fine (prolongation)
- //and fine to coarse (restriction) with respect to all dofs
- unsigned int child_no = 0;
- typename dealii::DoFHandler<dim, spacedim>::active_cell_iterator cell
- = dh.begin_active();
- for(; cell!=dh.end(); ++cell, ++child_no)
+ ? RefinementCase<dim>::isotropic_refinement
+ : RefinementCase<dim>::cut_x;
+ for (; ref_case <= RefinementCase<dim>::isotropic_refinement; ++ref_case)
{
- FullMatrix<double> restriction_local
- = fe.get_restriction_matrix(child_no, RefinementCase<dim>(ref_case));
- FullMatrix<double> prolongation_local
- = fe.get_prolongation_matrix(child_no, RefinementCase<dim>(ref_case));
+ deallog << "RefinementCase " << ref_case << std::endl;
+ // create a respective refinement on the triangulation
+ Triangulation<dim, spacedim> tr;
+ GridGenerator::hyper_cube (tr, 0, 1);
+ tr.begin_active()->set_refine_flag(RefinementCase<dim>(ref_case));
+ tr.execute_coarsening_and_refinement();
- cell->get_dof_indices(ldi);
+ DoFHandler<dim, spacedim> dh(tr);
+ dh.distribute_dofs(fe);
- for (unsigned int j=0; j<dpc; ++j)
- {
- const unsigned int add =(fe.restriction_is_additive(j))?1:0;
- for (unsigned int i=0; i<dpc; ++i)
+ const unsigned int n_dofs = dh.n_dofs();
+
+ FullMatrix<double> restriction_global(dpc,n_dofs);
+ FullMatrix<double> prolongation_global(n_dofs,dpc);
+
+ std::vector<types::global_dof_index> ldi (dpc);
+
+ //now create the matrix coarse to fine (prolongation)
+ //and fine to coarse (restriction) with respect to all dofs
+ unsigned int child_no = 0;
+ typename dealii::DoFHandler<dim, spacedim>::active_cell_iterator cell
+ = dh.begin_active();
+ for (; cell!=dh.end(); ++cell, ++child_no)
{
- prolongation_global(ldi[i],j)=prolongation_local(i,j);
- restriction_global(j,ldi[i])*=add;
- restriction_global(j,ldi[i])+=restriction_local(j,i);
+ FullMatrix<double> restriction_local
+ = fe.get_restriction_matrix(child_no, RefinementCase<dim>(ref_case));
+ FullMatrix<double> prolongation_local
+ = fe.get_prolongation_matrix(child_no, RefinementCase<dim>(ref_case));
+
+ cell->get_dof_indices(ldi);
+
+ for (unsigned int j=0; j<dpc; ++j)
+ {
+ const unsigned int add =(fe.restriction_is_additive(j))?1:0;
+ for (unsigned int i=0; i<dpc; ++i)
+ {
+ prolongation_global(ldi[i],j)=prolongation_local(i,j);
+ restriction_global(j,ldi[i])*=add;
+ restriction_global(j,ldi[i])+=restriction_local(j,i);
+ }
+ }
}
- }
- }
- FullMatrix<double> result(dpc);
- restriction_global.mmult(result, prolongation_global);
+ FullMatrix<double> result(dpc);
+ restriction_global.mmult(result, prolongation_global);
// deallog << std::endl
// << "Restriction"
// }
// deallog<<std::endl;
- bool is_identity = true;
- for (unsigned int i=0; i<nested_size; ++i)
- for (unsigned int j=0; j<nested_size; ++j)
- {
- const double expected = (i==j)?1.:0.;
- if (std::fabs(result(i,j)-expected)>1.e-12)
- {
- deallog << i << " " << j << " " << result(i,j) << std::endl;
- is_identity = false;
- }
- }
-
- if(is_identity)
- deallog << "OK" << std::endl;
- }
+ bool is_identity = true;
+ for (unsigned int i=0; i<nested_size; ++i)
+ for (unsigned int j=0; j<nested_size; ++j)
+ {
+ const double expected = (i==j)?1.:0.;
+ if (std::fabs(result(i,j)-expected)>1.e-12)
+ {
+ deallog << i << " " << j << " " << result(i,j) << std::endl;
+ is_identity = false;
+ }
+ }
+
+ if (is_identity)
+ deallog << "OK" << std::endl;
+ }
}
deallog.depth_file (1);
deallog.threshold_double(1.e-10);
for (unsigned int i=1; i<=3; ++i)
- {
- {
- FE_Q<2> fe(i);
- check(fe);
- }
- {
- FE_Q<3> fe(i);
- check(fe);
- }
- {
- FE_Q_DG0<2> fe(i);
- check(fe);
- }
- {
- FE_Q_DG0<3> fe(i);
- check(fe);
- }
- {
- FE_Q_Bubbles<2> fe(i);
- const unsigned int n_q_dofs = FE_Q<2>(i).dofs_per_cell;
- check(fe, false, n_q_dofs);
- }
{
- FE_Q_Bubbles<3> fe(i);
- const unsigned int n_q_dofs = FE_Q<3>(i).dofs_per_cell;
- check(fe, false, n_q_dofs);
+ {
+ FE_Q<2> fe(i);
+ check(fe);
+ }
+ {
+ FE_Q<3> fe(i);
+ check(fe);
+ }
+ {
+ FE_Q_DG0<2> fe(i);
+ check(fe);
+ }
+ {
+ FE_Q_DG0<3> fe(i);
+ check(fe);
+ }
+ {
+ FE_Q_Bubbles<2> fe(i);
+ const unsigned int n_q_dofs = FE_Q<2>(i).dofs_per_cell;
+ check(fe, false, n_q_dofs);
+ }
+ {
+ FE_Q_Bubbles<3> fe(i);
+ const unsigned int n_q_dofs = FE_Q<3>(i).dofs_per_cell;
+ check(fe, false, n_q_dofs);
+ }
}
- }
return 0;
}
{
switch (transform)
{
- // first round: take
- // original grid
+ // first round: take
+ // original grid
case 0:
break;
- // second round: rotate
- // triangulation
+ // second round: rotate
+ // triangulation
case 1:
GridTools::rotate (3.14159265358/2, tria);
break;
- // third round: inflate
- // by a factor of 2
+ // third round: inflate
+ // by a factor of 2
case 2:
GridTools::scale (2, tria);
break;
- // third round: scale
- // back, rotate back,
- // stretch
+ // third round: scale
+ // back, rotate back,
+ // stretch
case 3:
GridTools::scale (.5, tria);
GridTools::rotate (-3.14159265358/2, tria);
DoFRenumbering::block_wise(dof_handler);
std::vector<types::global_dof_index> dofs_per_block (fe.n_blocks());
- std::vector<unsigned int> sub_blocks (fe.n_blocks(), 0); sub_blocks[1] = 1;
+ std::vector<unsigned int> sub_blocks (fe.n_blocks(), 0);
+ sub_blocks[1] = 1;
DoFTools::count_dofs_per_block (dof_handler, dofs_per_block, sub_blocks);
deallog << "size: " << dofs_per_block[0] << " " << dofs_per_block[1] << std::endl;
-
+
std::vector<IndexSet> locally_relevant_partitioning;
std::vector<IndexSet> locally_owned_partitioning;
locally_owned_dofs.print(deallog);
deallog << "relevant: ";
locally_relevant_dofs.print(deallog);
-
-
+
+
ConstraintMatrix constraints(locally_relevant_dofs);
constraints.close();
QGauss<3> quadrature (3);
FEValues<3> fe_values (fe, quadrature, update_values);
- std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
FullMatrix<double> local_matrix(fe.dofs_per_cell, fe.dofs_per_cell);
for (DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active (); cell != dof_handler.end (); ++cell)
if (cell->is_locally_owned ())
- {
- fe_values.reinit (cell);
- local_matrix = 0.0;
-
- for (unsigned int q_point = 0; q_point < fe_values.n_quadrature_points; ++q_point)
{
- for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
- {
- for (unsigned int j = 0; j < fe.dofs_per_cell; ++j)
- local_matrix (i, j) += fe_values.shape_value(i, q_point) * fe_values.shape_value(j, q_point);
- }
+ fe_values.reinit (cell);
+ local_matrix = 0.0;
+
+ for (unsigned int q_point = 0; q_point < fe_values.n_quadrature_points; ++q_point)
+ {
+ for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
+ {
+ for (unsigned int j = 0; j < fe.dofs_per_cell; ++j)
+ local_matrix (i, j) += fe_values.shape_value(i, q_point) * fe_values.shape_value(j, q_point);
+ }
+ }
+
+ cell->get_dof_indices (local_dof_indices);
+ constraints.distribute_local_to_global (local_matrix, local_dof_indices, A);
}
-
- cell->get_dof_indices (local_dof_indices);
- constraints.distribute_local_to_global (local_matrix, local_dof_indices, A);
- }
A.compress(VectorOperation::add);
A.print(deallog.get_file_stream());
template <int dim>
void test_alt()
{
- typedef LA_Trilinos LA;
+ typedef LA_Trilinos LA;
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
DoFRenumbering::block_wise(dof_handler);
std::vector<types::global_dof_index> dofs_per_block (fe.n_blocks());
- std::vector<unsigned int> sub_blocks (fe.n_blocks(), 0); sub_blocks[1] = 1;
+ std::vector<unsigned int> sub_blocks (fe.n_blocks(), 0);
+ sub_blocks[1] = 1;
DoFTools::count_dofs_per_block (dof_handler, dofs_per_block, sub_blocks);
deallog << "size: " << dofs_per_block[0] << " " << dofs_per_block[1] << std::endl;
-
+
std::vector<IndexSet> locally_relevant_partitioning;
std::vector<IndexSet> locally_owned_partitioning;
locally_owned_dofs.print(deallog);
deallog << "relevant: ";
locally_relevant_dofs.print(deallog);
-
-
+
+
ConstraintMatrix constraints(locally_relevant_dofs);
constraints.close();
TrilinosWrappers::BlockSparsityPattern sp (locally_owned_partitioning,
- MPI_COMM_WORLD);
+ MPI_COMM_WORLD);
DoFTools::make_sparsity_pattern (dof_handler, sp,
- constraints, false,
- Utilities::MPI::
- this_mpi_process(MPI_COMM_WORLD));
- sp.compress();
+ constraints, false,
+ Utilities::MPI::
+ this_mpi_process(MPI_COMM_WORLD));
+ sp.compress();
typename LA::MPI::BlockSparseMatrix A;
-A.reinit(sp);
+ A.reinit(sp);
QGauss<3> quadrature (3);
FEValues<3> fe_values (fe, quadrature, update_values);
- std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (fe.dofs_per_cell);
FullMatrix<double> local_matrix(fe.dofs_per_cell, fe.dofs_per_cell);
for (DoFHandler<3>::active_cell_iterator cell = dof_handler.begin_active (); cell != dof_handler.end (); ++cell)
if (cell->is_locally_owned ())
- {
- fe_values.reinit (cell);
- local_matrix = 0.0;
-
- for (unsigned int q_point = 0; q_point < fe_values.n_quadrature_points; ++q_point)
{
- for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
- {
- for (unsigned int j = 0; j < fe.dofs_per_cell; ++j)
- local_matrix (i, j) += fe_values.shape_value(i, q_point) * fe_values.shape_value(j, q_point);
- }
+ fe_values.reinit (cell);
+ local_matrix = 0.0;
+
+ for (unsigned int q_point = 0; q_point < fe_values.n_quadrature_points; ++q_point)
+ {
+ for (unsigned int i = 0; i < fe.dofs_per_cell; ++i)
+ {
+ for (unsigned int j = 0; j < fe.dofs_per_cell; ++j)
+ local_matrix (i, j) += fe_values.shape_value(i, q_point) * fe_values.shape_value(j, q_point);
+ }
+ }
+
+ cell->get_dof_indices (local_dof_indices);
+ constraints.distribute_local_to_global (local_matrix, local_dof_indices, A);
}
-
- cell->get_dof_indices (local_dof_indices);
- constraints.distribute_local_to_global (local_matrix, local_dof_indices, A);
- }
A.compress(VectorOperation::add);
//A.print(deallog.get_file_stream());
std::vector<IndexSet> relevant = partitioning;
relevant[0].add_index(0);
relevant[1].add_range(0,numproc);
-
+
typename LA::MPI::BlockVector v(partitioning, MPI_COMM_WORLD);
typename LA::MPI::BlockVector v2(partitioning, relevant, MPI_COMM_WORLD);
Assert(v.block(1).has_ghost_elements(), ExcInternalError());
v.reinit(partitioning, MPI_COMM_WORLD);
Assert(!v.has_ghost_elements(), ExcInternalError());
-
+
typename LA::MPI::BlockVector v3 = v2;
Assert(v3.has_ghost_elements(), ExcInternalError());
typename LA::MPI::Vector x = v2.block(0);
Assert(x.has_ghost_elements(), ExcInternalError());
-
+
// done
if (myid==0)
deallog << "OK" << std::endl;
std::vector<IndexSet> relevant = partitioning;
relevant[0].add_index(0);
relevant[1].add_range(0,numproc);
-
+
typename LA::MPI::BlockVector v_2(partitioning, MPI_COMM_WORLD);
{
{
deal_II_exceptions::disable_abort_on_exception();
try
- {
- typename LA::MPI::BlockVector x=v_1;
- x=v_2; // error
+ {
+ typename LA::MPI::BlockVector x=v_1;
+ x=v_2; // error
}
catch (const ExceptionBase &e)
{
- deallog << "Exception: " << e.get_exc_name() << std::endl;
+ deallog << "Exception: " << e.get_exc_name() << std::endl;
}
}
-
+
// done
if (myid==0)
deallog << "OK" << std::endl;
void compress(VectorOperation::values op)
{}
- bool all_zero()
- {
- return false;
- }
-
+ bool all_zero()
+ {
+ return false;
+ }
+
bool has_ghost_elements()
{
return false;
deallog << "l1-norm: " << mat.l1_norm() << std::endl;
if (myid==0)
deallog << "mat(0,1): " << mat(0,1) << std::endl;
-
+
{
// disabled:
//typename LA::MPI::SparseMatrix mat2(mat);
//typename LA::MPI::SparseMatrix mat2;
//mat2 = mat;
}
-
+
{
deallog << "* reinit(other):" << std::endl;
typename LA::MPI::SparseMatrix mat2;
deallog << "l1-norm: " << mat.l1_norm() << std::endl;
if (myid==0)
deallog << "mat(0,1): " << mat(0,1) << std::endl;
-
+
if (myid==0)
deallog << "OK" << std::endl;
}
Assert(!vb.has_ghost_elements(), ExcInternalError());
Assert(v.has_ghost_elements(), ExcInternalError());
-
+
typename LA::MPI::Vector test;
Assert(!test.has_ghost_elements(), ExcInternalError());
- {
+ {
typename LA::MPI::Vector x;
x=v; // x is empty so it should copy layout(with ghosts) and data
Assert(x.has_ghost_elements(), ExcInternalError());
deallog << "ghosted value: " << x(1) << std::endl;
x=vb; // import, so keep ghost elements
Assert(x.has_ghost_elements(), ExcInternalError());
- deallog << "ghosted value: " << x(1) << std::endl;
+ deallog << "ghosted value: " << x(1) << std::endl;
}
{
typename LA::MPI::Vector x;
IndexSet local_active_big(numproc*3);
local_active_big.add_range(myid*3,myid*3+3);
typename LA::MPI::Vector big(local_active_big, MPI_COMM_WORLD);
-
+
typename LA::MPI::Vector x;
Assert(!x.has_ghost_elements(), ExcInternalError());
Assert(x.size()==0, ExcInternalError());
x.reinit(v);
Assert(!x.has_ghost_elements(), ExcInternalError());
Assert(x.size()==v.size(), ExcInternalError());
-
+
// done
if (myid==0)
deallog << "OK" << std::endl;
vb.compress(VectorOperation::insert);
v=vb;
- {
+ {
typename LA::MPI::Vector x;
typename LA::MPI::Vector y;
x=y;
}
- {
+ {
typename LA::MPI::Vector x;
x=v;
}
- {
+ {
typename LA::MPI::Vector x;
x=vb;
}
local_relevant.add_range(1,2);
- typename LA::MPI::Vector x;
+ typename LA::MPI::Vector x;
x.reinit(local_active, MPI_COMM_WORLD);
x=0;
typename LA::MPI::Vector g(local_active, local_relevant, MPI_COMM_WORLD);
x.compress(VectorOperation::insert);
g=x;
deallog << "all_zero? " << g.all_zero() << " (should be false)" << std::endl;
-
+
// done
if (myid==0)
deallog << "OK" << std::endl;
c!=tr.end(); ++c)
{
deallog << "2d cell " << c << " has the following face orientations:"
- << std::endl;
+ << std::endl;
for (unsigned int l=0; l<GeometryInfo<2>::faces_per_cell; ++l)
- deallog << " " << (c->face_orientation(l) ? "true" : "false")
- << std::endl;
+ deallog << " " << (c->face_orientation(l) ? "true" : "false")
+ << std::endl;
}
Triangulation<3> tr3;
c!=tr3.end(); ++c)
{
deallog << "3d cell " << c << " has the following face orientation/flips and edge orientations:"
- << std::endl;
+ << std::endl;
for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
- deallog << " face=" << f
- << (c->face_orientation(f) ? " -> true" : " -> false")
- << (c->face_flip(f) ? "/true" : "/false")
- << std::endl;
+ deallog << " face=" << f
+ << (c->face_orientation(f) ? " -> true" : " -> false")
+ << (c->face_flip(f) ? "/true" : "/false")
+ << std::endl;
for (unsigned int e=0; e<GeometryInfo<3>::lines_per_cell; ++e)
- deallog << " edge=" << e << (c->line_orientation(e) ? " -> true" : " -> false")
- << std::endl;
+ deallog << " edge=" << e << (c->line_orientation(e) ? " -> true" : " -> false")
+ << std::endl;
}
}
c!=tr.end(); ++c)
{
deallog << "2d cell " << c << " has the following face orientations:"
- << std::endl;
+ << std::endl;
for (unsigned int l=0; l<GeometryInfo<2>::faces_per_cell; ++l)
- deallog << " " << (c->face_orientation(l) ? "true" : "false")
- << std::endl;
+ deallog << " " << (c->face_orientation(l) ? "true" : "false")
+ << std::endl;
}
Triangulation<3> tr3;
c!=tr3.end(); ++c)
{
deallog << "3d cell " << c << " has the following face orientation/flips and edge orientations:"
- << std::endl;
+ << std::endl;
for (unsigned int f=0; f<GeometryInfo<3>::faces_per_cell; ++f)
- deallog << " face=" << f
- << (c->face_orientation(f) ? " -> true" : " -> false")
- << (c->face_flip(f) ? "/true" : "/false")
- << std::endl;
+ deallog << " face=" << f
+ << (c->face_orientation(f) ? " -> true" : " -> false")
+ << (c->face_flip(f) ? "/true" : "/false")
+ << std::endl;
for (unsigned int e=0; e<GeometryInfo<3>::lines_per_cell; ++e)
- deallog << " edge=" << e << (c->line_orientation(e) ? " -> true" : " -> false")
- << std::endl;
+ deallog << " edge=" << e << (c->line_orientation(e) ? " -> true" : " -> false")
+ << std::endl;
}
}
#include <deal.II/grid/grid_out.h>
#include <deal.II/grid/grid_generator.h>
-template <int dim, int spacedim1, int spacedim2>
-void test() {
+template <int dim, int spacedim1, int spacedim2>
+void test()
+{
deallog << "Testing <" << dim << "," << spacedim1
- << "> VS <" << dim << "," << spacedim2
- << ">" << std::endl;
-
+ << "> VS <" << dim << "," << spacedim2
+ << ">" << std::endl;
+
Triangulation<dim, spacedim1> tria1;
GridGenerator::hyper_cube(tria1);
tria1.refine_global(1);
-
+
Triangulation<dim, spacedim2> tria2;
GridGenerator::flatten_triangulation(tria1, tria2);
GridOut go;
test<1,1,1>();
test<1,1,2>();
test<1,1,3>();
- //
+ //
test<1,2,1>();
test<1,2,2>();
test<1,2,3>();
- //
+ //
test<1,3,1>();
test<1,3,2>();
test<1,3,3>();
<< "Inner radius = " << radii[i] << std::endl
<< "Outer radius = " << radiiext[i] << std::endl
<< "Depth = " << Ls[k] << std::endl
- << "Nzs = " << Nzs[l] << std::endl
+ << "Nzs = " << Nzs[l] << std::endl
<< "No colorize ====================" << std::endl;
// No colorize
// remove all cells but the first. this is the hardest case to handle as it
// makes a bunch of vertices unused
std::set<typename Triangulation<dim>::active_cell_iterator>
- cells_to_remove;
+ cells_to_remove;
for (typename Triangulation<dim>::active_cell_iterator
- cell = ++triangulation.begin_active();
+ cell = ++triangulation.begin_active();
cell != triangulation.end(); ++cell)
cells_to_remove.insert (cell);
-
+
GridGenerator::create_triangulation_with_removed_cells(triangulation,
- cells_to_remove, tr);
+ cells_to_remove, tr);
GridOut go;
go.write_gnuplot(tr, out);
}
#include <iomanip>
-void dim2(std::ostream& os)
+void dim2(std::ostream &os)
{
const unsigned int d=2;
Triangulation<d> tr;
-
+
std::vector<unsigned int> holes(d);
holes[0] = 3;
holes[1] = 2;
gout.write_vtk(tr, os);
}
-void dim3(std::ostream& os)
+void dim3(std::ostream &os)
{
const unsigned int d=3;
Triangulation<d> tr;
-
+
std::vector<unsigned int> holes(d);
holes[0] = 3;
holes[1] = 2;
int main()
{
initlog(true);
- std::ostream& logfile = deallog.get_file_stream();
+ std::ostream &logfile = deallog.get_file_stream();
dim2(logfile);
dim3(logfile);
}
#include <iomanip>
-void dim2(std::ostream& os)
+void dim2(std::ostream &os)
{
const unsigned int d=2;
Triangulation<d> tr;
-
+
std::vector<unsigned int> sizes(2*d);
sizes[0] = 3;
sizes[1] = 0;
gout.write_vtk(tr, os);
}
-void dim3(std::ostream& os)
+void dim3(std::ostream &os)
{
const unsigned int d=3;
Triangulation<d> tr;
-
+
std::vector<unsigned int> sizes(2*d);
sizes[0] = 5;
sizes[1] = 1;
int main()
{
initlog(true);
- std::ostream& logfile = deallog.get_file_stream();
+ std::ostream &logfile = deallog.get_file_stream();
dim2(logfile);
dim3(logfile);
}
#include <iomanip>
-void dim2(std::ostream& os)
+void dim2(std::ostream &os)
{
const unsigned int d=2;
Triangulation<d> tr;
-
+
std::vector<Point<d> > vertices(d+1);
vertices[1](0) = 0.5;
vertices[1](1) = .85;
gout.write_vtk(tr, os);
}
-void dim3(std::ostream& os)
+void dim3(std::ostream &os)
{
const unsigned int d=3;
Triangulation<d> tr;
-
+
std::vector<Point<d> > vertices(d+1);
vertices[0](0) = 1.;
vertices[0](1) = 0.;
int main()
{
initlog(true);
- std::ostream& logfile = deallog.get_file_stream();
+ std::ostream &logfile = deallog.get_file_stream();
dim2(logfile);
dim3(logfile);
}
if (dim==3)
for (typename Triangulation<dim>::active_cell_iterator c=tria.begin_active(); c!=tria.end(); ++c)
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- if (c->face(f)->at_boundary())
- for (unsigned int e=0; e<GeometryInfo<dim>::lines_per_face; ++e)
- c->face(f)->line(e)->set_boundary_id(0);
-
+ if (c->face(f)->at_boundary())
+ for (unsigned int e=0; e<GeometryInfo<dim>::lines_per_face; ++e)
+ c->face(f)->line(e)->set_boundary_id(0);
+
static const HyperShellBoundary<dim> boundary(center);
tria.set_boundary(0, boundary);
for (Triangulation<1>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
{
for (unsigned int face = 0; face < 2; ++face)
- {
- if (cell->at_boundary(face))
- deallog << "vertex " << cell->face_index(face)
- << " has boundary indicator " << (int)cell->face(face)->boundary_indicator()
- << std::endl;
- }
+ {
+ if (cell->at_boundary(face))
+ deallog << "vertex " << cell->face_index(face)
+ << " has boundary indicator " << (int)cell->face(face)->boundary_indicator()
+ << std::endl;
+ }
}
}
for (Triangulation<1,3>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
{
for (unsigned int face = 0; face < 2; ++face)
- {
- if (cell->at_boundary(face))
- deallog << "vertex " << cell->face_index(face)
- << " has boundary indicator " << (int)cell->face(face)->boundary_indicator()
- << std::endl;
- }
+ {
+ if (cell->at_boundary(face))
+ deallog << "vertex " << cell->face_index(face)
+ << " has boundary indicator " << (int)cell->face(face)->boundary_indicator()
+ << std::endl;
+ }
}
}
template <int dim, int spacedim>
-void test (std::ostream& logfile)
+void test (std::ostream &logfile)
{
Triangulation<dim,spacedim> tria;
std::vector<unsigned int> legs(2*dim, 1);
const unsigned int dim = 1;
static const Point<3> vertices_1[]
- = {
- Point<3>(0,0,0), Point<3>(1,0,0), Point<3>(1,0,0), Point<3>(1,1,0),
- Point<3>(1,1,0), Point<3>(0,1,0), Point<3>(0,1,0), Point<3>(0,0,0),
- Point<3>(0,0,1), Point<3>(1,0,1), Point<3>(1,0,1), Point<3>(1,1,1),
- Point<3>(1,1,1), Point<3>(0,1,1), Point<3>(0,1,1), Point<3>(0,0,1),
- Point<3>(0,0,0), Point<3>(0,0,1), Point<3>(1,0,0), Point<3>(1,0,1),
- Point<3>(1,1,0), Point<3>(1,1,1), Point<3>(0,1,0), Point<3>(0,1,1)
+ =
+ {
+ Point<3>(0,0,0), Point<3>(1,0,0), Point<3>(1,0,0), Point<3>(1,1,0),
+ Point<3>(1,1,0), Point<3>(0,1,0), Point<3>(0,1,0), Point<3>(0,0,0),
+ Point<3>(0,0,1), Point<3>(1,0,1), Point<3>(1,0,1), Point<3>(1,1,1),
+ Point<3>(1,1,1), Point<3>(0,1,1), Point<3>(0,1,1), Point<3>(0,0,1),
+ Point<3>(0,0,0), Point<3>(0,0,1), Point<3>(1,0,0), Point<3>(1,0,1),
+ Point<3>(1,1,0), Point<3>(1,1,1), Point<3>(0,1,0), Point<3>(0,1,1)
};
const unsigned int n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
const std::vector<Point<3> > vertices (&vertices_1[0], &vertices_1[n_vertices]);
static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
- = { { 0, 1},
- { 2, 3},
- { 4, 5},
- { 6, 7},
- { 8, 9},
- { 10, 11},
- { 12, 13},
- { 14, 15},
- { 16, 17},
- { 18, 19},
- { 20, 21},
- { 22, 23}
+ = { { 0, 1},
+ { 2, 3},
+ { 4, 5},
+ { 6, 7},
+ { 8, 9},
+ { 10, 11},
+ { 12, 13},
+ { 14, 15},
+ { 16, 17},
+ { 18, 19},
+ { 20, 21},
+ { 22, 23}
};
const unsigned int n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
for (unsigned int i=0; i<n_cells; ++i)
{
for (unsigned int j=0;
- j<GeometryInfo<dim>::vertices_per_cell;
- ++j)
- cells[i].vertices[j] = cell_vertices[i][j];
+ j<GeometryInfo<dim>::vertices_per_cell;
+ ++j)
+ cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
tria.create_triangulation ( vertices,
- cells,
- SubCellData());
+ cells,
+ SubCellData());
tria.refine_global (1);
const unsigned int dim = 1;
static const Point<3> vertices_1[]
- = {
- Point<3>(0,0,0), Point<3>(1,0,0), Point<3>(1,0,0), Point<3>(1,1,0),
- Point<3>(1,1,0), Point<3>(0,1,0), Point<3>(0,1,0), Point<3>(0,0,0),
- Point<3>(0,0,1), Point<3>(1,0,1), Point<3>(1,0,1), Point<3>(1,1,1),
- Point<3>(1,1,1), Point<3>(0,1,1), Point<3>(0,1,1), Point<3>(0,0,1),
- Point<3>(0,0,0), Point<3>(0,0,1), Point<3>(1,0,0), Point<3>(1,0,1),
- Point<3>(1,1,0), Point<3>(1,1,1), Point<3>(0,1,0), Point<3>(0,1,1)
+ =
+ {
+ Point<3>(0,0,0), Point<3>(1,0,0), Point<3>(1,0,0), Point<3>(1,1,0),
+ Point<3>(1,1,0), Point<3>(0,1,0), Point<3>(0,1,0), Point<3>(0,0,0),
+ Point<3>(0,0,1), Point<3>(1,0,1), Point<3>(1,0,1), Point<3>(1,1,1),
+ Point<3>(1,1,1), Point<3>(0,1,1), Point<3>(0,1,1), Point<3>(0,0,1),
+ Point<3>(0,0,0), Point<3>(0,0,1), Point<3>(1,0,0), Point<3>(1,0,1),
+ Point<3>(1,1,0), Point<3>(1,1,1), Point<3>(0,1,0), Point<3>(0,1,1)
};
const unsigned int n_vertices = sizeof(vertices_1) / sizeof(vertices_1[0]);
const std::vector<Point<3> > vertices (&vertices_1[0], &vertices_1[n_vertices]);
static const int cell_vertices[][GeometryInfo<dim>::vertices_per_cell]
- = { { 0, 1},
- { 2, 3},
- { 4, 5},
- { 6, 7},
- { 8, 9},
- { 10, 11},
- { 12, 13},
- { 14, 15},
- { 16, 17},
- { 18, 19},
- { 20, 21},
- { 22, 23}
+ = { { 0, 1},
+ { 2, 3},
+ { 4, 5},
+ { 6, 7},
+ { 8, 9},
+ { 10, 11},
+ { 12, 13},
+ { 14, 15},
+ { 16, 17},
+ { 18, 19},
+ { 20, 21},
+ { 22, 23}
};
const unsigned int n_cells = sizeof(cell_vertices) / sizeof(cell_vertices[0]);
std::vector<CellData<dim> > cells (n_cells, CellData<dim>());
for (unsigned int i=0; i<n_cells; ++i)
{
for (unsigned int j=0;
- j<GeometryInfo<dim>::vertices_per_cell;
- ++j)
- cells[i].vertices[j] = cell_vertices[i][j];
+ j<GeometryInfo<dim>::vertices_per_cell;
+ ++j)
+ cells[i].vertices[j] = cell_vertices[i][j];
cells[i].material_id = 0;
}
tria.create_triangulation ( vertices,
- cells,
- SubCellData());
+ cells,
+ SubCellData());
tria.refine_global (1);
GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, inner_radius, outer_radius);
triangulation.refine_global(1);
- for (unsigned int l=0;l<3;++l)
+ for (unsigned int l=0; l<3; ++l)
{
Triangulation<2>::active_cell_iterator
- cell = triangulation.begin_active(),
- endc = triangulation.end();
-
+ cell = triangulation.begin_active(),
+ endc = triangulation.end();
+
for (; cell!=endc; ++cell)
- {
- for (unsigned int v=0; v < GeometryInfo<2>::vertices_per_cell; ++v)
- {
- const double distance_from_center = center.distance(cell->vertex(v));
-
- if (std::fabs(distance_from_center - inner_radius) < .25)
- {
- cell->set_refine_flag();
- break;
- }
- }
- }
-
+ {
+ for (unsigned int v=0; v < GeometryInfo<2>::vertices_per_cell; ++v)
+ {
+ const double distance_from_center = center.distance(cell->vertex(v));
+
+ if (std::fabs(distance_from_center - inner_radius) < .25)
+ {
+ cell->set_refine_flag();
+ break;
+ }
+ }
+ }
+
triangulation.execute_coarsening_and_refinement();
}
-
+
return triangulation;
}
template <int dim, int spacedim>
-void test (std::ostream& logfile)
+void test (std::ostream &logfile)
{
Triangulation<dim,spacedim> tria;
std::vector<unsigned int> legs(2*dim, 1);
#include <fstream>
template<int dim>
-void output(parallel::distributed::Triangulation<dim> &tr, std::ostream& stream)
+void output(parallel::distributed::Triangulation<dim> &tr, std::ostream &stream)
{
GridOut out;
out.write_vtk(tr, stream);
// const std::string
// filename = ("mesh" + Utilities::int_to_string(dim)
- // + "d." +
- // Utilities::int_to_string(tr.locally_owned_subdomain(), 4) +
- // ".vtk");
+ // + "d." +
+ // Utilities::int_to_string(tr.locally_owned_subdomain(), 4) +
+ // ".vtk");
// std::ofstream stream(filename.c_str());
output(tr, deallog.get_file_stream());
typedef std::vector<GridTools::PeriodicFacePair<CellIterator2> > FaceVector2;
FaceVector2 test2;
GridTools::collect_periodic_faces
- (triangulation2, 42, 1, test2, dealii::Tensor<1,2>());
+ (triangulation2, 42, 1, test2, dealii::Tensor<1,2>());
for (FaceVector2::iterator it = test2.begin(); it != test2.end(); ++it)
print_match(it->cell[0]->face(it->face_idx[0]),
typedef std::vector<GridTools::PeriodicFacePair<CellIterator3> > FaceVector3;
FaceVector3 test3;
GridTools::collect_periodic_faces
- (triangulation3, 42, 2, test3, dealii::Tensor<1,3>());
+ (triangulation3, 42, 2, test3, dealii::Tensor<1,3>());
for (FaceVector3::iterator it = test3.begin(); it != test3.end(); ++it)
print_match(it->cell[0]->face(it->face_idx[0]),
typedef Triangulation<2>::cell_iterator CellIterator;
typedef std::vector<GridTools::PeriodicFacePair<CellIterator> >
- FaceVector;
+ FaceVector;
FaceVector test;
GridTools::collect_periodic_faces
- (triangulation, 42, 43, 1, test, dealii::Tensor<1,2>());
+ (triangulation, 42, 43, 1, test, dealii::Tensor<1,2>());
deallog << "Triangulation: " << i << std::endl;
typedef Triangulation<3>::cell_iterator CellIterator;
typedef std::vector<GridTools::PeriodicFacePair<CellIterator> >
- FaceVector;
+ FaceVector;
FaceVector test;
GridTools::collect_periodic_faces
- (triangulation, 42, 43, 2, test, dealii::Tensor<1,3>());
+ (triangulation, 42, 43, 2, test, dealii::Tensor<1,3>());
deallog << "Triangulation: " << i << std::endl;
template<int dim>
bool
-pred_mat_id(const typename Triangulation<dim>::active_cell_iterator & cell)
+pred_mat_id(const typename Triangulation<dim>::active_cell_iterator &cell)
{
return cell->material_id() == 2;
}
template <int dim>
void
-write_mat_id_to_file (const Triangulation<dim> & tria)
+write_mat_id_to_file (const Triangulation<dim> &tria)
{
- int count = 0;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
- for (; cell != endc; ++cell, ++count)
+ int count = 0;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(),
+ endc = tria.end();
+ for (; cell != endc; ++cell, ++count)
{
deallog
- << count << " "
- << static_cast<int>(cell->material_id())
- << std::endl;
+ << count << " "
+ << static_cast<int>(cell->material_id())
+ << std::endl;
}
- deallog << std::endl;
+ deallog << std::endl;
}
cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- {
- bool mark = true;
- for (unsigned int d=0; d < dim; ++d)
- if (cell->center()[d] > 0.5)
- {
- mark = false;
- break;
- }
-
- if (mark == true)
- cell->set_material_id(2);
- else
- cell->set_material_id(1);
- }
+ {
+ bool mark = true;
+ for (unsigned int d=0; d < dim; ++d)
+ if (cell->center()[d] > 0.5)
+ {
+ mark = false;
+ break;
+ }
+
+ if (mark == true)
+ cell->set_material_id(2);
+ else
+ cell->set_material_id(1);
+ }
deallog << "Grid without halo:" << std::endl;
write_mat_id_to_file(tria);
for (typename std::vector<cell_iterator>::const_iterator
it = active_halo_layer.begin();
it != active_halo_layer.end(); ++it)
- {
- (*it)->set_material_id(3);
- }
+ {
+ (*it)->set_material_id(3);
+ }
deallog << "Grid with halo:" << std::endl;
write_mat_id_to_file(tria);
template <int dim>
void
-write_mat_id_to_file (const Triangulation<dim> & tria)
+write_mat_id_to_file (const Triangulation<dim> &tria)
{
- int count = 0;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
- for (; cell != endc; ++cell, ++count)
+ int count = 0;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(),
+ endc = tria.end();
+ for (; cell != endc; ++cell, ++count)
{
deallog
- << count << " "
- << static_cast<int>(cell->material_id())
- << std::endl;
+ << count << " "
+ << static_cast<int>(cell->material_id())
+ << std::endl;
}
- deallog << std::endl;
+ deallog << std::endl;
}
cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- {
- bool mark = true;
- for (unsigned int d=0; d < dim; ++d)
- if (cell->center()[d] > 0.5)
- {
- mark = false;
- break;
- }
-
- if (mark == true)
- cell->set_material_id(2);
- else
- cell->set_material_id(1);
- }
+ {
+ bool mark = true;
+ for (unsigned int d=0; d < dim; ++d)
+ if (cell->center()[d] > 0.5)
+ {
+ mark = false;
+ break;
+ }
+
+ if (mark == true)
+ cell->set_material_id(2);
+ else
+ cell->set_material_id(1);
+ }
deallog << "Grid without halo:" << std::endl;
write_mat_id_to_file(tria);
for (typename std::vector<cell_iterator>::const_iterator
it = active_halo_layer.begin();
it != active_halo_layer.end(); ++it)
- {
- (*it)->set_material_id(3);
- }
+ {
+ (*it)->set_material_id(3);
+ }
deallog << "Grid with halo:" << std::endl;
write_mat_id_to_file(tria);
template <int dim>
void
-write_mat_id_to_file (const Triangulation<dim> & tria)
+write_mat_id_to_file (const Triangulation<dim> &tria)
{
- int count = 0;
- typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
- for (; cell != endc; ++cell, ++count)
+ int count = 0;
+ typename Triangulation<dim>::active_cell_iterator
+ cell = tria.begin_active(),
+ endc = tria.end();
+ for (; cell != endc; ++cell, ++count)
{
deallog
- << count << " "
- << static_cast<int>(cell->material_id())
- << std::endl;
+ << count << " "
+ << static_cast<int>(cell->material_id())
+ << std::endl;
}
- deallog << std::endl;
+ deallog << std::endl;
}
cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- {
- bool mark = true;
- for (unsigned int d=0; d < dim; ++d)
- if (cell->center()[d] > 0.5)
- {
- mark = false;
- break;
- }
-
- if (mark == true)
{
- if (cell->center()[0] < 0.25)
- cell->set_material_id(2);
+ bool mark = true;
+ for (unsigned int d=0; d < dim; ++d)
+ if (cell->center()[d] > 0.5)
+ {
+ mark = false;
+ break;
+ }
+
+ if (mark == true)
+ {
+ if (cell->center()[0] < 0.25)
+ cell->set_material_id(2);
+ else
+ cell->set_material_id(3);
+ }
else
- cell->set_material_id(3);
+ cell->set_material_id(1);
}
- else
- cell->set_material_id(1);
- }
deallog << "Grid without halo:" << std::endl;
write_mat_id_to_file(tria);
for (typename std::vector<cell_iterator>::const_iterator
it = active_halo_layer.begin();
it != active_halo_layer.end(); ++it)
- {
- (*it)->set_material_id(4);
- }
+ {
+ (*it)->set_material_id(4);
+ }
deallog << "Grid with halo:" << std::endl;
write_mat_id_to_file(tria);
template <int dim>
void
-write_active_fe_index_to_file (const hp::DoFHandler<dim> & dof_handler)
+write_active_fe_index_to_file (const hp::DoFHandler<dim> &dof_handler)
{
int count = 0;
typename hp::DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell, ++count)
- {
- deallog
- << count << " "
- << cell->active_fe_index()
- << std::endl;
- }
+ {
+ deallog
+ << count << " "
+ << cell->active_fe_index()
+ << std::endl;
+ }
deallog << std::endl;
}
template <int dim>
void
-write_vtk (const hp::DoFHandler<dim> & dof_handler, const std::string filename)
+write_vtk (const hp::DoFHandler<dim> &dof_handler, const std::string filename)
{
Vector<double> active_fe_index (dof_handler.get_tria().n_active_cells());
int count = 0;
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell, ++count)
- {
- active_fe_index[count] = cell->active_fe_index();
- }
+ {
+ active_fe_index[count] = cell->active_fe_index();
+ }
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell)
- {
- bool mark = true;
- for (unsigned int d=0; d < dim; ++d)
- if (cell->center()[d] > 0.5)
- {
- mark = false;
- break;
- }
-
- if (mark == true)
- cell->set_active_fe_index(2);
- else
- cell->set_active_fe_index(1);
- }
+ {
+ bool mark = true;
+ for (unsigned int d=0; d < dim; ++d)
+ if (cell->center()[d] > 0.5)
+ {
+ mark = false;
+ break;
+ }
+
+ if (mark == true)
+ cell->set_active_fe_index(2);
+ else
+ cell->set_active_fe_index(1);
+ }
deallog << "Grid without halo:" << std::endl;
write_active_fe_index_to_file(dof_handler);
for (typename std::vector<cell_iterator>::iterator
it = active_halo_layer.begin();
it != active_halo_layer.end(); ++it)
- {
- (*it)->set_active_fe_index(3);
- }
+ {
+ (*it)->set_active_fe_index(3);
+ }
deallog << "Grid with halo:" << std::endl;
write_active_fe_index_to_file(dof_handler);
template <int dim>
void
-write_active_fe_index_to_file (const hp::DoFHandler<dim> & dof_handler)
+write_active_fe_index_to_file (const hp::DoFHandler<dim> &dof_handler)
{
int count = 0;
typename hp::DoFHandler<dim>::active_cell_iterator
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell, ++count)
- {
- deallog
- << count << " "
- << cell->active_fe_index()
- << std::endl;
- }
+ {
+ deallog
+ << count << " "
+ << cell->active_fe_index()
+ << std::endl;
+ }
deallog << std::endl;
}
template <int dim>
void
-write_vtk (const hp::DoFHandler<dim> & dof_handler, const std::string filename)
+write_vtk (const hp::DoFHandler<dim> &dof_handler, const std::string filename)
{
Vector<double> active_fe_index (dof_handler.get_tria().n_active_cells());
int count = 0;
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell, ++count)
- {
- active_fe_index[count] = cell->active_fe_index();
- }
+ {
+ active_fe_index[count] = cell->active_fe_index();
+ }
const std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation
cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell != endc; ++cell)
- {
- bool mark = true;
- for (unsigned int d=0; d < dim; ++d)
- if (cell->center()[d] > 0.5)
- {
- mark = false;
- break;
- }
-
- if (mark == true)
{
-
- if (cell->center()[0] < 0.25)
- cell->set_active_fe_index(2);
+ bool mark = true;
+ for (unsigned int d=0; d < dim; ++d)
+ if (cell->center()[d] > 0.5)
+ {
+ mark = false;
+ break;
+ }
+
+ if (mark == true)
+ {
+
+ if (cell->center()[0] < 0.25)
+ cell->set_active_fe_index(2);
+ else
+ cell->set_active_fe_index(3);
+ }
else
- cell->set_active_fe_index(3);
+ cell->set_active_fe_index(1);
}
- else
- cell->set_active_fe_index(1);
- }
deallog << "Grid without halo:" << std::endl;
write_active_fe_index_to_file(dof_handler);
for (typename std::vector<cell_iterator>::iterator
it = active_halo_layer.begin();
it != active_halo_layer.end(); ++it)
- {
- (*it)->set_active_fe_index(4);
- }
+ {
+ (*it)->set_active_fe_index(4);
+ }
deallog << "Grid with halo:" << std::endl;
write_active_fe_index_to_file(dof_handler);
cell = tria.begin_active(),
endc = tria.end();
for (; cell != endc; ++cell)
- {
- if (cell->is_ghost() == true)
- ghost_cells_tria.push_back(cell);
- }
+ {
+ if (cell->is_ghost() == true)
+ ghost_cells_tria.push_back(cell);
+ }
std::sort(ghost_cells_tria.begin(),
ghost_cells_tria.end());
ghost_cell_halo_layer.end());
for (unsigned int proc = 0; proc < Utilities::MPI::n_mpi_processes(mpi_communicator); ++proc)
- {
- if (proc == Utilities::MPI::this_mpi_process(mpi_communicator))
{
- for (typename std::vector<cell_iterator>::const_iterator
- it_1 = ghost_cells_tria.begin(),
- it_2 = ghost_cell_halo_layer.begin();
- it_1 != ghost_cells_tria.end() &&
- it_2 != ghost_cell_halo_layer.end();
- ++it_1, ++it_2)
- {
- const cell_iterator & cell_1 = *it_1;
- const cell_iterator & cell_2 = *it_2;
- AssertThrow(cell_1->is_ghost() == true, ExcMessage("Cell is not a ghost cell!"));
- AssertThrow(cell_2->is_ghost() == true, ExcMessage("Halo cell is not a ghost cell!"));
- deallog
- << "Ghost " << cell_1->level() << " " << cell_1->index() << " " << cell_1->id() << " " << cell_1->id().to_string() << " "
- << "Halo " << cell_2->level() << " " << cell_2->index() << " " << cell_2->id() << " " << cell_2->id().to_string()
- << std::endl;
- AssertThrow(cell_2 == cell_1, ExcMessage("Halo cell is not identical to ghost cell."));
- }
+ if (proc == Utilities::MPI::this_mpi_process(mpi_communicator))
+ {
+ for (typename std::vector<cell_iterator>::const_iterator
+ it_1 = ghost_cells_tria.begin(),
+ it_2 = ghost_cell_halo_layer.begin();
+ it_1 != ghost_cells_tria.end() &&
+ it_2 != ghost_cell_halo_layer.end();
+ ++it_1, ++it_2)
+ {
+ const cell_iterator &cell_1 = *it_1;
+ const cell_iterator &cell_2 = *it_2;
+ AssertThrow(cell_1->is_ghost() == true, ExcMessage("Cell is not a ghost cell!"));
+ AssertThrow(cell_2->is_ghost() == true, ExcMessage("Halo cell is not a ghost cell!"));
+ deallog
+ << "Ghost " << cell_1->level() << " " << cell_1->index() << " " << cell_1->id() << " " << cell_1->id().to_string() << " "
+ << "Halo " << cell_2->level() << " " << cell_2->index() << " " << cell_2->id() << " " << cell_2->id().to_string()
+ << std::endl;
+ AssertThrow(cell_2 == cell_1, ExcMessage("Halo cell is not identical to ghost cell."));
+ }
+ }
}
- }
}
#include <iomanip>
template<int dim>
-Point<dim> trans_func(Point<dim> & p);
+Point<dim> trans_func(Point<dim> &p);
template<>
-Point<2> trans_func(Point<2> & p)
+Point<2> trans_func(Point<2> &p)
{
Point<2> r(p(0)+p(1)*p(1),p(1));
return r;
}
template<>
-Point<3> trans_func(Point<3> & p)
+Point<3> trans_func(Point<3> &p)
{
Point<3> r(p(0)+p(1)*p(1),p(1),p(2));
return r;
void test ()
{
deallog << "dim = " << dim << std::endl;
-
+
Triangulation<dim> tria;
GridGenerator::hyper_cube(tria);
tria.refine_global(1);
tria.begin_active()->set_refine_flag();
tria.execute_coarsening_and_refinement();
-
+
deallog << "Unchanged grid:" << std::endl;
GridOut().write_gnuplot (tria, deallog.get_file_stream());
}
GridTools::transform(trans_func<dim>, tria);
-
+
deallog << "transformed grid:" << std::endl;
GridOut().write_gnuplot (tria, deallog.get_file_stream());
{
{
const int dim = 2;
- Triangulation< dim > tria;
+ Triangulation< dim > tria;
std::map< unsigned int, Point< dim > > new_points;
const unsigned int N = 16;
GridGenerator::subdivided_hyper_cube (tria, N, -5, 5);
// find the vertex at the origin
Triangulation<dim>::active_cell_iterator
- cell = GridTools::find_active_cell_around_point (tria,Point<dim>());
+ cell = GridTools::find_active_cell_around_point (tria,Point<dim>());
unsigned int best_vertex = cell->vertex_index(0);//vertex number on local triangulation
Point<dim> best_pos = cell->vertex(0);
double best_dist = Point<dim>().distance(best_pos);
- for (unsigned int vertex_no = 1; vertex_no < GeometryInfo<dim>::vertices_per_cell; vertex_no++) {
- const double dist = Point<dim>().distance(cell->vertex(vertex_no));
- if (dist < best_dist)
- {
- best_pos = cell->vertex(vertex_no);
- best_vertex = cell->vertex_index(vertex_no);
- best_dist = dist;
- }
- }
+ for (unsigned int vertex_no = 1; vertex_no < GeometryInfo<dim>::vertices_per_cell; vertex_no++)
+ {
+ const double dist = Point<dim>().distance(cell->vertex(vertex_no));
+ if (dist < best_dist)
+ {
+ best_pos = cell->vertex(vertex_no);
+ best_vertex = cell->vertex_index(vertex_no);
+ best_dist = dist;
+ }
+ }
// move the point at the origin by 2 units to the right
new_points[best_vertex] = Point<dim>();
new_points[best_vertex][0] += 2;
for ( ; cell != endc; ++cell)
if (cell->at_boundary() == true)
- for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell;++face)
- if (cell->face(face)->at_boundary() == true)
- for (unsigned int v=0; v < GeometryInfo<dim>::vertices_per_face;++v) {
- unsigned int vertex_number = cell->face(face)->vertex_index(v);
- new_points[vertex_number] = cell->face(face)->vertex(v);
- }
+ for (unsigned int face = 0; face < GeometryInfo<dim>::faces_per_cell; ++face)
+ if (cell->face(face)->at_boundary() == true)
+ for (unsigned int v=0; v < GeometryInfo<dim>::vertices_per_face; ++v)
+ {
+ unsigned int vertex_number = cell->face(face)->vertex_index(v);
+ new_points[vertex_number] = cell->face(face)->vertex(v);
+ }
// then compute new point locations and output the result
- GridTools::laplace_transform (new_points,tria);
+ GridTools::laplace_transform (new_points,tria);
std::ofstream out ("output");
GridOut grid_out;
grid_out.write_eps (tria, out);
{
public:
virtual double value (const Point<dim> &p,
- const unsigned int) const
- {
- return (p[0]>0 ? 10 : 1);
- }
+ const unsigned int) const
+ {
+ return (p[0]>0 ? 10 : 1);
+ }
};
// move backward two adjacent vertices of the top face up by one
// unit. all faces remain flat this way
-Point<3> distort_planar(Point<3> p)
+Point<3> distort_planar(Point<3> p)
{
- if (p(1) > 0.5 && p(2) > 0.5)
+ if (p(1) > 0.5 && p(2) > 0.5)
{
p(1) += 1;
}
// lift two opposite vertices of the top face up by one unit to create
// a saddle surface
-Point<3> distort_twisted(Point<3> p)
+Point<3> distort_twisted(Point<3> p)
{
- if (p(2) > 0.5 && (p(0) > 0.5 ^ p(1) > 0.5))
+ if (p(2) > 0.5 && (p(0) > 0.5 ^ p(1) > 0.5))
{
p(2) += 1;
}
double m = cell->face(i)->measure();
deallog << i << '\t' << measure_planar[i] << '\t' << m << std::endl;
}
-
+
deallog << "Twisted\n";
tria.clear();
GridGenerator::hyper_cube(tria);
{
double m;
try
- {
- m = cell->face(i)->measure();
- }
+ {
+ m = cell->face(i)->measure();
+ }
catch (...)
- {
- m = std::numeric_limits<double>::quiet_NaN();
- }
+ {
+ m = std::numeric_limits<double>::quiet_NaN();
+ }
deallog << i << '\t' << measure_twisted[i] << '\t' << m << std::endl;
}
// out, but we'd still like to print and check the data for the
// remaining faces
deal_II_exceptions::disable_abort_on_exception();
-
+
test ();
}
void mesh_info(const Triangulation<dim> &tria)
{
deallog << "Mesh info:" << std::endl
- << " dimension: " << dim << std::endl
- << " no. of cells: " << tria.n_active_cells() << std::endl;
+ << " dimension: " << dim << std::endl
+ << " no. of cells: " << tria.n_active_cells() << std::endl;
// Next loop over all faces of all cells and find how often each boundary
// indicator is used:
{
std::map<unsigned int, unsigned int> boundary_count;
typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
+ cell = tria.begin_active(),
+ endc = tria.end();
for (; cell!=endc; ++cell)
{
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
{
Triangulation<2> tria1;
GridGenerator::hyper_cube_with_cylindrical_hole (tria1, 0.25, 1.0);
-
+
Triangulation<2> tria3;
GridGenerator::hyper_cube_with_cylindrical_hole (tria3, 0.25, 1.0);
GridTools::shift (Point<2>(0,-2), tria3);
mesh_info(triangulation2);
deallog << "Number of active cells: "
- << triangulation2.n_active_cells()
- << std::endl;
+ << triangulation2.n_active_cells()
+ << std::endl;
deallog << "Total number of cells: "
- << triangulation2.n_cells()
- << std::endl;
+ << triangulation2.n_cells()
+ << std::endl;
}
//
// ---------------------------------------------------------------------
-// This script reproduces an issue with merging a hyper ball within a
+// This script reproduces an issue with merging a hyper ball within a
// hyper shell using dealII-8.0.0.
//
// Test by Bamdad Hosseini <bamdad.hosseini@gmail.com> (see mail to mailing
// created from the vertices of the input
{
- // we start by extracting the number of vertices and cell is
+ // we start by extracting the number of vertices and cell is
// the original triangulation
unsigned int n_vertices = tria_in.n_vertices();
unsigned int n_cells = tria_in.n_cells();
unsigned int n_active_cells = tria_in.n_active_cells();
-
- // also get all vertices
+
+ // also get all vertices
const std::vector< Point<dim> > vertices = tria_in.get_vertices();
// now we need to loop over all cells and extract the cell data.
typename Triangulation<dim>::active_cell_iterator
- cell=tria_in.begin_active(),
- endc=tria_in.end();
+ cell=tria_in.begin_active(),
+ endc=tria_in.end();
std::vector< CellData<dim> > cells(n_active_cells, CellData<dim>());
unsigned int cell_counter = 0;
- for(; cell!=endc; ++cell)
+ for (; cell!=endc; ++cell)
{
- for (unsigned int j=0;
- j < GeometryInfo<dim>::vertices_per_cell;
- ++j) {
- cells[cell_counter].vertices[j] = cell->vertex_index(j);
- }
+ for (unsigned int j=0;
+ j < GeometryInfo<dim>::vertices_per_cell;
+ ++j)
+ {
+ cells[cell_counter].vertices[j] = cell->vertex_index(j);
+ }
cells[cell_counter].material_id=0;
++cell_counter;
}
tria_out.create_triangulation(vertices, cells, SubCellData() );
}
-// this is a function to provide some basic information about the
-// triangulations. The code inside can be ignored. It produces an
-// eps image of the mesh so we can see the nodes are at the right
+// this is a function to provide some basic information about the
+// triangulations. The code inside can be ignored. It produces an
+// eps image of the mesh so we can see the nodes are at the right
// place.
template<int dim>
-void mesh_info(const Triangulation<dim> &tria,
- const std::string &filename)
+void mesh_info(const Triangulation<dim> &tria,
+ const std::string &filename)
{
deallog << "Mesh info for " << filename << ":" << std::endl
- << " dimension: " << dim << std::endl
- << " no. of cells: " << tria.n_active_cells() << std::endl;
+ << " dimension: " << dim << std::endl
+ << " no. of cells: " << tria.n_active_cells() << std::endl;
{
std::map<unsigned int, unsigned int> boundary_count;
typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(),
- endc = tria.end();
+ cell = tria.begin_active(),
+ endc = tria.end();
for (; cell!=endc; ++cell)
{
- for (unsigned int face=0;
- face<GeometryInfo<dim>::faces_per_cell;
- ++face)
- {
- if (cell->face(face)->at_boundary())
- boundary_count[cell->face(face)->boundary_id()]++;
- }
+ for (unsigned int face=0;
+ face<GeometryInfo<dim>::faces_per_cell;
+ ++face)
+ {
+ if (cell->face(face)->at_boundary())
+ boundary_count[cell->face(face)->boundary_id()]++;
+ }
}
deallog << " boundary indicators: ";
- for (std::map<unsigned int,
- unsigned int>::iterator it=boundary_count.begin();
- it!=boundary_count.end();
- ++it)
+ for (std::map<unsigned int,
+ unsigned int>::iterator it=boundary_count.begin();
+ it!=boundary_count.end();
+ ++it)
{
- deallog << it->first << "(" << it->second << " times) ";
+ deallog << it->first << "(" << it->second << " times) ";
}
deallog << std::endl;
}
void test ()
-{
+{
Point<2> center;
-
+
Triangulation<2> ball;
Triangulation<2> flat_ball;
Triangulation<2> shell;
GridGenerator::hyper_ball( ball, center, 0.5 );
GridGenerator::hyper_shell(shell, center, 0.5, 1, 8, true); //colorize flag set to true so outer bnd is 1 and inner is 0
- // set boundaries
- static const HyperBallBoundary<2> inner_bnd(center, 0.5);
+ // set boundaries
+ static const HyperBallBoundary<2> inner_bnd(center, 0.5);
static const HyperBallBoundary<2> outer_bnd(center, 1);
ball.set_boundary(0, inner_bnd);
shell.set_boundary(0, inner_bnd);
shell.set_boundary(1, outer_bnd);
- // first we need to refine the ball once to get the right
+ // first we need to refine the ball once to get the right
// nodes to merge the meshes
ball.refine_global(1);
-
- // flatten the refined ball so we have a coarse mesh to merge
+
+ // flatten the refined ball so we have a coarse mesh to merge
flatten_triangulation( ball, flat_ball );
mesh_info( shell, "shell.eps" );
mesh_info( ball, "ball.eps" );
mesh_info( flat_ball, "flat_ball.eps" );
- // now we merge (this throws an exception with no error messages
+ // now we merge (this throws an exception with no error messages
GridGenerator::merge_triangulations( flat_ball, shell, tria_out );
mesh_info(tria_out, "tria_out.eps");
}
deallog.threshold_double(1.e-10);
test ();
-
+
return 0;
}
for (unsigned int i=0; i<2; ++i)
{
for (typename Triangulation<dim>::active_cell_iterator
- cell = tria.begin_active(2); cell != tria.end(); ++cell)
- cell->set_coarsen_flag ();
+ cell = tria.begin_active(2); cell != tria.end(); ++cell)
+ cell->set_coarsen_flag ();
tria.execute_coarsening_and_refinement ();
}
deallog << tria.n_levels() << ' ' << tria.n_global_levels() << ' '
- << tria.last() << ' '
- << tria.last_active()
- << std::endl;
+ << tria.last() << ' '
+ << tria.last_active()
+ << std::endl;
}
tr1.copy_triangulation(tr2);
dofh.begin_active()->set_active_fe_index(0);
-
-
+
+
}
int main()
{
x_fe_values.reinit (cell);
std::vector<std::vector<Tensor<1,2> > >
- derivatives (q[0].size(), std::vector<Tensor<1,2> >(cell->get_fe().n_components()));
+ derivatives (q[0].size(), std::vector<Tensor<1,2> >(cell->get_fe().n_components()));
x_fe_values.get_present_fe_values().get_function_gradients (new_solution,
- derivatives);
+ derivatives);
}
// we are good if we made it to here
{
x_fe_values.reinit (cell);
std::vector<std::vector<Tensor<2,2> > >
- derivatives (q[0].size(), std::vector<Tensor<2,2> >(cell->get_fe().n_components()));
+ derivatives (q[0].size(), std::vector<Tensor<2,2> >(cell->get_fe().n_components()));
x_fe_values.get_present_fe_values().get_function_hessians (new_solution,
- derivatives);
+ derivatives);
}
// we are good if we made it to here
{
x_fe_values.reinit (cell);
std::vector<Vector<double> >
- derivatives (q[0].size(), Vector<double>(cell->get_fe().n_components()));
+ derivatives (q[0].size(), Vector<double>(cell->get_fe().n_components()));
x_fe_values.get_present_fe_values().get_function_laplacians (new_solution,
- derivatives);
+ derivatives);
}
// we are good if we made it to here
void print_dofs (const hp::DoFHandler<2>::active_cell_iterator &cell)
{
deallog << "DoFs on cell=" << cell << ": ";
-
+
std::vector<types::global_dof_index> dof_indices (cell->get_fe().dofs_per_cell);
cell->get_dof_indices (dof_indices);
for (unsigned int i=0; i<dof_indices.size(); ++i)
std::vector<unsigned int> subdivisions(dim, 1U);
subdivisions[0] = 2;
GridGenerator::subdivided_hyper_rectangle (triangulation,
- subdivisions,
- Point<dim>(0,0),
- Point<dim>(2,1));
+ subdivisions,
+ Point<dim>(0,0),
+ Point<dim>(2,1));
hp::FECollection<dim> fe_collection;
fe_collection.push_back(FESystem<dim>(FE_Nothing<dim>(),1));
print_dofs (dof_handler.begin_active());
print_dofs (++dof_handler.begin_active());
-
+
ConstraintMatrix constraints;
constraints.clear();
dealii::DoFTools::make_hanging_node_constraints (dof_handler, constraints);
void print_dofs (const hp::DoFHandler<2>::active_cell_iterator &cell)
{
deallog << "DoFs on cell=" << cell << ": ";
-
+
std::vector<types::global_dof_index> dof_indices (cell->get_fe().dofs_per_cell);
cell->get_dof_indices (dof_indices);
for (unsigned int i=0; i<dof_indices.size(); ++i)
std::vector<unsigned int> subdivisions(dim, 1U);
subdivisions[0] = 2;
GridGenerator::subdivided_hyper_rectangle (triangulation,
- subdivisions,
- Point<dim>(0,0),
- Point<dim>(2,1));
+ subdivisions,
+ Point<dim>(0,0),
+ Point<dim>(2,1));
hp::FECollection<dim> fe_collection;
fe_collection.push_back(FESystem<dim>(FE_Q<dim>(1),1,
print_dofs (dof_handler.begin_active());
print_dofs (++dof_handler.begin_active());
-
+
ConstraintMatrix constraints;
constraints.clear();
dealii::DoFTools::make_hanging_node_constraints (dof_handler, constraints);
template <int dim>
class ElasticProblem
{
- public:
+public:
ElasticProblem();
~ElasticProblem ();
void run();
- private:
- enum {
- u_block = 0,
- lambda_block = 1
+private:
+ enum
+ {
+ u_block = 0,
+ lambda_block = 1
};
-
+
void make_grid();
void setup_system ();
for (unsigned int i=0; i<dim; ++i)
for (unsigned int j=0; j<dim; ++j)
for (unsigned int k=0; k<dim; ++k)
- for (unsigned int l=0; l<dim; ++l)
- tmp[i][j][k][l] = (
- ((i==k) && (j==l) ? mu : 0.0) +
- ((i==l) && (j==k) ? mu : 0.0) +
- ((i==j) && (k==l) ? lambda : 0.0)
- );
+ for (unsigned int l=0; l<dim; ++l)
+ tmp[i][j][k][l] = (
+ ((i==k) && (j==l) ? mu : 0.0) +
+ ((i==l) && (j==k) ? mu : 0.0) +
+ ((i==j) && (k==l) ? lambda : 0.0)
+ );
return tmp;
}
BoundaryValues () : Function<dim>(dim) {}
virtual void vector_value (const Point<dim> &p,
- Vector<double> &values) const;
+ Vector<double> &values) const;
virtual double value (const Point<dim> &p,
- unsigned int compoment) const;
+ unsigned int compoment) const;
};
template <int dim>
inline
void BoundaryValues<dim>::vector_value (const Point<dim> &p,
- Vector<double> &values) const
+ Vector<double> &values) const
{
values(0) = -0.001;
}
template <int dim>
inline
double BoundaryValues<dim>::value (const Point<dim> &p,
- unsigned int compoment) const
+ unsigned int compoment) const
{
return -0.001;
}
public:
ConstrainValues (); //need to pass down to the base class of how many components the function consists; default - 1
virtual void vector_value (const Point<dim> &p,
- Vector<double> &values) const;//returns calculated values in the second argument;
+ Vector<double> &values) const;//returns calculated values in the second argument;
virtual void vector_value_list (const std::vector<Point<dim> > &points,
- std::vector<Vector<double> > &value_list) const;//values at several points at once
+ std::vector<Vector<double> > &value_list) const;//values at several points at once
//prevent from calling virtual function "vector_value" to frequently
};
template <int dim>
ConstrainValues<dim>::ConstrainValues ()
-:
-Function<dim> (dim) /*pass down to the main class the number of components of the function*/
+ :
+ Function<dim> (dim) /*pass down to the main class the number of components of the function*/
{}
template <int dim>
inline
void ConstrainValues<dim>::vector_value (const Point<dim> &p,
- Vector<double> &values) const
+ Vector<double> &values) const
{
Assert (values.size() == dim,
- ExcDimensionMismatch (values.size(), dim));//check is the size of "values" is correct
+ ExcDimensionMismatch (values.size(), dim));//check is the size of "values" is correct
//Assert (dim >= 2, ExcNotImplemented());//not implemented for 1d
values[0] = 0.0;
}
template <int dim>
void ConstrainValues<dim>::vector_value_list (const std::vector<Point<dim> > &points,
- std::vector<Vector<double> > &value_list) const
+ std::vector<Vector<double> > &value_list) const
{
Assert (value_list.size() == points.size(),
- ExcDimensionMismatch (value_list.size(), points.size()));//check if input-output is consistent
+ ExcDimensionMismatch (value_list.size(), points.size()));//check if input-output is consistent
const unsigned int n_points = points.size();//number of points at which the function is to be evaluated
ConstrainValues<dim>::vector_value (points[p],
value_list[p]);
}
-
+
/* constructor*/
template <int dim>
ElasticProblem<dim>::ElasticProblem ()
-:
-n_blocks(2),
-n_components(dim*n_blocks),
-first_u_comp(0),
-first_lamda_comp(dim),
-degree(1),
-dofs_per_block(n_blocks),
-dof_handler (triangulation), /*assotiate dof_handler to the triangulation */
-elasticity_fe (FE_Q<dim>(degree), dim, //use dim FE_Q of a given degree to represent displacements
- FE_Nothing<dim>(), dim // zero extension of lagrange multipliers elsewhere in the domain
-),
-elasticity_w_lagrange_fe(
- FE_Q<dim>(degree), dim,
- FE_Q<dim>(degree), dim // same for lagrange multipliers
-),
-u_fe(first_u_comp),
-lamda_fe(first_lamda_comp),
-id_of_lagrange_mult(1),
-beta1(1.0)
+ :
+ n_blocks(2),
+ n_components(dim *n_blocks),
+ first_u_comp(0),
+ first_lamda_comp(dim),
+ degree(1),
+ dofs_per_block(n_blocks),
+ dof_handler (triangulation), /*assotiate dof_handler to the triangulation */
+ elasticity_fe (FE_Q<dim>(degree), dim, //use dim FE_Q of a given degree to represent displacements
+ FE_Nothing<dim>(), dim // zero extension of lagrange multipliers elsewhere in the domain
+ ),
+ elasticity_w_lagrange_fe(
+ FE_Q<dim>(degree), dim,
+ FE_Q<dim>(degree), dim // same for lagrange multipliers
+ ),
+ u_fe(first_u_comp),
+ lamda_fe(first_lamda_comp),
+ id_of_lagrange_mult(1),
+ beta1(1.0)
{
fe.push_back (elasticity_fe);//FE index 0
fe.push_back (elasticity_w_lagrange_fe);//FE index 1
stress_strain_tensor
= get_stress_strain_tensor<dim> (/*lambda = */ 9.695e10,
- /*mu = */ 7.617e10);
+ /*mu = */ 7.617e10);
}
template <int dim>
ElasticProblem<dim>::~ElasticProblem ()
{
- dof_handler.clear ();
+ dof_handler.clear ();
}
GridTools::shift(shift_vector,triangulationR);
const unsigned int n_faces_per_cell = GeometryInfo< dim >::faces_per_cell;
-
+
triangulationL.begin_active()->set_material_id(0);
triangulationR.begin_active()->set_material_id(id_of_lagrange_mult);
- for (unsigned int i=0;i<n_faces_per_cell;i++) {
- triangulationL.begin_active()->face(i)->set_boundary_id(i);
- triangulationR.begin_active()->face(i)->set_boundary_id(n_faces_per_cell+i);
- }
-
+ for (unsigned int i=0; i<n_faces_per_cell; i++)
+ {
+ triangulationL.begin_active()->face(i)->set_boundary_id(i);
+ triangulationR.begin_active()->face(i)->set_boundary_id(n_faces_per_cell+i);
+ }
+
GridGenerator::merge_triangulations (triangulationL, triangulationR, triangulation);
-
+
//triangulation.refine_global (2); //refine twice globally before solving
}
//(1) set active FE indices based in material id...
typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
- endc = dof_handler.end();
+ endc = dof_handler.end();
unsigned int n_lagrange_cells = 0;
unsigned int n_elasticity_cells = 0;
for (; cell!=endc; ++cell) //loop over all cells
{
- if (cell->material_id() == id_of_lagrange_mult ) {
- cell->set_active_fe_index(1); // for lagrangian cells..
- n_lagrange_cells++;
- } else {
- cell->set_active_fe_index(0);
- n_elasticity_cells++;
- }
+ if (cell->material_id() == id_of_lagrange_mult )
+ {
+ cell->set_active_fe_index(1); // for lagrangian cells..
+ n_lagrange_cells++;
+ }
+ else
+ {
+ cell->set_active_fe_index(0);
+ n_elasticity_cells++;
+ }
}
deallog<<" number of cells (L/E): "<< n_lagrange_cells << "; "<<n_elasticity_cells <<std::endl;
Assert (n_lagrange_cells > 0, ExcInternalError()); //there should be at least 1 cell! Otherwise DoFHanlder crashes with 0 dofs for block 2!
//(3) create hanging nodes constrains (also add normal diricle BC here?
hanging_node_constraints.clear ();//clear all content that may left from previous calculations
DoFTools::make_hanging_node_constraints (dof_handler,
- hanging_node_constraints);//fill the object representing constraints
+ hanging_node_constraints);//fill the object representing constraints
hanging_node_constraints.close ();//close the object - sort and rearrange constraints for effective calculations
//(4) create block sparsity pattern (define which elements in sparse matrix are non-zero; prescribe coupling between blocks)
// following step-22 use of simple compressed block sparsity pattern for efficiency
BlockCompressedSparsityPattern compressed_sparsity_pattern(n_blocks,
- n_blocks);
+ n_blocks);
compressed_sparsity_pattern.block(u_block ,u_block ).reinit(dofs_per_block[u_block] ,dofs_per_block[u_block]);
compressed_sparsity_pattern.block(u_block ,lambda_block).reinit(dofs_per_block[u_block] ,dofs_per_block[lambda_block]);
compressed_sparsity_pattern.collect_sizes();
Table<2, DoFTools::Coupling> coupling(n_components, n_components);
- for (unsigned int ii = 0; ii< n_components;++ii)
+ for (unsigned int ii = 0; ii< n_components; ++ii)
for (unsigned int jj=0; jj< n_components; ++jj)
{
- if ( (block_component[ii]==lambda_block) &&
- (block_component[jj]==lambda_block)
- )
- coupling[ii][jj] = DoFTools::none;//diagonal = 0
- else
- coupling[ii][jj] = DoFTools::always;//full coupling (u,u), (u,lambda)
+ if ( (block_component[ii]==lambda_block) &&
+ (block_component[jj]==lambda_block)
+ )
+ coupling[ii][jj] = DoFTools::none;//diagonal = 0
+ else
+ coupling[ii][jj] = DoFTools::always;//full coupling (u,u), (u,lambda)
}
hanging_node_constraints.condense (compressed_sparsity_pattern);
DoFTools::make_sparsity_pattern (dof_handler,
- coupling,
- compressed_sparsity_pattern,
- hanging_node_constraints,
- false);
+ coupling,
+ compressed_sparsity_pattern,
+ hanging_node_constraints,
+ false);
compressed_sparsity_pattern.print (deallog.get_file_stream());
hanging_node_constraints.print (deallog.get_file_stream());
-}
-
-
-
+}
+
+
+
template <int dim>
void ElasticProblem<dim>::run ()
{
make_grid ();
setup_system ();
-}
-
+}
+
int main()
{
triangulation.refine_global (1);
FESystem<dim> elasticity_fe (FE_Q<dim>(1), 1,
- FE_Nothing<dim>(), 1);
+ FE_Nothing<dim>(), 1);
FESystem<dim> elasticity_w_lagrange_fe(FE_Q<dim>(1), 1,
- FE_Q<dim>(1), 1);
+ FE_Q<dim>(1), 1);
hp::FECollection<dim> fe;
fe.push_back (elasticity_fe);
fe.push_back (elasticity_w_lagrange_fe);
-
+
hp::DoFHandler<dim> dof_handler (triangulation);
typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
cell->set_active_fe_index(0);
dof_handler.distribute_dofs (fe);
ConstraintMatrix hanging_node_constraints;
DoFTools::make_hanging_node_constraints (dof_handler,
- hanging_node_constraints);
+ hanging_node_constraints);
hanging_node_constraints.close ();
// print constraints. there shouldn't be any
deallog << hanging_node_constraints.n_constraints() << std::endl;
hanging_node_constraints.print (deallog.get_file_stream());
-}
-
+}
+
int main()
{
triangulation.refine_global(4);
hp::FECollection<dim> fe_collection;
-
+
fe_collection.push_back (FESystem<dim>(FE_Q<dim>(2),dim,
- FE_Q<dim>(1),1,
- FE_Nothing<dim>(), dim));
+ FE_Q<dim>(1),1,
+ FE_Nothing<dim>(), dim));
fe_collection.push_back (FESystem<dim>(FE_Nothing<dim>(dim+1), 1,
FE_Q<dim>(2), dim));
- dof_handler.distribute_dofs (fe_collection);
+ dof_handler.distribute_dofs (fe_collection);
deallog << " Number of active cells: "
<< triangulation.n_active_cells()
<< dof_handler.n_dofs()
<< std::endl;
-
+
Vector<double> solution(dof_handler.n_dofs());
VectorTools::interpolate(dof_handler,
- ZeroFunction<dim>(2*dim+1),
- solution);
+ ZeroFunction<dim>(2*dim+1),
+ solution);
deallog << "l2_norm = " << solution.l2_norm() << std::endl;
}
FESystem<dim> fe(FE_Nothing<dim>(),1, FE_Q<dim>(1),1);
- deallog << "n support points: " << fe.get_unit_support_points().size() << std::endl;
+ deallog << "n support points: " << fe.get_unit_support_points().size() << std::endl;
+
-
DoFHandler<dim> dof_handler (triangulation);
- dof_handler.distribute_dofs (fe);
+ dof_handler.distribute_dofs (fe);
deallog << " Number of active cells: "
<< triangulation.n_active_cells()
<< std::endl
<< dof_handler.n_dofs()
<< std::endl;
-
+
Vector<double> solution(dof_handler.n_dofs());
VectorTools::interpolate(dof_handler,
- ZeroFunction<dim>(2),
- solution);
+ ZeroFunction<dim>(2),
+ solution);
deallog << "l2_norm = " << solution.l2_norm() << std::endl;
}
typename hp::DoFHandler<dim>::cell_iterator cell=dof_handler.begin(0);
Vector<double> local (fe[0].dofs_per_cell);
cell->get_interpolated_dof_values (solution, local,
- 0);
+ 0);
for (unsigned int i=0; i<local.size(); ++i)
deallog << local[i] << ' ';
deallog << std::endl;
cell->get_dof_values (solution, x);
deallog << "cell =" << cell << ": ";
for (unsigned int i=0; i<x.size(); ++i)
- deallog << x[i] << ' ';
+ deallog << x[i] << ' ';
deallog << std::endl;
}
}
template<int dim>
void test(const bool apply_constrains, const unsigned int hp)
{
- Triangulation<dim> triangulation;
- {
+ Triangulation<dim> triangulation;
+ {
Triangulation<dim> triangulationL;
Triangulation<dim> triangulationR;
GridGenerator::hyper_cube (triangulationL, -1,0); //create a square [-1,0]^d domain
shift_vector[0] = 1.0;
GridTools::shift(shift_vector,triangulationR);
GridGenerator::merge_triangulations (triangulationL, triangulationR, triangulation);
- }
-
- hp::FECollection<dim> fe;
- hp::DoFHandler<dim> dof_handler(triangulation);
- ConstraintMatrix constraints; //for boundary conditions
-
-
- // populate fe system:
- fe.push_back(FE_Q_Hierarchical<dim>(2));
- fe.push_back(FE_Q_Hierarchical<dim>(4));
-
- // set one cell to have different active_fe_index:
- typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
- cell->set_active_fe_index(1);
-
- // need to distribute dofs before refinement,
- // otherwise active fe index will not transfer to child cells
- dof_handler.distribute_dofs(fe);
-
- // refine first cell (simple case)
- std::string hp_string;
- if (hp == 1)
- {
- hp_string = "_hpSimple";
- cell->set_refine_flag();
- }
- // refine second cell
- else if (hp == 2)
- {
+ }
+
+ hp::FECollection<dim> fe;
+ hp::DoFHandler<dim> dof_handler(triangulation);
+ ConstraintMatrix constraints; //for boundary conditions
+
+
+ // populate fe system:
+ fe.push_back(FE_Q_Hierarchical<dim>(2));
+ fe.push_back(FE_Q_Hierarchical<dim>(4));
+
+ // set one cell to have different active_fe_index:
+ typename hp::DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active();
+ cell->set_active_fe_index(1);
+
+ // need to distribute dofs before refinement,
+ // otherwise active fe index will not transfer to child cells
+ dof_handler.distribute_dofs(fe);
+
+ // refine first cell (simple case)
+ std::string hp_string;
+ if (hp == 1)
+ {
+ hp_string = "_hpSimple";
+ cell->set_refine_flag();
+ }
+ // refine second cell
+ else if (hp == 2)
+ {
hp_string = "_hpComplex";
cell++;
cell->set_refine_flag();
- }
+ }
+
+ triangulation.execute_coarsening_and_refinement();
- triangulation.execute_coarsening_and_refinement();
+ dof_handler.distribute_dofs(fe);
+ constraints.clear ();
+ DoFTools::make_hanging_node_constraints(dof_handler, constraints);
+ constraints.close();
- dof_handler.distribute_dofs(fe);
- constraints.clear ();
- DoFTools::make_hanging_node_constraints(dof_handler, constraints);
- constraints.close();
+ const unsigned int n_dofs = dof_handler.n_dofs();
- const unsigned int n_dofs = dof_handler.n_dofs();
-
- Vector<double> v(n_dofs);
+ Vector<double> v(n_dofs);
- if (apply_constrains)
- deallog << hp_string << std::endl;
+ if (apply_constrains)
+ deallog << hp_string << std::endl;
- for (unsigned int i = 0; i < n_dofs; i++)
- {
- v = 0.;
- v[i] = 1.;
- if (apply_constrains)
- {
- constraints.distribute(v);
- deallog << "i="<<i<< std::endl;
- constraints.print(deallog.get_file_stream());
- }
+ for (unsigned int i = 0; i < n_dofs; i++)
+ {
+ v = 0.;
+ v[i] = 1.;
+ if (apply_constrains)
+ {
+ constraints.distribute(v);
+ deallog << "i="<<i<< std::endl;
+ constraints.print(deallog.get_file_stream());
+ }
#ifdef FEQH_DEBUG_OUTPUT
- DataOut<dim,hp::DoFHandler<dim> > data_out;
- data_out.attach_dof_handler (dof_handler);
+ DataOut<dim,hp::DoFHandler<dim> > data_out;
+ data_out.attach_dof_handler (dof_handler);
- data_out.add_data_vector (v, "shape_function");
+ data_out.add_data_vector (v, "shape_function");
- // do so rather big number of subdivision to better see shape functions
- data_out.build_patches (20);
+ // do so rather big number of subdivision to better see shape functions
+ data_out.build_patches (20);
- std::ostringstream filename;
- filename << "shape_" << dim << "d" << (apply_constrains ? "_constrained" : "") << hp_string << "_" << i << ".vtk";
+ std::ostringstream filename;
+ filename << "shape_" << dim << "d" << (apply_constrains ? "_constrained" : "") << hp_string << "_" << i << ".vtk";
- std::ofstream output (filename.str().c_str());
- data_out.write_vtk (output);
+ std::ofstream output (filename.str().c_str());
+ data_out.write_vtk (output);
#endif
- }
+ }
}
int main (int argc, char *argv[])
{
- std::ofstream logfile ("output");
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(2.e-15);
-
- test<2>(true,0);
- test<2>(true,1);
- test<2>(true,2);
-
-#ifdef FEQH_DEBUG_OUTPUT
- test<2>(false,0);
- test<2>(false,1);
- test<2>(false,2);
+ std::ofstream logfile ("output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(2.e-15);
+
+ test<2>(true,0);
+ test<2>(true,1);
+ test<2>(true,2);
+
+#ifdef FEQH_DEBUG_OUTPUT
+ test<2>(false,0);
+ test<2>(false,1);
+ test<2>(false,2);
#endif
}
\ No newline at end of file
// interpolate a linear function
Vector<double> vec (dof_handler.n_dofs());
VectorTools::interpolate (dof_handler,
- VectorFunctionFromScalarFunctionObject<dim> (&f<dim>, 0, dim),
+ VectorFunctionFromScalarFunctionObject<dim> (&f<dim>, 0, dim),
vec);
Vector<float> diff (tria.n_active_cells());
// interpolate the function
VectorTools::interpolate (dof_handler,
- ZeroFunction<dim>(hp_fe[0].n_components()),
- interpolant);
+ ZeroFunction<dim>(hp_fe[0].n_components()),
+ interpolant);
deallog << interpolant.l2_norm() << std::endl;
}
double alen, blen, clen;
private:
enum
- {omega1_domain_id,
- omega2_domain_id
+ {
+ omega1_domain_id,
+ omega2_domain_id
};
static bool
FESystem<dim> omega2_fe;
hp::FECollection<dim> fe_collection;
hp::DoFHandler<dim> dof_handler;
- QGauss<dim> quadrature_formula;
- QGauss<dim-1> face_quadrature_formula;
+ QGauss<dim> quadrature_formula;
+ QGauss<dim-1> face_quadrature_formula;
SparsityPattern sparsity_pattern;
std::map<types::global_dof_index, double> boundary_values;
-
+
Vector<double> system_rhs, U, Un, dU, U0;
-
+
//solution variables
std::vector<std::string> nodal_solution_names;
};
// Constructor
template <int dim>
-diffusionMechanics<dim>::diffusionMechanics (const unsigned int mech_degree, const unsigned int diff_degree):
-mech_degree (mech_degree),
-diff_degree (diff_degree),
-omega1_fe (FE_Q<dim>(mech_degree), dim,
- FE_Q<dim>(diff_degree), 1),
-omega2_fe (FE_Q<dim>(mech_degree), dim,
- FE_Nothing<dim>(), 1),
-dof_handler (triangulation), quadrature_formula(3), face_quadrature_formula(2){
-
+diffusionMechanics<dim>::diffusionMechanics (const unsigned int mech_degree, const unsigned int diff_degree):
+ mech_degree (mech_degree),
+ diff_degree (diff_degree),
+ omega1_fe (FE_Q<dim>(mech_degree), dim,
+ FE_Q<dim>(diff_degree), 1),
+ omega2_fe (FE_Q<dim>(mech_degree), dim,
+ FE_Nothing<dim>(), 1),
+ dof_handler (triangulation), quadrature_formula(3), face_quadrature_formula(2)
+{
+
//Nodal Solution names
- for (unsigned int i=0; i<dim; ++i){
- nodal_solution_names.push_back("u");
- }
+ for (unsigned int i=0; i<dim; ++i)
+ {
+ nodal_solution_names.push_back("u");
+ }
nodal_solution_names.push_back("c");
//FE object
alen = 10.0, blen = 10.0, clen = 4.0;
}
template <int dim>
-diffusionMechanics<dim>::~diffusionMechanics (){dof_handler.clear ();}
+diffusionMechanics<dim>::~diffusionMechanics ()
+{
+ dof_handler.clear ();
+}
//Initial conditions - use only if FE_Nothing not used. Else an error occurs with VectorTools::interpolate
template <int dim>
-class InitialConditions: public Function<dim>{
+class InitialConditions: public Function<dim>
+{
public:
- InitialConditions (): Function<dim>(totalDOF){}
- void vector_value (const Point<dim> &p, Vector<double> &values) const{
+ InitialConditions (): Function<dim>(totalDOF) {}
+ void vector_value (const Point<dim> &p, Vector<double> &values) const
+ {
Assert (values.size() == totalDOF, ExcDimensionMismatch (values.size(), totalDOF));
values(totalDOF-4)=0; // u=0
- values(totalDOF-3)=0;
- values(totalDOF-2)=0;
- values(totalDOF-1)=1.0;
+ values(totalDOF-3)=0;
+ values(totalDOF-2)=0;
+ values(totalDOF-1)=1.0;
};
};
// Boolean functions for specifying sub-domains
diffusionMechanics<dim>::
cell_is_in_omega1_domain (const typename hp::DoFHandler<dim>::cell_iterator &cell)
{
- return(cell->material_id() == omega1_domain_id);
+ return (cell->material_id() == omega1_domain_id);
}
template <int dim>
bool
diffusionMechanics<dim>::
cell_is_in_omega2_domain (const typename hp::DoFHandler<dim>::cell_iterator &cell)
{
- return(cell->material_id() == omega2_domain_id);
+ return (cell->material_id() == omega2_domain_id);
}
// Set active fe indices in each sub-domain
cell != dof_handler.end(); ++cell)
{
if (cell_is_in_omega1_domain(cell))
- cell->set_active_fe_index(0);
+ cell->set_active_fe_index(0);
else if (cell_is_in_omega2_domain(cell))
- cell->set_active_fe_index(1);
+ cell->set_active_fe_index(1);
else
- Assert(false, ExcNotImplemented());
+ Assert(false, ExcNotImplemented());
}
}
//Setup
template <int dim>
-void diffusionMechanics<dim>::setup_system(){
+void diffusionMechanics<dim>::setup_system()
+{
dof_handler.distribute_dofs (fe_collection);
sparsity_pattern.reinit (dof_handler.n_dofs(), dof_handler.n_dofs(), dof_handler.max_couplings_between_dofs());
- DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern); sparsity_pattern.compress();
- U.reinit (dof_handler.n_dofs()); Un.reinit (dof_handler.n_dofs()); dU.reinit (dof_handler.n_dofs()); system_rhs.reinit (dof_handler.n_dofs()); U0.reinit (dof_handler.n_dofs());
+ DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern);
+ sparsity_pattern.compress();
+ U.reinit (dof_handler.n_dofs());
+ Un.reinit (dof_handler.n_dofs());
+ dU.reinit (dof_handler.n_dofs());
+ system_rhs.reinit (dof_handler.n_dofs());
+ U0.reinit (dof_handler.n_dofs());
deallog << " Number of active cells: " << triangulation.n_active_cells() << std::endl;
- deallog << " Number of degrees of freedom: " << dof_handler.n_dofs() << std::endl;
+ deallog << " Number of degrees of freedom: " << dof_handler.n_dofs() << std::endl;
}
//Run
template <int dim>
-void diffusionMechanics<dim>::run (){
+void diffusionMechanics<dim>::run ()
+{
//subdivided_hyper
std::vector<unsigned int> repetitions(3);
else
cell->set_material_id(omega2_domain_id);
setup_dofs();
- setup_system();
+ setup_system();
//Initial conditions
- VectorTools::interpolate(dof_handler, InitialConditions<dim>(), Un);
- // VectorTools::interpolate(dof_handler, ZeroFunction<dim>(fe_collection.n_components()), Un);
- U=Un; U0=Un;
+ VectorTools::interpolate(dof_handler, InitialConditions<dim>(), Un);
+ // VectorTools::interpolate(dof_handler, ZeroFunction<dim>(fe_collection.n_components()), Un);
+ U=Un;
+ U0=Un;
deallog << Un.l2_norm() << std::endl;
}
// multiply matrix by 100 to
// make test more sensitive
for (SparseMatrix<double>::const_iterator p=matrix.begin();
- p!=matrix.end(); ++p)
- deallog.get_file_stream() << p->value() * 100
- << std::endl;
+ p!=matrix.end(); ++p)
+ deallog.get_file_stream() << p->value() * 100
+ << std::endl;
};
if (dim > 1)
// multiply matrix by 100 to
// make test more sensitive
for (SparseMatrix<double>::const_iterator p=matrix.begin();
- p!=matrix.end(); ++p)
- deallog.get_file_stream() << p->value() * 100
- << std::endl;
+ p!=matrix.end(); ++p)
+ deallog.get_file_stream() << p->value() * 100
+ << std::endl;
};
if (dim > 1)
unsigned int index=0;
for (typename hp::DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active();
+ cell = dof_handler.begin_active();
cell != dof_handler.end(); ++cell, ++index)
cell->set_active_fe_index (index);
private:
- Triangulation<dim> triangulation;
+ Triangulation<dim> triangulation;
hp::DoFHandler<dim> dof_handler;
hp::FECollection<dim> fe_collection;
template <int dim>
MixedFECollection<dim>::MixedFECollection ()
- :
- dof_handler (triangulation)
+ :
+ dof_handler (triangulation)
{
}
// looping over all cells and assigning the FE_DG object to the first cell
typename hp::DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
for (unsigned int counter = 0; cell!=endc; ++cell, counter ++)
if (counter == 0)
- {
- cell->set_active_fe_index (cell->active_fe_index() + 1);
- }
+ {
+ cell->set_active_fe_index (cell->active_fe_index() + 1);
+ }
dof_handler.distribute_dofs (fe_collection);
deallog << " Number of active cells: " << triangulation.n_active_cells() << std::endl
- << " Number of degrees of freedom: " << dof_handler.n_dofs() << std::endl;
+ << " Number of degrees of freedom: " << dof_handler.n_dofs() << std::endl;
}
}
for (unsigned int i=0; i<local.size(); ++i)
local(i) = i;
cell->set_dof_values_by_interpolation (local, solution,
- 0);
+ 0);
// for comparison purposes, also output the values of DoFs on all cells
for (typename hp::DoFHandler<dim>::active_cell_iterator cell=dof_handler.begin_active();
cell->get_dof_values (solution, x);
deallog << "cell =" << cell << ": ";
for (unsigned int i=0; i<x.size(); ++i)
- deallog << x[i] << ' ';
+ deallog << x[i] << ' ';
deallog << std::endl;
}
}
// Assign FE to cells
hp::DoFHandler<2>::active_cell_iterator cell;
- hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
+ hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
cell = dof_handler.begin_active();
triangulation.execute_coarsening_and_refinement ();
// Assign FE_Q_ to all cells
cell = dof_handler.begin_active();
- for( ; cell != endc; ++cell){
- cell->set_active_fe_index(0);
- }
+ for ( ; cell != endc; ++cell)
+ {
+ cell->set_active_fe_index(0);
+ }
dof_handler.distribute_dofs (fe_collection);
-
+
Vector<double> new_solution(dof_handler.n_dofs());
solultion_trans.interpolate(solution, new_solution);
// Assign FE to cells
hp::DoFHandler<2>::active_cell_iterator cell;
- hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
+ hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
cell = dof_handler.begin_active();
triangulation.execute_coarsening_and_refinement ();
dof_handler.distribute_dofs (fe_collection);
-
+
Vector<double> new_solution(dof_handler.n_dofs());
solultion_trans.interpolate(solution, new_solution);
// Assign FE to cells
hp::DoFHandler<2>::active_cell_iterator cell;
- hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
+ hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
cell = dof_handler.begin_active();
triangulation.execute_coarsening_and_refinement ();
dof_handler.distribute_dofs (fe_collection);
-
+
Vector<double> new_solution(dof_handler.n_dofs());
solultion_trans.interpolate(solution, new_solution);
data_out2.add_data_vector (new_solution, "Solution");
data_out2.build_patches();
data_out2.write_vtu(deallog.get_file_stream());
-
+
// we are good if we made it to here
deallog << "OK" << std::endl;
}
#include <deal.II/hp/dof_handler.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_nothing.h>
#include <deal.II/dofs/dof_tools.h>
deallog.threshold_double(1.e-10);
Triangulation<2> triangulation(Triangulation<2>::none);
- GridGenerator::hyper_cube (triangulation);
+ GridGenerator::hyper_cube (triangulation);
triangulation.refine_global(1);
-
+
hp::FECollection<2> fe_collection;
fe_collection.push_back(FE_Q<2>(1));
fe_collection.push_back(FE_Nothing<2>());
// Assign FEQ to all cells
hp::DoFHandler<2>::active_cell_iterator cell = dof_handler.begin_active();
- hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
+ hp::DoFHandler<2>::active_cell_iterator endc = dof_handler.end();
* -----------
* | 0 | 0 |
* -----------
- * | 1 | 1 | 0 - FEQ, 1 - FE_Nothing
+ * | 1 | 1 | 0 - FEQ, 1 - FE_Nothing
* -----------
*/
* -----------
* | | R |
* -----------
- * | R | |
+ * | R | |
* -----------
*/
Threads::ThreadGroup<> threads;
for (unsigned int thread=0; thread<n_threads; ++thread)
threads += Threads::new_thread (&Solver<dim>::assemble_matrix, *this,
- linear_system,
- thread_ranges[thread].first,
- thread_ranges[thread].second,
- mutex);
+ linear_system,
+ thread_ranges[thread].first,
+ thread_ranges[thread].second,
+ mutex);
assemble_rhs (linear_system.rhs);
linear_system.hanging_node_constraints.condense (linear_system.rhs);
= &DoFTools::make_hanging_node_constraints;
Threads::Thread<>
- mhnc_thread = Threads::new_thread (mhnc_p,dof_handler,
- hanging_node_constraints);
+ mhnc_thread = Threads::new_thread (mhnc_p,dof_handler,
+ hanging_node_constraints);
sparsity_pattern.reinit (dof_handler.n_dofs(),
dof_handler.n_dofs(),
SolverCG<> cg (solver_control);
check_solver_within_range(
- cg.solve(system_matrix, solution, system_rhs, PreconditionIdentity()),
- solver_control.last_step(), 629, 630);
+ cg.solve(system_matrix, solution, system_rhs, PreconditionIdentity()),
+ solver_control.last_step(), 629, 630);
solution.print (deallog.get_file_stream());
w2 = 0.;
fev1.get_function_values(u1, indices1, VectorSlice<std::vector<std::vector<double> > >(u1val), true);
upwind_face_residual(w1, w2, fev1, fev2,
- make_slice(u1val),
- make_slice(nullval),
- vel);
+ make_slice(u1val),
+ make_slice(nullval),
+ vel);
M11.vmult(v1,u1);
w1.add(-1., v1);
M21.vmult(v2,u1);
w2 = 0.;
fev2.get_function_values(u1, indices2, VectorSlice<std::vector<std::vector<double> > >(u1val), true);
upwind_face_residual(w1, w2, fev1, fev2,
- make_slice(nullval),
- make_slice(u1val),
- vel);
+ make_slice(nullval),
+ make_slice(u1val),
+ vel);
M12.vmult(v1,u1);
w1.add(-1., v1);
M22.vmult(v2,u1);
std::vector<FullMatrix<double> > matrices(2);
MeshWorker::Assembler::MatrixSimple<FullMatrix<double> > ass1;
ass1.initialize(matrices[0]);
-
+
deallog.push("Single block");
test(info1, ass1);
deallog.pop();
std::vector<FullMatrix<double> > matrices(2);
MeshWorker::Assembler::MatrixSimple<FullMatrix<double> > ass1;
ass1.initialize(matrices);
-
+
deallog.push("Single block");
test(info1, ass1);
deallog.pop();
for (unsigned int i=0; i<M.m(); ++i)
for (unsigned int j=0; j<M.n(); ++j)
{
- number entry = base + 10*i+j;
-// if (k >= results.n_matrices()/2) entry *= -1;
+ number entry = base + 10*i+j;
+// if (k >= results.n_matrices()/2) entry *= -1;
M(i,j) = entry;
if (face)
results.matrix(k, true).matrix(i,j) = entry;
/**
- * @file Test whether
+ * @file Test whether
*/
#include "../tests.h"
{
public:
LaplaceMatrix();
- virtual void cell(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const;
- virtual void boundary(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const;
- virtual void face(MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
- MeshWorker::IntegrationInfo<dim>& info1, MeshWorker::IntegrationInfo<dim>& info2) const;
+ virtual void cell(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const;
+ virtual void boundary(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const;
+ virtual void face(MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+ MeshWorker::IntegrationInfo<dim> &info1, MeshWorker::IntegrationInfo<dim> &info2) const;
};
template <int dim>
-void LaplaceMatrix<dim>::cell(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const
+void LaplaceMatrix<dim>::cell(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const
{
Laplace::cell_matrix(dinfo.matrix(0,false).matrix, info.fe_values());
}
template <int dim>
-void LaplaceMatrix<dim>::boundary(MeshWorker::DoFInfo<dim>& dinfo,
- typename MeshWorker::IntegrationInfo<dim>& info) const
+void LaplaceMatrix<dim>::boundary(MeshWorker::DoFInfo<dim> &dinfo,
+ typename MeshWorker::IntegrationInfo<dim> &info) const
{
const unsigned int deg = info.fe_values().get_fe().tensor_degree();
Laplace::nitsche_matrix(dinfo.matrix(0,false).matrix, info.fe_values(),
- Laplace::compute_penalty(dinfo, dinfo, deg, deg));
+ Laplace::compute_penalty(dinfo, dinfo, deg, deg));
}
template <int dim>
void LaplaceMatrix<dim>::face(
- MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
- MeshWorker::IntegrationInfo<dim>& info1, MeshWorker::IntegrationInfo<dim>& info2) const
+ MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+ MeshWorker::IntegrationInfo<dim> &info1, MeshWorker::IntegrationInfo<dim> &info2) const
{
if (info1.fe_values().get_fe().conforms(FiniteElementData<dim>::H1))
return;
-
+
const unsigned int deg = info1.fe_values().get_fe().tensor_degree();
-
+
if (info1.fe_values().get_fe().conforms(FiniteElementData<dim>::Hdiv) &&
- !info1.fe_values().get_fe().conforms(FiniteElementData<dim>::Hcurl))
- Laplace::ip_tangential_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
- dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
- info1.fe_values(), info2.fe_values(),
- Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
- else
- Laplace::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
- dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
- info1.fe_values(), info2.fe_values(),
- Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
+ !info1.fe_values().get_fe().conforms(FiniteElementData<dim>::Hcurl))
+ Laplace::ip_tangential_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
+ dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
+ info1.fe_values(), info2.fe_values(),
+ Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
+ else
+ Laplace::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
+ dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
+ info1.fe_values(), info2.fe_values(),
+ Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
}
template <int dim>
-void assemble_mg_matrix(DoFHandler<dim>& dof_handler,
- MeshWorker::LocalIntegrator<dim>& matrix_integrator, mg::SparseMatrixCollection<double>& mg)
+void assemble_mg_matrix(DoFHandler<dim> &dof_handler,
+ MeshWorker::LocalIntegrator<dim> &matrix_integrator, mg::SparseMatrixCollection<double> &mg)
{
MGConstrainedDoFs mg_constraints;
mg_constraints.clear();
mg_constraints.initialize(dof_handler);
-
+
mg.set_zero();
MappingQ1<dim> mapping;
-
+
MeshWorker::IntegrationInfoBox<dim> info_box;
UpdateFlags update_flags = update_values | update_gradients | update_hessians;
info_box.add_update_flags_all(update_flags);
info_box.initialize(dof_handler.get_fe(), mapping);
MeshWorker::DoFInfo<dim> dof_info(dof_handler);
-
+
MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > assembler;
assembler.initialize(mg_constraints);
assembler.initialize(mg.matrix);
assembler.initialize_interfaces(mg.matrix_in, mg.matrix_out);
assembler.initialize_fluxes(mg.matrix_up, mg.matrix_down);
-
+
MeshWorker::integration_loop<dim, dim> (
dof_handler.begin_mg(), dof_handler.end_mg(),
dof_info, info_box, matrix_integrator, assembler);
const unsigned int nlevels = dof_handler.get_tria().n_levels();
- for (unsigned int level=0;level<nlevels;++level)
- {
- for(unsigned int i=0; i<dof_handler.n_dofs(level); ++i)
- if(mg.matrix[level].diag_element(i)==0)
- mg.matrix[level].set(i,i,1.);
- }
+ for (unsigned int level=0; level<nlevels; ++level)
+ {
+ for (unsigned int i=0; i<dof_handler.n_dofs(level); ++i)
+ if (mg.matrix[level].diag_element(i)==0)
+ mg.matrix[level].set(i,i,1.);
+ }
}
GridGenerator::subdivided_hyper_rectangle(tr, repititions, p1, p2);
tr.begin_active()->set_refine_flag();
tr.execute_coarsening_and_refinement();
-
+
LaplaceMatrix<dim> matrix_integrator;
-
+
DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
dof.distribute_mg_dofs(fe);
mg.reinit(dof);
assemble_mg_matrix(dof, matrix_integrator, mg);
- for (unsigned int level=0;level<tr.n_levels();++level)
- {
- const unsigned int prec = 6;
- const unsigned int wd = 5;
-
- deallog << "Level " << level << std::endl << "mg" << std::endl;
- mg.matrix[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
- if (level>0)
- {
- deallog << "in" << std::endl;
- mg.matrix_in[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
- deallog << "out" << std::endl;
- mg.matrix_out[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
- deallog << "up" << std::endl;
- mg.matrix_up[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
- deallog << "down" << std::endl;
- mg.matrix_down[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
- }
- }
+ for (unsigned int level=0; level<tr.n_levels(); ++level)
+ {
+ const unsigned int prec = 6;
+ const unsigned int wd = 5;
+
+ deallog << "Level " << level << std::endl << "mg" << std::endl;
+ mg.matrix[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
+ if (level>0)
+ {
+ deallog << "in" << std::endl;
+ mg.matrix_in[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
+ deallog << "out" << std::endl;
+ mg.matrix_out[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
+ deallog << "up" << std::endl;
+ mg.matrix_up[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
+ deallog << "down" << std::endl;
+ mg.matrix_down[level].print_formatted(deallog.get_file_stream(), prec, false, wd, "0.");
+ }
+ }
}
sparsity.reinit(dof.block_info().global().size(),
dof.block_info().global().size());
BlockDynamicSparsityPattern c_sparsity(dof.block_info().global(),
- dof.block_info().global());
+ dof.block_info().global());
DoFTools::make_flux_sparsity_pattern(dof, c_sparsity, constraints, false);
sparsity.copy_from(c_sparsity);
template <int dim>
void
-Local<dim>::bdry(MeshWorker::DoFInfo<dim> & , CellInfo &) const
+Local<dim>::bdry(MeshWorker::DoFInfo<dim> &, CellInfo &) const
{}
template <int dim>
void
-Local<dim>::face(MeshWorker::DoFInfo<dim> & , MeshWorker::DoFInfo<dim> &,
+Local<dim>::face(MeshWorker::DoFInfo<dim> &, MeshWorker::DoFInfo<dim> &,
CellInfo &, CellInfo &) const
{}
dsp.block(0, 1).reinit (n_u, n_p);
dsp.block(1, 1).reinit (n_p, n_p);
- for (unsigned int i = 0; i < n_u; ++i) {
- for (unsigned int j = 0; j < n_u; ++j)
- dsp.block(0, 0).add(i, j);
- for (unsigned int j = 0; j < n_p; ++j) {
- dsp.block(0, 1).add(i, j);
- dsp.block(1, 0).add(j, i);
+ for (unsigned int i = 0; i < n_u; ++i)
+ {
+ for (unsigned int j = 0; j < n_u; ++j)
+ dsp.block(0, 0).add(i, j);
+ for (unsigned int j = 0; j < n_p; ++j)
+ {
+ dsp.block(0, 1).add(i, j);
+ dsp.block(1, 0).add(j, i);
+ }
}
- }
for (unsigned int i = 0; i < n_p; ++i)
for (unsigned int j = 0; j < n_p; ++j)
dsp.block(1, 1).add(i, j);
// Come up with some simple, but non-trivial structure:
- for(unsigned int i = 0; i < a.block(0, 0).n(); ++i)
+ for (unsigned int i = 0; i < a.block(0, 0).n(); ++i)
a.block(0, 0).set(i, i, 10.);
- for(unsigned int i = 0; i < a.block(1, 1).n(); ++i)
+ for (unsigned int i = 0; i < a.block(1, 1).n(); ++i)
a.block(1, 1).set(i, i, 5.);
- for(unsigned int i = 0; i < a.block(1, 0).m(); ++i)
+ for (unsigned int i = 0; i < a.block(1, 0).m(); ++i)
a.block(0, 1).set(i, i, 3.);
- for(unsigned int i = 0; i < a.block(0, 1).n(); ++i)
+ for (unsigned int i = 0; i < a.block(0, 1).n(); ++i)
a.block(1, 0).set(i, i, 1.);
auto op_b10 = linear_operator(a.block(1, 0));
auto op_b11 = linear_operator(a.block(1, 1));
- std::array<std::array<decltype(op_b00), 2>, 2> temp{op_b00, op_b01, op_b10,
- op_b11};
+ std::array<std::array<decltype(op_b00), 2>, 2> temp {op_b00, op_b01, op_b10,
+ op_b11
+ };
auto op_b = block_operator<2, 2, BlockVector<double>>(temp);
// vmult:
BlockVector<double> u;
op_a.reinit_domain_vector(u, false);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
PRINTME("u", u);
// And finally complicated block structures:
- std::array<std::array<decltype(op_b00), 3>, 3> temp2{
- op_b00, op_b01, op_b00, op_b10, op_b11, op_b10, op_b10, op_b11, op_b10};
+ std::array<std::array<decltype(op_b00), 3>, 3> temp2
+ {
+ op_b00, op_b01, op_b00, op_b10, op_b11, op_b10, op_b10, op_b11, op_b10
+ };
auto op_upp_x_upu = block_operator<3, 3, BlockVector<double>>(temp2);
op_upp_x_upu.reinit_domain_vector(u, false);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
PRINTME("u", u);
op_upp_x_upu.reinit_range_vector(v, false);
op_upp_x_upu.vmult_add(v, u);
PRINTME("v", v);
- std::array<std::array<decltype(op_b01), 1>, 3> temp3{op_b01, op_b11, op_b11};
+ std::array<std::array<decltype(op_b01), 1>, 3> temp3 {op_b01, op_b11, op_b11};
auto op_upp_x_p = block_operator<3, 1, BlockVector<double>>(temp3);
- std::array<std::array<decltype(op_b01), 3>, 1> temp4{op_b00, op_b01, op_b00};
+ std::array<std::array<decltype(op_b01), 3>, 1> temp4 {op_b00, op_b01, op_b00};
auto op_u_x_upu = block_operator<1, 3, BlockVector<double>>(temp4);
auto op_long = op_u_x_upu * transpose_operator(op_upp_x_upu) * op_upp_x_p;
op_long.reinit_domain_vector(u, false);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
PRINTME("u", u);
op_long.reinit_range_vector(v, false);
// Come up with a simple structure:
- for(unsigned int i = 0; i < a.block(0, 0).m(); ++i)
+ for (unsigned int i = 0; i < a.block(0, 0).m(); ++i)
a.block(0, 0).set(i, i, 10.);
- for(unsigned int i = 0; i < a.block(1, 1).m(); ++i)
+ for (unsigned int i = 0; i < a.block(1, 1).m(); ++i)
a.block(1, 1).set(i, i, 5.);
- for(unsigned int i = 0; i < a.block(2, 2).m(); ++i)
+ for (unsigned int i = 0; i < a.block(2, 2).m(); ++i)
a.block(2, 2).set(i, i, 3.);
auto op_b2 = linear_operator(a.block(2, 2));
- std::array<decltype(op_b0), 3> temp{op_b0, op_b1, op_b2};
+ std::array<decltype(op_b0), 3> temp {op_b0, op_b1, op_b2};
auto op_b = block_diagonal_operator<3, BlockVector<double>>(temp);
BlockVector<double> u;
op_a.reinit_domain_vector(u, false);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
PRINTME("u", u);
// And finally the other block_diagonal_operator variant:
- std::array<decltype(op_b0), 5> temp2{op_b0, op_b0, op_b0, op_b0, op_b0};
+ std::array<decltype(op_b0), 5> temp2 {op_b0, op_b0, op_b0, op_b0, op_b0};
auto op_c = block_diagonal_operator<5, BlockVector<double>>(temp2);
auto op_d = block_diagonal_operator<5, BlockVector<double>>(op_b0);
{
BlockVector<double> u;
op_c.reinit_domain_vector(u, false);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
PRINTME("u", u);
BlockVector<double> x;
BlockSparseMatrix<double> a (sparsity_pattern);
for (unsigned int i = 0; i < 3; ++i)
- {
- a.block(i,i).set(0, 0, i+i +1);
- for (unsigned int j = 0; j < i; ++j)
- a.block(i,j).set(0, 0, 10);
- }
+ {
+ a.block(i,i).set(0, 0, i+i +1);
+ for (unsigned int j = 0; j < i; ++j)
+ a.block(i,j).set(0, 0, 10);
+ }
BlockSparseMatrix<double> d(sparsity_pattern);
for (unsigned int i = 0; i < 3; ++i)
- d.block(i,i).set(0,0, 1.0 / (i+i +1) );
+ d.block(i,i).set(0,0, 1.0 / (i+i +1) );
auto op_a = linear_operator<BlockVector<double>>(a);
auto op_b2 = block_diagonal_operator(d);
auto inverse_op_a =
- block_forward_substitution<BlockVector<double>>(op_b1, op_b2);
+ block_forward_substitution<BlockVector<double>>(op_b1, op_b2);
auto identity = inverse_op_a * op_a;
deallog << " -- Matrix -- " << std::endl;
op_a.reinit_domain_vector(u, false);
op_a.reinit_range_vector(v, false);
- for(unsigned int j = 0; j<3; ++j)
- {
- for(unsigned int i = 0; i<3; ++i)
+ for (unsigned int j = 0; j<3; ++j)
{
- u.block(i)[0] = 0;;
- v.block(i)[0] = 0;
- }
- u.block(j)[0] = 1;
+ for (unsigned int i = 0; i<3; ++i)
+ {
+ u.block(i)[0] = 0;;
+ v.block(i)[0] = 0;
+ }
+ u.block(j)[0] = 1;
- op_a.vmult(v, u);
+ op_a.vmult(v, u);
- PRINTME("v", v);
- }
+ PRINTME("v", v);
+ }
deallog << " -- Inverse -- " << std::endl;
inverse_op_a.reinit_domain_vector(u, false);
inverse_op_a.reinit_range_vector(v, true);
- for(unsigned int j = 0; j<3; ++j)
- {
- for(unsigned int i = 0; i<3; ++i)
+ for (unsigned int j = 0; j<3; ++j)
{
- u.block(i)[0] = 0;
- v.block(i)[0] = 0;
- }
- u.block(j)[0] = 1;;
+ for (unsigned int i = 0; i<3; ++i)
+ {
+ u.block(i)[0] = 0;
+ v.block(i)[0] = 0;
+ }
+ u.block(j)[0] = 1;;
- inverse_op_a.vmult(v, u);
+ inverse_op_a.vmult(v, u);
- PRINTME("v", v);
- }
+ PRINTME("v", v);
+ }
deallog << " -- Identity -- " << std::endl;
identity.reinit_domain_vector(u, false);
identity.reinit_range_vector(v, false);
- for(unsigned int j = 0; j<3; ++j)
- {
- for(unsigned int i = 0; i<3; ++i)
+ for (unsigned int j = 0; j<3; ++j)
{
- u.block(i)[0] = 0;;
- v.block(i)[0] = 0;
- }
- u.block(j)[0] = 1;;
+ for (unsigned int i = 0; i<3; ++i)
+ {
+ u.block(i)[0] = 0;;
+ v.block(i)[0] = 0;
+ }
+ u.block(j)[0] = 1;;
- identity.vmult(v, u);
+ identity.vmult(v, u);
- PRINTME("v", v);
- }
+ PRINTME("v", v);
+ }
}
BlockSparseMatrix<double> a (sparsity_pattern);
for (unsigned int i = 0; i < 3; ++i)
- {
- a.block(i,i).set(0, 0, i+i +1);
- for (unsigned int j = i+1; j < 3; ++j)
- a.block(i,j).set(0, 0, 10);
- }
+ {
+ a.block(i,i).set(0, 0, i+i +1);
+ for (unsigned int j = i+1; j < 3; ++j)
+ a.block(i,j).set(0, 0, 10);
+ }
BlockSparseMatrix<double> d(sparsity_pattern);
for (unsigned int i = 0; i < 3; ++i)
auto op_b2 = block_diagonal_operator(d);
auto inverse_op_a =
- block_back_substitution<BlockVector<double>>(op_b1, op_b2);
+ block_back_substitution<BlockVector<double>>(op_b1, op_b2);
auto identity = inverse_op_a * op_a;
deallog << " -- Matrix -- " << std::endl;
op_a.reinit_domain_vector(u, false);
op_a.reinit_range_vector(v, false);
- for(unsigned int j = 0; j<3; ++j)
- {
- for(unsigned int i = 0; i<3; ++i)
+ for (unsigned int j = 0; j<3; ++j)
{
- u.block(i)[0] = 0;;
- v.block(i)[0] = 0;
- }
- u.block(j)[0] = 1;
+ for (unsigned int i = 0; i<3; ++i)
+ {
+ u.block(i)[0] = 0;;
+ v.block(i)[0] = 0;
+ }
+ u.block(j)[0] = 1;
- op_a.vmult(v, u);
+ op_a.vmult(v, u);
- PRINTME("v", v);
- }
+ PRINTME("v", v);
+ }
deallog << " -- Inverse -- " << std::endl;
inverse_op_a.reinit_domain_vector(u, false);
inverse_op_a.reinit_range_vector(v, true);
- for(unsigned int j = 0; j<3; ++j)
- {
- for(unsigned int i = 0; i<3; ++i)
+ for (unsigned int j = 0; j<3; ++j)
{
- u.block(i)[0] = 0;
- v.block(i)[0] = 0;
- }
- u.block(j)[0] = 1;;
+ for (unsigned int i = 0; i<3; ++i)
+ {
+ u.block(i)[0] = 0;
+ v.block(i)[0] = 0;
+ }
+ u.block(j)[0] = 1;;
- inverse_op_a.vmult(v, u);
+ inverse_op_a.vmult(v, u);
- PRINTME("v", v);
- }
+ PRINTME("v", v);
+ }
deallog << " -- Identity -- " << std::endl;
identity.reinit_domain_vector(u, false);
identity.reinit_range_vector(v, false);
- for(unsigned int j = 0; j<3; ++j)
- {
- for(unsigned int i = 0; i<3; ++i)
+ for (unsigned int j = 0; j<3; ++j)
{
- u.block(i)[0] = 0;;
- v.block(i)[0] = 0;
- }
- u.block(j)[0] = 1;;
+ for (unsigned int i = 0; i<3; ++i)
+ {
+ u.block(i)[0] = 0;;
+ v.block(i)[0] = 0;
+ }
+ u.block(j)[0] = 1;;
- identity.vmult(v, u);
+ identity.vmult(v, u);
- PRINTME("v", v);
- }
+ PRINTME("v", v);
+ }
}
}
void do_set (const bool even_or_odd,
- BlockSparseMatrix<double> &bsm)
+ BlockSparseMatrix<double> &bsm)
{
BlockSparseMatrix<double>::size_type col_indices[5];
for (unsigned int i=0; i<5 ; ++i)
void do_add (const bool even_or_odd,
- BlockSparseMatrix<double> &bsm)
+ BlockSparseMatrix<double> &bsm)
{
BlockSparseMatrix<double>::size_type col_indices[5];
for (unsigned int i=0; i<5 ; ++i)
// divide whole matrix by 100 to get back to the effect of a single set
bsm /= 100;
-
+
bsm.print_formatted (deallog.get_file_stream());
}
constraints.add_line(1);
constraints.add_entry(1,2,1.);
constraints.add_entry(1,3,1.);
-
+
constraints.add_line(3);
constraints.add_entry(3,4,1.);
constraints.add_entry(3,5,1.);
indices[1] = 2;
indices[2] = 3;
indices[3] = 5;
-
+
constraints.resolve_indices(indices);
for (unsigned int i=0; i<indices.size(); ++i)
matrix(i,i+1) = 1.5+i;
if (i<n-2)
matrix(i,i+2) = -1.65;
- matrix(i,n-1) = 2.;
- matrix(n-1,i) = -2.;
+ matrix(i,n-1) = 2.;
+ matrix(n-1,i) = -2.;
}
else
Assert(false, ExcMessage("Invalid variant"));
typedef int size_type;
template <typename Number>
- struct Vectorization_add_v
+struct Vectorization_add_v
{
Number *val;
Number *v_val;
void operator() (const tbb::blocked_range<size_type> &range) const
{
if (dealii::parallel::internal::EnableOpenMPSimdFor<Number>::value)
- {
- DEAL_II_OPENMP_SIMD_PRAGMA
+ {
+ DEAL_II_OPENMP_SIMD_PRAGMA
for (size_type i=range.begin(); i<range.end(); ++i)
val[i] += v_val[i];
}
for (size_type i=range.begin(); i<range.end(); ++i)
val[i] += v_val[i];
}
-
+
}
};
Vectorization_add_v<long double> vector_add;
vector_add.val = &d1[0];
vector_add.v_val = &d2[0];
-
+
if (1)
{
//fails:
tbb::parallel_for (tbb::blocked_range<size_type> (0,
- N,
- 2),
- vector_add,
- tbb::auto_partitioner());
+ N,
+ 2),
+ vector_add,
+ tbb::auto_partitioner());
}
else
{
typedef double value_type;
value_type value;
- LeftVector & operator = (value_type new_value)
+ LeftVector &operator = (value_type new_value)
{
value = new_value;
return *this;
}
- LeftVector & operator *= (value_type scale)
+ LeftVector &operator *= (value_type scale)
{
value *= scale;
return *this;
}
- LeftVector & operator /= (value_type scale)
+ LeftVector &operator /= (value_type scale)
{
value /= scale;
return *this;
}
- LeftVector & operator += (const LeftVector &u)
+ LeftVector &operator += (const LeftVector &u)
{
value += u.value;
return *this;
typedef double value_type;
value_type value;
- RightVector & operator = (value_type new_value)
+ RightVector &operator = (value_type new_value)
{
value = new_value;
return *this;
}
- RightVector & operator *= (value_type scale)
+ RightVector &operator *= (value_type scale)
{
value *= scale;
return *this;
}
- RightVector & operator /= (value_type scale)
+ RightVector &operator /= (value_type scale)
{
value /= scale;
return *this;
}
- RightVector & operator += (const RightVector &u)
+ RightVector &operator += (const RightVector &u)
{
value += u.value;
return *this;
typedef std::complex<double> value_type;
value_type value;
- LeftVector & operator = (value_type new_value)
+ LeftVector &operator = (value_type new_value)
{
value = new_value;
return *this;
}
- LeftVector & operator *= (value_type scale)
+ LeftVector &operator *= (value_type scale)
{
value *= scale;
return *this;
}
- LeftVector & operator /= (value_type scale)
+ LeftVector &operator /= (value_type scale)
{
value /= scale;
return *this;
}
- LeftVector & operator += (const LeftVector &u)
+ LeftVector &operator += (const LeftVector &u)
{
value += u.value;
return *this;
typedef std::complex<double> value_type;
value_type value;
- RightVector & operator = (value_type new_value)
+ RightVector &operator = (value_type new_value)
{
value = new_value;
return *this;
}
- RightVector & operator *= (value_type scale)
+ RightVector &operator *= (value_type scale)
{
value *= scale;
return *this;
}
- RightVector & operator /= (value_type scale)
+ RightVector &operator /= (value_type scale)
{
value /= scale;
return *this;
}
- RightVector & operator += (const RightVector &u)
+ RightVector &operator += (const RightVector &u)
{
value += u.value;
return *this;
Vector<double> u;
op_a.reinit_domain_vector(u, true);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
deallog << "u: " << u << std::endl;
Vector<std::complex<double>> u;
op_a.reinit_domain_vector(u, true);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (std::complex<double>)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (std::complex<double>)(i+1);
+ }
deallog << "u: " << u << std::endl;
#define PRINTME(name, var) \
deallog << name << ": [block 0] " << var.block(0) \
- << " [block 1] " << var.block(1) << std::endl;
+ << " [block 1] " << var.block(1) << std::endl;
using namespace dealii;
BlockSparseMatrix<double> a (sparsity_pattern);
BlockSparseMatrix<double> b (sparsity_pattern);
- for(unsigned int i = 0; i < a.n(); ++i)
- {
- a.set(i, i, 1.);
- b.set(i, i, 5.);
- }
+ for (unsigned int i = 0; i < a.n(); ++i)
+ {
+ a.set(i, i, 1.);
+ b.set(i, i, 5.);
+ }
// Constructors and assignment:
BlockVector<double> u;
op_a.reinit_domain_vector(u, true);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
PRINTME("u", u);
class MyMatrix1
{
public:
- size_t m() const { return 1; };
- size_t n() const { return 1; };
+ size_t m() const
+ {
+ return 1;
+ };
+ size_t n() const
+ {
+ return 1;
+ };
void vmult(Vector<double> &, const Vector<double> &) const
{
class MyMatrix2
{
public:
- size_t m() const { return 1; };
- size_t n() const { return 1; };
+ size_t m() const
+ {
+ return 1;
+ };
+ size_t n() const
+ {
+ return 1;
+ };
void vmult(Vector<double> &, const Vector<double> &) const
{
class MyMatrix3
{
public:
- size_t m() const { return 1; };
- size_t n() const { return 1; };
+ size_t m() const
+ {
+ return 1;
+ };
+ size_t n() const
+ {
+ return 1;
+ };
template<typename OutVector, typename InVector>
void vmult(OutVector &, const InVector &) const
class MyMatrix4
{
public:
- size_t m() const { return 1; };
- size_t n() const { return 1; };
+ size_t m() const
+ {
+ return 1;
+ };
+ size_t n() const
+ {
+ return 1;
+ };
template<typename OutVector, typename InVector>
void vmult(OutVector &, const InVector &, bool = true) const
class MyMatrix5
{
public:
- size_t m() const { return 1; };
- size_t n() const { return 1; };
+ size_t m() const
+ {
+ return 1;
+ };
+ size_t n() const
+ {
+ return 1;
+ };
template<typename number>
void vmult(Vector<number> &, const Vector<number> &, bool = true) const
class MyMatrix6
{
public:
- size_t m() const { return 1; };
- size_t n() const { return 1; };
+ size_t m() const
+ {
+ return 1;
+ };
+ size_t n() const
+ {
+ return 1;
+ };
template<typename number, typename number2>
void vmult(Vector<number> &, const Vector<number2> &, bool = true) const
// multiply matrix by 100 to
// make test more sensitive
for (SparseMatrix<double>::const_iterator p=matrix.begin();
- p!=matrix.end(); ++p)
- deallog.get_file_stream() << p->value() * 100
- << std::endl;
+ p!=matrix.end(); ++p)
+ deallog.get_file_stream() << p->value() * 100
+ << std::endl;
};
if (dim > 1)
for (unsigned int i=0; i<4; ++i)
for (unsigned int j=0; j<8; ++j)
if (i==j+1)
- sparse_matrix.set(i,j, i+3*j);
+ sparse_matrix.set(i,j, i+3*j);
MatrixOut matrix_out;
matrix_out.build_patches (sparse_matrix, "sparse_matrix",
for (unsigned int i=0; i<4; ++i)
for (unsigned int j=0; j<8; ++j)
if (i==j+1)
- sparse_matrix.set(i,j, i+3*j);
+ sparse_matrix.set(i,j, i+3*j);
sparse_matrix.compress(VectorOperation::insert);
MatrixOut matrix_out;
// Tests:
Vector<double> u(25);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
deallog << "u: " << u << std::endl;
// Tests:
Vector<std::complex<double>> u(25);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
deallog << "u: " << u << std::endl;
Vector<double> u;
M.reinit_domain_vector(u, true);
- for (unsigned int i = 0; i < u.size(); ++i) {
- u[i] = (double)(i+1);
- }
+ for (unsigned int i = 0; i < u.size(); ++i)
+ {
+ u[i] = (double)(i+1);
+ }
deallog << "u: " << u << std::endl;
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkConstructor1()
- {
- deallog << "Init with empty matrix" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P;
- deallog << "Is matrix empty:" << P.empty() << std::endl;
- }
+void
+checkConstructor1()
+{
+ deallog << "Init with empty matrix" << std::endl;
+ PointerMatrix<FullMatrix<number>, Vector<number> > P;
+ deallog << "Is matrix empty:" << P.empty() << std::endl;
+}
int
main()
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkConstructor2(FullMatrix<number> &A)
- {
- deallog << "Init with matrix A" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
- deallog << "Is matrix empty:" << P.empty() << std::endl;
- }
+void
+checkConstructor2(FullMatrix<number> &A)
+{
+ deallog << "Init with matrix A" << std::endl;
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
+ deallog << "Is matrix empty:" << P.empty() << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
A.fill(Adata);
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkConstructor3(char *name)
- {
- deallog << "Init with matrix name" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(name);
- deallog << "Is matrix empty:" << P.empty() << std::endl;
- }
+void
+checkConstructor3(char *name)
+{
+ deallog << "Init with matrix name" << std::endl;
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(name);
+ deallog << "Is matrix empty:" << P.empty() << std::endl;
+}
int
main()
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkConstructor4(const FullMatrix<number> &A, char *name)
- {
- deallog << "Init with matrix name and matrix" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
- deallog << "Is matrix empty:" << P.empty() << std::endl;
- }
+void
+checkConstructor4(const FullMatrix<number> &A, char *name)
+{
+ deallog << "Init with matrix name and matrix" << std::endl;
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+ deallog << "Is matrix empty:" << P.empty() << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
A.fill(Adata);
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkVmult(FullMatrix<number> &A, Vector<number> &V, char *name =
- "Test Matrix")
- {
- deallog << "vmult" << std::endl;
+void
+checkVmult(FullMatrix<number> &A, Vector<number> &V, char *name =
+ "Test Matrix")
+{
+ deallog << "vmult" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
- Vector<number> O(A.m());
- P.vmult(O, V);
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+ Vector<number> O(A.m());
+ P.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=A*V
- Vector<number> O_(A.m());
- A.vmult(O_, V);
+ // Verifying results with Method 2: O=A*V
+ Vector<number> O_(A.m());
+ A.vmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
A.fill(Adata);
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkTvmult(FullMatrix<number> &A, Vector<number> &V, char *name =
- "Test Matrix")
- {
- deallog << "Tvmult" << std::endl;
+void
+checkTvmult(FullMatrix<number> &A, Vector<number> &V, char *name =
+ "Test Matrix")
+{
+ deallog << "Tvmult" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
- Vector<number> O(A.m());
- P.Tvmult(O, V);
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+ Vector<number> O(A.m());
+ P.Tvmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=A Transpose*V
- Vector<number> O_(A.m());
- A.Tvmult(O_, V);
+ // Verifying results with Method 2: O=A Transpose*V
+ Vector<number> O_(A.m());
+ A.Tvmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
A.fill(Adata);
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkTvmult_add(FullMatrix<number> &A, Vector<number> &V, char *name =
- "Test Matrix")
- {
- deallog << "Tvmult_add" << std::endl;
+void
+checkTvmult_add(FullMatrix<number> &A, Vector<number> &V, char *name =
+ "Test Matrix")
+{
+ deallog << "Tvmult_add" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
- deallog << "Result vector set to all ones and to be added with result"
- << std::endl;
- Vector<number> O(V.size());
- for (unsigned int i = 0; i < O.size(); ++i)
- O(i) = 1;
+ deallog << "Result vector set to all ones and to be added with result"
+ << std::endl;
+ Vector<number> O(V.size());
+ for (unsigned int i = 0; i < O.size(); ++i)
+ O(i) = 1;
- P.Tvmult_add(O, V);
+ P.Tvmult_add(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=O+A Transpose*V
- Vector<number> O_(V.size());
- for (unsigned int i = 0; i < O_.size(); ++i)
- O_(i) = 1;
+ // Verifying results with Method 2: O=O+A Transpose*V
+ Vector<number> O_(V.size());
+ for (unsigned int i = 0; i < O_.size(); ++i)
+ O_(i) = 1;
- A.Tvmult_add(O_, V);
+ A.Tvmult_add(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
A.fill(Adata);
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkVmult_add(FullMatrix<number> &A, Vector<number> &V, char *name =
- "Test Matrix")
- {
- deallog << "vmult_add" << std::endl;
+void
+checkVmult_add(FullMatrix<number> &A, Vector<number> &V, char *name =
+ "Test Matrix")
+{
+ deallog << "vmult_add" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(&A, name);
- deallog << "Result vector set to all ones and to be added with result"
- << std::endl;
- Vector<number> O(V.size());
- for (unsigned int i = 0; i < O.size(); ++i)
- O(i) = 1;
+ deallog << "Result vector set to all ones and to be added with result"
+ << std::endl;
+ Vector<number> O(V.size());
+ for (unsigned int i = 0; i < O.size(); ++i)
+ O(i) = 1;
- P.vmult_add(O, V);
+ P.vmult_add(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=O+A*V
- Vector<number> O_(V.size());
- for (unsigned int i = 0; i < O_.size(); ++i)
- O_(i) = 1;
+ // Verifying results with Method 2: O=O+A*V
+ Vector<number> O_(V.size());
+ for (unsigned int i = 0; i < O_.size(); ++i)
+ O_(i) = 1;
- A.vmult_add(O_, V);
+ A.vmult_add(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
A.fill(Adata);
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkClear(FullMatrix<number> &A)
- {
- deallog << "clear" << std::endl;
- deallog << "Init with matrix 1" << std::endl;
+void
+checkClear(FullMatrix<number> &A)
+{
+ deallog << "clear" << std::endl;
+ deallog << "Init with matrix 1" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(A.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(A.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
- Vector<number> O(A.m());
- P.vmult(O, V);
+ Vector<number> O(A.m());
+ P.vmult(O, V);
- // Check the dimensions of the result vector
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result vector
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=A*V
- Vector<number> O_(A.m());
- A.vmult(O_, V);
+ // Verifying results with Method 2: O=A*V
+ Vector<number> O_(A.m());
+ A.vmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
- deallog << "Clearing pointer matrix" << std::endl;
- P.clear();
+ deallog << "Clearing pointer matrix" << std::endl;
+ P.clear();
- deallog << "Is matrix empty:" << P.empty() << std::endl;
- }
+ deallog << "Is matrix empty:" << P.empty() << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
A.fill(Adata);
#include <deal.II/lac/vector.h>
template<typename number>
- void
- checkAssign(FullMatrix<number> &A, FullMatrix<number> &B)
- {
- deallog << "=" << std::endl;
- deallog << "Init with matrix 1" << std::endl;
+void
+checkAssign(FullMatrix<number> &A, FullMatrix<number> &B)
+{
+ deallog << "=" << std::endl;
+ deallog << "Init with matrix 1" << std::endl;
- PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
+ PointerMatrix<FullMatrix<number>, Vector<number> > P(&A);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(A.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(A.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
- Vector<number> O(A.m());
- P.vmult(O, V);
+ Vector<number> O(A.m());
+ P.vmult(O, V);
- // Check the dimensions of the result vector
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result vector
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=A*V
- Vector<number> O_(A.m());
- A.vmult(O_, V);
+ // Verifying results with Method 2: O=A*V
+ Vector<number> O_(A.m());
+ A.vmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
- deallog << "Clearing pointer matrix" << std::endl;
- P.clear();
+ deallog << "Clearing pointer matrix" << std::endl;
+ P.clear();
- deallog << "Is matrix empty:" << P.empty() << std::endl;
+ deallog << "Is matrix empty:" << P.empty() << std::endl;
- deallog << "Assigning pointer matrix to matrix 2" << std::endl;
+ deallog << "Assigning pointer matrix to matrix 2" << std::endl;
- P = &B;
+ P = &B;
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V_(B.n());
- for (unsigned int i = 0; i < V_.size(); ++i)
- V_(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V_(B.n());
+ for (unsigned int i = 0; i < V_.size(); ++i)
+ V_(i) = 1;
- Vector<number> OU(B.m());
- P.vmult(OU, V_);
+ Vector<number> OU(B.m());
+ P.vmult(OU, V_);
- // Check the dimensions of the result vector
- Assert(B.m() == OU.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result vector
+ Assert(B.m() == OU.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=B*V
- Vector<number> OU_(B.m());
- B.vmult(OU_, V_);
+ // Verifying results with Method 2: O=B*V
+ Vector<number> OU_(B.m());
+ B.vmult(OU_, V_);
- Assert(OU == OU_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(OU == OU_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < OU.size(); ++i)
- deallog << OU(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < OU.size(); ++i)
+ deallog << OU(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
FullMatrix<double> A(2, 2);
A.fill(Adata);
PreconditionChebyshev<FullMatrixModified,Vector<double> > prec;
PreconditionChebyshev<FullMatrixModified,Vector<double> >::AdditionalData
- data;
+ data;
data.smoothing_range = 2 * size;
data.degree = 3;
prec.initialize(m, data);
#include <cmath>
template<typename number>
- void
- checkConstructor1(FullMatrix<number> &A, FullMatrix<number> &B)
- {
- deallog << "Init with empty constructor" << std::endl;
- GrowingVectorMemory < Vector<number> > mem;
- ProductMatrix < Vector<number> > P;
- P.initialize(A, B, mem);
+void
+checkConstructor1(FullMatrix<number> &A, FullMatrix<number> &B)
+{
+ deallog << "Init with empty constructor" << std::endl;
+ GrowingVectorMemory < Vector<number> > mem;
+ ProductMatrix < Vector<number> > P;
+ P.initialize(A, B, mem);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(B.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(B.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
- Vector<number> O(A.m());
+ Vector<number> O(A.m());
- P.vmult(O, V);
+ P.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=(A*B)*V
- FullMatrix<number> AB_Product(A.m(), B.n());
- Vector<number> O_(A.m());
+ // Verifying results with Method 2: O=(A*B)*V
+ FullMatrix<number> AB_Product(A.m(), B.n());
+ Vector<number> O_(A.m());
- A.mmult(AB_Product, B, false);
- AB_Product.vmult(O_, V);
+ A.mmult(AB_Product, B, false);
+ AB_Product.vmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 0, 1, 2, 3 };
+ { 0, 1, 2, 3 };
FullMatrix<double> A(2, 2);
FullMatrix<double> B(2, 2);
#include <cmath>
template<typename number>
- void
- checkConstructor2(FullMatrix<number> &A, FullMatrix<number> &B)
- {
- deallog << "Init with vector memory. Delayed reinit" << std::endl;
- GrowingVectorMemory < Vector<number> > mem;
- ProductMatrix < Vector<number> > P(mem);
- P.reinit(A, B);
+void
+checkConstructor2(FullMatrix<number> &A, FullMatrix<number> &B)
+{
+ deallog << "Init with vector memory. Delayed reinit" << std::endl;
+ GrowingVectorMemory < Vector<number> > mem;
+ ProductMatrix < Vector<number> > P(mem);
+ P.reinit(A, B);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(B.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
- Vector<number> O(A.m());
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(B.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
+ Vector<number> O(A.m());
- P.vmult(O, V);
+ P.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=(A*B)*V
- FullMatrix<number> AB_Product(A.m(), B.n());
- Vector<number> O_(A.m());
+ // Verifying results with Method 2: O=(A*B)*V
+ FullMatrix<number> AB_Product(A.m(), B.n());
+ Vector<number> O_(A.m());
- A.mmult(AB_Product, B, false);
- AB_Product.vmult(O_, V);
+ A.mmult(AB_Product, B, false);
+ AB_Product.vmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 0, 1, 2, 3 };
+ { 0, 1, 2, 3 };
FullMatrix<double> A(2, 2);
FullMatrix<double> B(2, 2);
#include <cmath>
template<typename number>
- void
- checkConstructor3(FullMatrix<number> &A, FullMatrix<number> &B)
- {
- deallog << "Init with vector memory, matrix 1 and matrix 2" << std::endl;
- GrowingVectorMemory < Vector<number> > mem;
- ProductMatrix < Vector<number> > P(A, B, mem);
+void
+checkConstructor3(FullMatrix<number> &A, FullMatrix<number> &B)
+{
+ deallog << "Init with vector memory, matrix 1 and matrix 2" << std::endl;
+ GrowingVectorMemory < Vector<number> > mem;
+ ProductMatrix < Vector<number> > P(A, B, mem);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(B.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
- Vector<number> O(A.m());
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(B.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
+ Vector<number> O(A.m());
- P.vmult(O, V);
+ P.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=(A*B)*V
- FullMatrix<number> AB_Product(A.m(), B.n());
- Vector<number> O_(A.m());
+ // Verifying results with Method 2: O=(A*B)*V
+ FullMatrix<number> AB_Product(A.m(), B.n());
+ Vector<number> O_(A.m());
- A.mmult(AB_Product, B, false);
- AB_Product.vmult(O_, V);
+ A.mmult(AB_Product, B, false);
+ AB_Product.vmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 0, 1, 2, 3 };
+ { 0, 1, 2, 3 };
FullMatrix<double> A(2, 2);
FullMatrix<double> B(2, 2);
#include <cmath>
template<typename number>
- void
- checkVmult(FullMatrix<number> &A, FullMatrix<number> &B, Vector<number> &V)
- {
- deallog << "vmult" << std::endl;
+void
+checkVmult(FullMatrix<number> &A, FullMatrix<number> &B, Vector<number> &V)
+{
+ deallog << "vmult" << std::endl;
- GrowingVectorMemory < Vector<number> > mem;
- ProductMatrix < Vector<number> > P(A, B, mem);
+ GrowingVectorMemory < Vector<number> > mem;
+ ProductMatrix < Vector<number> > P(A, B, mem);
- Vector<number> O(A.m());
+ Vector<number> O(A.m());
- P.vmult(O, V);
+ P.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=(A*B)*V
- FullMatrix<number> AB_Product(A.m(), B.n());
- Vector<number> O_(A.m());
+ // Verifying results with Method 2: O=(A*B)*V
+ FullMatrix<number> AB_Product(A.m(), B.n());
+ Vector<number> O_(A.m());
- A.mmult(AB_Product, B, false);
- AB_Product.vmult(O_, V);
+ A.mmult(AB_Product, B, false);
+ AB_Product.vmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 0, 1, 2, 3 };
+ { 0, 1, 2, 3 };
FullMatrix<double> A(2, 2);
FullMatrix<double> B(2, 2);
#include <cmath>
template<typename number>
- void
- checkVmult_add(FullMatrix<number> &A, FullMatrix<number> &B,
- Vector<number> &V)
- {
- deallog << "vmult_add" << std::endl;
- GrowingVectorMemory < Vector<number> > mem;
- ProductMatrix < Vector<number> > P(A, B, mem);
-
- deallog
- << "Result vector set to all ones and to be added with product result vector"
- << std::endl;
- Vector<number> O(V.size());
- for (unsigned int i = 0; i < O.size(); ++i)
- O(i) = 1;
-
- P.vmult_add(O, V);
-
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
-
- // Verifying results with Method 2: O=(A*B)*V
- FullMatrix<number> AB_Product(A.m(), B.n());
- Vector<number> O_(A.m());
- for (unsigned int i = 0; i < O_.size(); ++i)
- O_(i) = 1;
-
- A.mmult(AB_Product, B, false);
- AB_Product.vmult_add(O_, V);
-
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
-
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+void
+checkVmult_add(FullMatrix<number> &A, FullMatrix<number> &B,
+ Vector<number> &V)
+{
+ deallog << "vmult_add" << std::endl;
+ GrowingVectorMemory < Vector<number> > mem;
+ ProductMatrix < Vector<number> > P(A, B, mem);
+
+ deallog
+ << "Result vector set to all ones and to be added with product result vector"
+ << std::endl;
+ Vector<number> O(V.size());
+ for (unsigned int i = 0; i < O.size(); ++i)
+ O(i) = 1;
+
+ P.vmult_add(O, V);
+
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
+
+ // Verifying results with Method 2: O=(A*B)*V
+ FullMatrix<number> AB_Product(A.m(), B.n());
+ Vector<number> O_(A.m());
+ for (unsigned int i = 0; i < O_.size(); ++i)
+ O_(i) = 1;
+
+ A.mmult(AB_Product, B, false);
+ AB_Product.vmult_add(O_, V);
+
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
+
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 0, 1, 2, 3 };
+ { 0, 1, 2, 3 };
FullMatrix<double> A(2, 2);
FullMatrix<double> B(2, 2);
#include <cmath>
template<typename number>
- void
- checkTvmult(FullMatrix<number> &A, FullMatrix<number> &B, Vector<number> &V)
- {
- deallog << "Tvmult" << std::endl;
- GrowingVectorMemory < Vector<number> > mem;
- ProductMatrix < Vector<number> > P(A, B, mem);
+void
+checkTvmult(FullMatrix<number> &A, FullMatrix<number> &B, Vector<number> &V)
+{
+ deallog << "Tvmult" << std::endl;
+ GrowingVectorMemory < Vector<number> > mem;
+ ProductMatrix < Vector<number> > P(A, B, mem);
- Vector<number> O(V.size());
+ Vector<number> O(V.size());
- P.Tvmult(O, V);
+ P.Tvmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=(A*B)*V
- FullMatrix<number> AB_Product(A.m(), B.n());
- Vector<number> O_(A.m());
+ // Verifying results with Method 2: O=(A*B)*V
+ FullMatrix<number> AB_Product(A.m(), B.n());
+ Vector<number> O_(A.m());
- A.mmult(AB_Product, B, false);
- AB_Product.Tvmult(O_, V);
+ A.mmult(AB_Product, B, false);
+ AB_Product.Tvmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 0, 1, 2, 3 };
+ { 0, 1, 2, 3 };
FullMatrix<double> A(2, 2);
FullMatrix<double> B(2, 2);
#include <cmath>
template<typename number>
- void
- checkTvmult_add(FullMatrix<number> &A, FullMatrix<number> &B,
- Vector<number> &V)
- {
- deallog << "Tvmult_add" << std::endl;
- GrowingVectorMemory < Vector<number> > mem;
- ProductMatrix < Vector<number> > P(A, B, mem);
-
- deallog
- << "Result vector set to all ones and to be added with product result vector"
- << std::endl;
- Vector<number> O(V.size());
- for (unsigned int i = 0; i < O.size(); ++i)
- O(i) = 1;
-
- P.Tvmult_add(O, V);
-
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
-
- // Verifying results with Method 2: O=(A*B)*V
- FullMatrix<number> AB_Product(A.m(), B.n());
- Vector<number> O_(A.m());
- for (unsigned int i = 0; i < O_.size(); ++i)
- O_(i) = 1;
-
- A.mmult(AB_Product, B, false);
- AB_Product.Tvmult_add(O_, V);
-
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
-
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+void
+checkTvmult_add(FullMatrix<number> &A, FullMatrix<number> &B,
+ Vector<number> &V)
+{
+ deallog << "Tvmult_add" << std::endl;
+ GrowingVectorMemory < Vector<number> > mem;
+ ProductMatrix < Vector<number> > P(A, B, mem);
+
+ deallog
+ << "Result vector set to all ones and to be added with product result vector"
+ << std::endl;
+ Vector<number> O(V.size());
+ for (unsigned int i = 0; i < O.size(); ++i)
+ O(i) = 1;
+
+ P.Tvmult_add(O, V);
+
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
+
+ // Verifying results with Method 2: O=(A*B)*V
+ FullMatrix<number> AB_Product(A.m(), B.n());
+ Vector<number> O_(A.m());
+ for (unsigned int i = 0; i < O_.size(); ++i)
+ O_(i) = 1;
+
+ A.mmult(AB_Product, B, false);
+ AB_Product.Tvmult_add(O_, V);
+
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
+
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 0, 1, 2, 3 };
+ { 0, 1, 2, 3 };
FullMatrix<double> A(2, 2);
FullMatrix<double> B(2, 2);
#include <cmath>
template<typename number>
- void
- checkClear(FullMatrix<number> &A, FullMatrix<number> &B,
- FullMatrix<number> &C, FullMatrix<number> &D)
- {
- deallog << "clear" << std::endl;
- deallog << "Init with vector memory, matrix 1 and matrix 2" << std::endl;
- GrowingVectorMemory < Vector<number> > mem;
- ProductMatrix < Vector<number> > P(A, B, mem);
+void
+checkClear(FullMatrix<number> &A, FullMatrix<number> &B,
+ FullMatrix<number> &C, FullMatrix<number> &D)
+{
+ deallog << "clear" << std::endl;
+ deallog << "Init with vector memory, matrix 1 and matrix 2" << std::endl;
+ GrowingVectorMemory < Vector<number> > mem;
+ ProductMatrix < Vector<number> > P(A, B, mem);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(B.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(B.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
- Vector<number> O(A.m());
+ Vector<number> O(A.m());
- P.vmult(O, V);
+ P.vmult(O, V);
- // Check the dimensions of the result vector
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result vector
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: O=(A*B)*V
- FullMatrix<number> AB_Product(A.m(), B.n());
- Vector<number> O_(A.m());
+ // Verifying results with Method 2: O=(A*B)*V
+ FullMatrix<number> AB_Product(A.m(), B.n());
+ Vector<number> O_(A.m());
- A.mmult(AB_Product, B, false);
- AB_Product.vmult(O_, V);
+ A.mmult(AB_Product, B, false);
+ AB_Product.vmult(O_, V);
- Assert(O == O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(O == O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
- deallog << "Clearing product matrix" << std::endl;
- P.clear();
+ deallog << "Clearing product matrix" << std::endl;
+ P.clear();
- deallog << "Reinitializing product matrix with matrix 3 and matrix 4"
- << std::endl;
- P.reinit(C, D);
+ deallog << "Reinitializing product matrix with matrix 3 and matrix 4"
+ << std::endl;
+ P.reinit(C, D);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> _V(D.n());
- for (unsigned int i = 0; i < _V.size(); ++i)
- _V(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> _V(D.n());
+ for (unsigned int i = 0; i < _V.size(); ++i)
+ _V(i) = 1;
- Vector<number> _O(C.m());
+ Vector<number> _O(C.m());
- P.vmult(_O, _V);
+ P.vmult(_O, _V);
- // Check the dimensions of the result vector
- Assert(C.m() == _O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result vector
+ Assert(C.m() == _O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- // Verifying results with Method 2: _O=(C*D)*_V
- FullMatrix<number> CD_Product(C.m(), D.n());
- Vector<number> _O_(C.m());
+ // Verifying results with Method 2: _O=(C*D)*_V
+ FullMatrix<number> CD_Product(C.m(), D.n());
+ Vector<number> _O_(C.m());
- C.mmult(CD_Product, D, false);
- CD_Product.vmult(_O_, _V);
+ C.mmult(CD_Product, D, false);
+ CD_Product.vmult(_O_, _V);
- Assert(_O == _O_, ExcInternalError());
- deallog << "Result vector data verified" << std::endl;
+ Assert(_O == _O_, ExcInternalError());
+ deallog << "Result vector data verified" << std::endl;
- for (unsigned int i = 0; i < _O.size(); ++i)
- deallog << _O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < _O.size(); ++i)
+ deallog << _O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
const double Bdata[] =
- { 0, 1, 2, 3 };
+ { 0, 1, 2, 3 };
const double Cdata[] =
- { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
const double Ddata[] =
- { 10, 11, 12, 13, 14, 15, 16, 17, 18 };
+ { 10, 11, 12, 13, 14, 15, 16, 17, 18 };
FullMatrix<double> A(2, 2);
FullMatrix<double> B(2, 2);
#include <cmath>
template<typename number>
- void
- checkConstructor(FullMatrix<number> &A, double sigma)
- {
- deallog << "constructor" << std::endl;
+void
+checkConstructor(FullMatrix<number> &A, double sigma)
+{
+ deallog << "constructor" << std::endl;
- ShiftedMatrix < FullMatrix<number> > S(A, sigma);
+ ShiftedMatrix < FullMatrix<number> > S(A, sigma);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(A.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(A.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
- Vector<number> O(A.m());
+ Vector<number> O(A.m());
- S.vmult(O, V);
+ S.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
#include <cmath>
template<typename number>
- void
- checkVmult(FullMatrix<number> &A, double sigma, Vector<number> &V)
- {
- deallog << "vmult" << std::endl;
+void
+checkVmult(FullMatrix<number> &A, double sigma, Vector<number> &V)
+{
+ deallog << "vmult" << std::endl;
- ShiftedMatrix < FullMatrix<number> > S(A, sigma);
- Vector<number> O(A.m());
+ ShiftedMatrix < FullMatrix<number> > S(A, sigma);
+ Vector<number> O(A.m());
- S.vmult(O, V);
+ S.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
#include <cmath>
template<typename number>
- void
- checkResidual(FullMatrix<number> &A, double sigma, Vector<number> &V,
- Vector<number> &R)
- {
- deallog << "residual" << std::endl;
+void
+checkResidual(FullMatrix<number> &A, double sigma, Vector<number> &V,
+ Vector<number> &R)
+{
+ deallog << "residual" << std::endl;
- ShiftedMatrix < FullMatrix<number> > S(A, sigma);
- Vector<number> O(A.m());
- double residual;
+ ShiftedMatrix < FullMatrix<number> > S(A, sigma);
+ Vector<number> O(A.m());
+ double residual;
- residual = S.residual(O, V, R);
+ residual = S.residual(O, V, R);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- deallog << "Residual vector" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
+ deallog << "Residual vector" << std::endl;
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
- deallog << "Residual value" << std::endl;
- deallog << residual << std::endl;
- }
+ deallog << "Residual value" << std::endl;
+ deallog << residual << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
#include <cmath>
template<typename number>
- void
- checkSetSigma(FullMatrix<number> &A, double sigma)
- {
- deallog << "shift(sigma)" << std::endl;
+void
+checkSetSigma(FullMatrix<number> &A, double sigma)
+{
+ deallog << "shift(sigma)" << std::endl;
- deallog << "Init ShiftedMatrix with sigma=0" << std::endl;
- ShiftedMatrix < FullMatrix<number> > S(A, 0);
+ deallog << "Init ShiftedMatrix with sigma=0" << std::endl;
+ ShiftedMatrix < FullMatrix<number> > S(A, 0);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(A.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(A.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
- Vector<number> O(A.m());
+ Vector<number> O(A.m());
- S.vmult(O, V);
+ S.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
- deallog << "Setting new sigma value" << std::endl;
- S.shift(sigma);
+ deallog << "Setting new sigma value" << std::endl;
+ S.shift(sigma);
- deallog << "Multiplying with all ones vector" << std::endl;
- S.vmult(O, V);
+ deallog << "Multiplying with all ones vector" << std::endl;
+ S.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
#include <cmath>
template<typename number>
- void
- checkGetSigma(FullMatrix<number> &A)
- {
- deallog << "shift()" << std::endl;
+void
+checkGetSigma(FullMatrix<number> &A)
+{
+ deallog << "shift()" << std::endl;
- deallog << "Init ShiftedMatrix with sigma=0" << std::endl;
- ShiftedMatrix < FullMatrix<number> > S(A, 0);
+ deallog << "Init ShiftedMatrix with sigma=0" << std::endl;
+ ShiftedMatrix < FullMatrix<number> > S(A, 0);
- deallog << "Multiplying with all ones vector" << std::endl;
- Vector<number> V(A.n());
- for (unsigned int i = 0; i < V.size(); ++i)
- V(i) = 1;
+ deallog << "Multiplying with all ones vector" << std::endl;
+ Vector<number> V(A.n());
+ for (unsigned int i = 0; i < V.size(); ++i)
+ V(i) = 1;
- Vector<number> O(A.m());
+ Vector<number> O(A.m());
- S.vmult(O, V);
+ S.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
- deallog << "Setting new sigma value by incrementing old value by 1"
- << std::endl;
+ deallog << "Setting new sigma value by incrementing old value by 1"
+ << std::endl;
- deallog << "Old sigma value" << std::endl;
- double sigma = S.shift();
- deallog << sigma << std::endl;
- sigma = sigma + 1;
- deallog << "New sigma value" << std::endl;
- deallog << sigma << std::endl;
+ deallog << "Old sigma value" << std::endl;
+ double sigma = S.shift();
+ deallog << sigma << std::endl;
+ sigma = sigma + 1;
+ deallog << "New sigma value" << std::endl;
+ deallog << sigma << std::endl;
- S.shift(sigma);
+ S.shift(sigma);
- deallog << "Multiplying with all ones vector" << std::endl;
- S.vmult(O, V);
+ deallog << "Multiplying with all ones vector" << std::endl;
+ S.vmult(O, V);
- // Check the dimensions of the result matrix
- Assert(A.m() == O.size(), ExcInternalError());
- deallog << "Dimensions of result vector verified" << std::endl;
+ // Check the dimensions of the result matrix
+ Assert(A.m() == O.size(), ExcInternalError());
+ deallog << "Dimensions of result vector verified" << std::endl;
- for (unsigned int i = 0; i < O.size(); ++i)
- deallog << O(i) << '\t';
- deallog << std::endl;
- }
+ for (unsigned int i = 0; i < O.size(); ++i)
+ deallog << O(i) << '\t';
+ deallog << std::endl;
+}
int
main()
deallog.threshold_double(1.e-10);
const double Adata[] =
- { 2, 3, 4, 5 };
+ { 2, 3, 4, 5 };
FullMatrix<double> A(2, 2);
SolverControl::State monitor_norm (const unsigned int iteration,
- const double check_value,
- const Vector<double> ¤t_iterate)
+ const double check_value,
+ const Vector<double> ¤t_iterate)
{
deallog << " -- " << iteration << ' ' << check_value << std::endl;
deallog << " Norm=" << current_iterate.l2_norm() << std::endl;
SolverControl::State monitor_mean (const unsigned int iteration,
- const double check_value,
- const Vector<double> ¤t_iterate)
+ const double check_value,
+ const Vector<double> ¤t_iterate)
{
deallog << " Mean=" << current_iterate.mean_value() << std::endl;
return SolverControl::success;
// create CG and GMRES solvers and attach monitors to it
SolverCG<> cg(control, mem);
cg.connect (&monitor_norm);
- cg.connect (&monitor_mean);
+ cg.connect (&monitor_mean);
SolverGMRES<> gmres(control, mem, 8);
gmres.connect (&monitor_norm);
- gmres.connect (&monitor_mean);
+ gmres.connect (&monitor_mean);
for (unsigned int size=4; size <= 30; size *= 3)
{
SolverControl::State monitor_norm (const unsigned int iteration,
- const double check_value,
- const Vector<double> ¤t_iterate)
+ const double check_value,
+ const Vector<double> ¤t_iterate)
{
deallog << " -- " << iteration << ' ' << check_value << std::endl;
deallog << " Norm=" << current_iterate.l2_norm() << std::endl;
SolverControl::State monitor_mean (const unsigned int iteration,
- const double check_value,
- const Vector<double> ¤t_iterate)
+ const double check_value,
+ const Vector<double> ¤t_iterate)
{
deallog << " Mean=" << current_iterate.mean_value() << std::endl;
return SolverControl::success;
// create CG and GMRES solvers and attach monitors to it
SolverCG<> cg(control, mem);
boost::signals2::connection cg_c1 = cg.connect (&monitor_norm);
- boost::signals2::connection cg_c2 = cg.connect (&monitor_mean);
+ boost::signals2::connection cg_c2 = cg.connect (&monitor_mean);
for (unsigned int size=4; size <= 12; size *= 3)
{
};
ilu_pattern.compress();
- SparseILU<double>::AdditionalData data;
- data.use_this_sparsity = &ilu_pattern;
+ SparseILU<double>::AdditionalData data;
+ data.use_this_sparsity = &ilu_pattern;
SparseILU<double> ilu;
- ilu.initialize (A, data);
+ ilu.initialize (A, data);
// now for three test vectors v
// determine norm of
Assert (false, ExcNotImplemented());
};
ilu_pattern.compress();
- SparseILU<double>::AdditionalData data;
- data.use_this_sparsity = &ilu_pattern;
+ SparseILU<double>::AdditionalData data;
+ data.use_this_sparsity = &ilu_pattern;
SparseILU<double> ilu;
- ilu.initialize (A, data);
+ ilu.initialize (A, data);
// now for three test vectors v
// determine norm of
deallog.threshold_double(1.e-10);
const unsigned int size = 5;
const unsigned int row_length = 3;
-/*#else
- deallog.depth_console(1000);
- deallog.log_execution_time(true);
- deallog.log_time_differences(true);
- const unsigned int size = 50;
- const unsigned int row_length = 9;
- #endif*/
+ /*#else
+ deallog.depth_console(1000);
+ deallog.log_execution_time(true);
+ deallog.log_time_differences(true);
+ const unsigned int size = 50;
+ const unsigned int row_length = 9;
+ #endif*/
check_ez_iterator();
check_conjugate(logfile);
std::remove ("sparse_matrices.tmp");
SparseMatrix<double>::const_iterator p =A.begin(),
- p_tmp=A_tmp.begin();
+ p_tmp=A_tmp.begin();
for (; p!=A.end(); ++p, ++p_tmp)
if (std::fabs(p->value() - p_tmp->value()) <=
std::fabs(1e-14*p->value()))
Assert (false, ExcNotImplemented());
};
mic_pattern.compress();
- SparseMIC<double>::AdditionalData data;
- data.use_this_sparsity = &mic_pattern;
+ SparseMIC<double>::AdditionalData data;
+ data.use_this_sparsity = &mic_pattern;
SparseMIC<double> mic;
- mic.initialize (A, data);
+ mic.initialize (A, data);
// now for three test vectors v
// determine norm of
#include <iomanip>
template<typename number>
- void
- checkReadOnlyConstructor(const Vector<number> &V)
- {
- deallog << "Read-only constructor" << std::endl;
- VectorView<number> VV(V.size(), V.begin());
+void
+checkReadOnlyConstructor(const Vector<number> &V)
+{
+ deallog << "Read-only constructor" << std::endl;
+ VectorView<number> VV(V.size(), V.begin());
- deallog << "Printing Vector<number>" << std::endl;
- for (unsigned int i = 0; i < V.size(); ++i)
- deallog << V(i) << '\t';
- deallog << std::endl;
+ deallog << "Printing Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < V.size(); ++i)
+ deallog << V(i) << '\t';
+ deallog << std::endl;
- deallog << "Printing VectorView<number> pointing to Vector<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- deallog << VV(i) << '\t';
- deallog << std::endl;
+ deallog << "Printing VectorView<number> pointing to Vector<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ deallog << VV(i) << '\t';
+ deallog << std::endl;
- /* deallog << "Incrementing Vector<number> elements using Read-only handle of VectorView<number>" << std::endl;
- deallog << "Function fails beyond this point" << std::endl;
- for (unsigned int i=0; i<VV.size(); ++i)
- VV(i)=VV(i)+1; */
- }
+ /* deallog << "Incrementing Vector<number> elements using Read-only handle of VectorView<number>" << std::endl;
+ deallog << "Function fails beyond this point" << std::endl;
+ for (unsigned int i=0; i<VV.size(); ++i)
+ VV(i)=VV(i)+1; */
+}
int
main()
#include <iomanip>
template<typename number, typename size_type>
- void
- checkReinit1(const size_type N, const bool fast = false)
- {
- deallog << "Reinit with const size and fast" << std::endl;
+void
+checkReinit1(const size_type N, const bool fast = false)
+{
+ deallog << "Reinit with const size and fast" << std::endl;
- deallog
- << "Creating Vector<number> of size N+10 and filling with values 1 to N+10"
- << std::endl;
+ deallog
+ << "Creating Vector<number> of size N+10 and filling with values 1 to N+10"
+ << std::endl;
- Vector < number > V(N + 10);
- for (unsigned int i = 0; i < V.size(); i++)
- V(i) = i + 1;
+ Vector < number > V(N + 10);
+ for (unsigned int i = 0; i < V.size(); i++)
+ V(i) = i + 1;
- deallog
- << "Creating VectorView<number> of size N+10 pointing to Vector<number>"
- << std::endl;
- VectorView<number> VV(V.size(), V.begin());
+ deallog
+ << "Creating VectorView<number> of size N+10 pointing to Vector<number>"
+ << std::endl;
+ VectorView<number> VV(V.size(), V.begin());
- deallog << "Printing Vector<number>" << std::endl;
- for (unsigned int i = 0; i < V.size(); ++i)
- deallog << V(i) << '\t';
- deallog << std::endl;
+ deallog << "Printing Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < V.size(); ++i)
+ deallog << V(i) << '\t';
+ deallog << std::endl;
- deallog << "Printing VectorView<number> pointing to Vector<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- deallog << VV(i) << '\t';
- deallog << std::endl;
+ deallog << "Printing VectorView<number> pointing to Vector<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ deallog << VV(i) << '\t';
+ deallog << std::endl;
- deallog << "Reinit VectorView<number> to size N from N+10 with fast="
- << fast << std::endl;
- VV.reinit(N, fast);
+ deallog << "Reinit VectorView<number> to size N from N+10 with fast="
+ << fast << std::endl;
+ VV.reinit(N, fast);
- deallog << "Printing Vector<number>" << std::endl;
- for (unsigned int i = 0; i < V.size(); ++i)
- deallog << V(i) << '\t';
- deallog << std::endl;
+ deallog << "Printing Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < V.size(); ++i)
+ deallog << V(i) << '\t';
+ deallog << std::endl;
- deallog << "Printing VectorView<number> pointing to Vector<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- deallog << VV(i) << '\t';
- deallog << std::endl;
- }
+ deallog << "Printing VectorView<number> pointing to Vector<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ deallog << VV(i) << '\t';
+ deallog << std::endl;
+}
int
main()
#include <iomanip>
template<typename number>
- void
- checkReinit3(const Vector<number> &V)
- {
- deallog
- << "Reinit a ReadOnly VectorView<number> with const Vector<number> and const size"
- << std::endl;
-
- deallog
- << "Creating dummy Vector<number> of size V.size() and filling with zeros"
- << std::endl;
-
- Vector<number> _V(V.size());
- for (unsigned int i = 0; i < _V.size(); i++)
- _V(i) = 0;
-
- deallog << "Creating VectorView<number> pointing to dummy Vector<number>"
- << std::endl;
- VectorView<number> VV(_V.size(), _V.begin());
-
- deallog << "Printing dummy Vector<number>" << std::endl;
- for (unsigned int i = 0; i < _V.size(); ++i)
- deallog << _V(i) << '\t';
- deallog << std::endl;
-
- deallog << "Printing VectorView<number> pointing to dummy Vector<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- deallog << VV(i) << '\t';
- deallog << std::endl;
-
- deallog << "Reinit VectorView<number> to half of Vector<number>"
- << std::endl;
- VV.reinit(V.size() / 2, V.begin());
-
- deallog << "Printing Vector<number>" << std::endl;
- for (unsigned int i = 0; i < V.size(); ++i)
- deallog << V(i) << '\t';
- deallog << std::endl;
-
- deallog << "Printing VectorView<number> pointing to half of Vector<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- deallog << VV(i) << '\t';
- deallog << std::endl;
-
- /* deallog << "Incrementing Vector<number> elements using Read-only handle of VectorView<number>" << std::endl;
- deallog << "Function fails beyond this point" << std::endl;
- for (unsigned int i=0; i<VV.size(); ++i)
- VV(i)=VV(i)+1; */
- }
+void
+checkReinit3(const Vector<number> &V)
+{
+ deallog
+ << "Reinit a ReadOnly VectorView<number> with const Vector<number> and const size"
+ << std::endl;
+
+ deallog
+ << "Creating dummy Vector<number> of size V.size() and filling with zeros"
+ << std::endl;
+
+ Vector<number> _V(V.size());
+ for (unsigned int i = 0; i < _V.size(); i++)
+ _V(i) = 0;
+
+ deallog << "Creating VectorView<number> pointing to dummy Vector<number>"
+ << std::endl;
+ VectorView<number> VV(_V.size(), _V.begin());
+
+ deallog << "Printing dummy Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < _V.size(); ++i)
+ deallog << _V(i) << '\t';
+ deallog << std::endl;
+
+ deallog << "Printing VectorView<number> pointing to dummy Vector<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ deallog << VV(i) << '\t';
+ deallog << std::endl;
+
+ deallog << "Reinit VectorView<number> to half of Vector<number>"
+ << std::endl;
+ VV.reinit(V.size() / 2, V.begin());
+
+ deallog << "Printing Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < V.size(); ++i)
+ deallog << V(i) << '\t';
+ deallog << std::endl;
+
+ deallog << "Printing VectorView<number> pointing to half of Vector<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ deallog << VV(i) << '\t';
+ deallog << std::endl;
+
+ /* deallog << "Incrementing Vector<number> elements using Read-only handle of VectorView<number>" << std::endl;
+ deallog << "Function fails beyond this point" << std::endl;
+ for (unsigned int i=0; i<VV.size(); ++i)
+ VV(i)=VV(i)+1; */
+}
int
main()
#include <iomanip>
template<typename number>
- void
- checkReinit2(Vector<number> &V)
- {
- deallog
- << "Reinit a ReadWrite VectorView<number> with Vector<number> and const size"
- << std::endl;
-
- deallog
- << "Creating dummy Vector<number> of size V.size() and filling with zeros"
- << std::endl;
-
- Vector<number> _V(V.size());
- for (unsigned int i = 0; i < _V.size(); i++)
- _V(i) = 0;
-
- deallog << "Creating VectorView<number> pointing to dummy Vector<number>"
- << std::endl;
- VectorView<number> VV(_V.size(), _V.begin());
-
- deallog << "Printing dummy Vector<number>" << std::endl;
- for (unsigned int i = 0; i < _V.size(); ++i)
- deallog << _V(i) << '\t';
- deallog << std::endl;
-
- deallog << "Printing VectorView<number> pointing to dummy Vector<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- deallog << VV(i) << '\t';
- deallog << std::endl;
-
- deallog << "Reinit VectorView<number> to half of Vector<number>"
- << std::endl;
- VV.reinit(V.size() / 2, V.begin());
-
- deallog << "Printing Vector<number>" << std::endl;
- for (unsigned int i = 0; i < V.size(); ++i)
- deallog << V(i) << '\t';
- deallog << std::endl;
-
- deallog << "Printing VectorView<number> pointing to half of Vector<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- deallog << VV(i) << '\t';
- deallog << std::endl;
-
- deallog
- << "Incrementing Vector<number> elements using Read-write handle of VectorView<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- VV(i) = VV(i) + 1;
-
- deallog << "Printing modified Vector<number>" << std::endl;
- for (unsigned int i = 0; i < V.size(); ++i)
- deallog << V(i) << '\t';
- deallog << std::endl;
- }
+void
+checkReinit2(Vector<number> &V)
+{
+ deallog
+ << "Reinit a ReadWrite VectorView<number> with Vector<number> and const size"
+ << std::endl;
+
+ deallog
+ << "Creating dummy Vector<number> of size V.size() and filling with zeros"
+ << std::endl;
+
+ Vector<number> _V(V.size());
+ for (unsigned int i = 0; i < _V.size(); i++)
+ _V(i) = 0;
+
+ deallog << "Creating VectorView<number> pointing to dummy Vector<number>"
+ << std::endl;
+ VectorView<number> VV(_V.size(), _V.begin());
+
+ deallog << "Printing dummy Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < _V.size(); ++i)
+ deallog << _V(i) << '\t';
+ deallog << std::endl;
+
+ deallog << "Printing VectorView<number> pointing to dummy Vector<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ deallog << VV(i) << '\t';
+ deallog << std::endl;
+
+ deallog << "Reinit VectorView<number> to half of Vector<number>"
+ << std::endl;
+ VV.reinit(V.size() / 2, V.begin());
+
+ deallog << "Printing Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < V.size(); ++i)
+ deallog << V(i) << '\t';
+ deallog << std::endl;
+
+ deallog << "Printing VectorView<number> pointing to half of Vector<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ deallog << VV(i) << '\t';
+ deallog << std::endl;
+
+ deallog
+ << "Incrementing Vector<number> elements using Read-write handle of VectorView<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ VV(i) = VV(i) + 1;
+
+ deallog << "Printing modified Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < V.size(); ++i)
+ deallog << V(i) << '\t';
+ deallog << std::endl;
+}
int
main()
#include <iomanip>
template<typename number>
- void
- checkReadWriteConstructor(Vector<number> &V)
- {
- deallog << "Read-write constructor" << std::endl;
- VectorView<number> VV(V.size(), V.begin());
+void
+checkReadWriteConstructor(Vector<number> &V)
+{
+ deallog << "Read-write constructor" << std::endl;
+ VectorView<number> VV(V.size(), V.begin());
- deallog << "Printing Vector<number>" << std::endl;
- for (unsigned int i = 0; i < V.size(); ++i)
- deallog << V(i) << '\t';
- deallog << std::endl;
+ deallog << "Printing Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < V.size(); ++i)
+ deallog << V(i) << '\t';
+ deallog << std::endl;
- deallog << "Printing VectorView<number> pointing to Vector<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- deallog << VV(i) << '\t';
- deallog << std::endl;
+ deallog << "Printing VectorView<number> pointing to Vector<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ deallog << VV(i) << '\t';
+ deallog << std::endl;
- deallog
- << "Incrementing Vector<number> elements using Read-write handle of VectorView<number>"
- << std::endl;
- for (unsigned int i = 0; i < VV.size(); ++i)
- VV(i) = VV(i) + 1;
+ deallog
+ << "Incrementing Vector<number> elements using Read-write handle of VectorView<number>"
+ << std::endl;
+ for (unsigned int i = 0; i < VV.size(); ++i)
+ VV(i) = VV(i) + 1;
- deallog << "Printing modified Vector<number>" << std::endl;
- for (unsigned int i = 0; i < V.size(); ++i)
- deallog << V(i) << '\t';
- deallog << std::endl;
- }
+ deallog << "Printing modified Vector<number>" << std::endl;
+ for (unsigned int i = 0; i < V.size(); ++i)
+ deallog << V(i) << '\t';
+ deallog << std::endl;
+}
int
main()
#include <deal.II/grid/grid_out.h>
template<int dim, int spacedim>
-void print_info(Triangulation<dim,spacedim> &tria) {
+void print_info(Triangulation<dim,spacedim> &tria)
+{
typename Triangulation<dim,spacedim>::active_cell_iterator cell;
for (cell = tria.begin_active(); cell != tria.end(); ++cell)
{
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- if(cell->face(f)->at_boundary())
- deallog << "face: " << cell->face(f)
- << ", boundary_id: "
- << (int)cell->face(f)->boundary_id()
- << ", manifold_id: "
- << (int)cell->face(f)->manifold_id() << std::endl;
+ if (cell->face(f)->at_boundary())
+ deallog << "face: " << cell->face(f)
+ << ", boundary_id: "
+ << (int)cell->face(f)->boundary_id()
+ << ", manifold_id: "
+ << (int)cell->face(f)->manifold_id() << std::endl;
}
}
int main ()
{
initlog(true);
-
+
test<1,1>();
test<1,2>();
test<2,2>();
#include <deal.II/grid/grid_out.h>
template<int dim, int spacedim>
-void print_info(Triangulation<dim,spacedim> &tria) {
+void print_info(Triangulation<dim,spacedim> &tria)
+{
typename Triangulation<dim,spacedim>::active_cell_iterator cell;
for (cell = tria.begin_active(); cell != tria.end(); ++cell)
{
- deallog << "cell: " << cell
- << ", material_id: "
- << (int)cell->material_id()
- << ", manifold_id: "
- << (int)cell->manifold_id() << std::endl;
+ deallog << "cell: " << cell
+ << ", material_id: "
+ << (int)cell->material_id()
+ << ", manifold_id: "
+ << (int)cell->manifold_id() << std::endl;
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- deallog << "face: " << cell->face(f)
- << ", boundary_id: "
- << (int)cell->face(f)->boundary_id()
- << ", manifold_id: "
- << (int)cell->face(f)->manifold_id() << std::endl;
+ deallog << "face: " << cell->face(f)
+ << ", boundary_id: "
+ << (int)cell->face(f)->boundary_id()
+ << ", manifold_id: "
+ << (int)cell->face(f)->manifold_id() << std::endl;
}
}
int main ()
{
initlog(true);
-
+
test<1,1>();
test<1,2>();
test<2,2>();
template <int dim, int spacedim>
void test(unsigned int ref=1)
{
- deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
+ deallog << "Testing dim " << dim
+ << ", spacedim " << spacedim << std::endl;
CylindricalManifold<dim,spacedim> manifold;
-
+
Triangulation<dim,spacedim> tria;
GridGenerator::cylinder (tria);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- cell->set_all_manifold_ids(1);
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ cell->set_all_manifold_ids(1);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(1);
-
+
GridOut gridout;
gridout.write_msh(tria, deallog.get_file_stream());
}
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<3,3>();
-
+
return 0;
}
template <int dim, int spacedim>
void test(unsigned int ref=1)
{
- deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
-
+ deallog << "Testing dim " << dim
+ << ", spacedim " << spacedim << std::endl;
+
// Here the only allowed axis is z. In cylinder the default is x.
CylindricalManifold<dim,spacedim> manifold(2);
-
+
Triangulation<dim,spacedim> tria;
GridGenerator::cylinder_shell (tria, .5, .1, .25);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- cell->set_all_manifold_ids(1);
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ cell->set_all_manifold_ids(1);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(1);
-
+
GridOut gridout;
gridout.write_msh(tria, deallog.get_file_stream());
}
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<3,3>();
-
+
return 0;
}
GridGenerator::hyper_cube (tria);
tria.refine_global(1);
- typename Triangulation<dim,spacedim>::active_cell_iterator
- cell;
-
- for(cell=tria.begin_active(); cell!=tria.end(); ++cell) {
+ typename Triangulation<dim,spacedim>::active_cell_iterator
+ cell;
- // check that FlatManifold returns the middle of the cell.
- deallog << "Cell: " << cell << std::endl;
- if(cell->get_manifold().get_new_point_on_cell(cell).distance(cell->center()) > 1e-6) {
- deallog << "Default manifold: " << cell->get_manifold().get_new_point_on_cell(cell) << std::endl;
- deallog << "Center of cell : " << cell->center() << std::endl;
- } else {
- deallog << "OK!" << std::endl;
- }
- }
+ for (cell=tria.begin_active(); cell!=tria.end(); ++cell)
+ {
+
+ // check that FlatManifold returns the middle of the cell.
+ deallog << "Cell: " << cell << std::endl;
+ if (cell->get_manifold().get_new_point_on_cell(cell).distance(cell->center()) > 1e-6)
+ {
+ deallog << "Default manifold: " << cell->get_manifold().get_new_point_on_cell(cell) << std::endl;
+ deallog << "Center of cell : " << cell->center() << std::endl;
+ }
+ else
+ {
+ deallog << "OK!" << std::endl;
+ }
+ }
}
int main ()
GridGenerator::hyper_cube (tria);
tria.refine_global(1);
- typename Triangulation<dim,spacedim>::active_cell_iterator
- cell;
-
- for(cell=tria.begin_active(); cell!=tria.end(); ++cell) {
+ typename Triangulation<dim,spacedim>::active_cell_iterator
+ cell;
- // check that FlatManifold returns the middle of the cell.
- deallog << "Cell: " << cell << std::endl;
- for(unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f) {
- const typename Triangulation<dim,spacedim>::face_iterator &face = cell->face(f);
- if(face->get_manifold().get_new_point_on_face(face).distance(face->center()) > 1e-6) {
- deallog << "Face : " << face << std::endl;
- deallog << "Default manifold: " << cell->get_manifold().get_new_point_on_cell(cell) << std::endl;
- deallog << "Center of cell : " << cell->center() << std::endl;
- } else {
- deallog << "Face " << face << " is OK!" << std::endl;
- }
+ for (cell=tria.begin_active(); cell!=tria.end(); ++cell)
+ {
+
+ // check that FlatManifold returns the middle of the cell.
+ deallog << "Cell: " << cell << std::endl;
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ const typename Triangulation<dim,spacedim>::face_iterator &face = cell->face(f);
+ if (face->get_manifold().get_new_point_on_face(face).distance(face->center()) > 1e-6)
+ {
+ deallog << "Face : " << face << std::endl;
+ deallog << "Default manifold: " << cell->get_manifold().get_new_point_on_cell(cell) << std::endl;
+ deallog << "Center of cell : " << cell->center() << std::endl;
+ }
+ else
+ {
+ deallog << "Face " << face << " is OK!" << std::endl;
+ }
+ }
}
- }
}
int main ()
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<2,2>();
test<2,3>();
test<3,3>();
-
+
return 0;
}
{
deallog << "Testing dim=" << dim
<< ", spacedim="<< spacedim << std::endl;
-
+
Point<spacedim> periodicity;
periodicity[0] = 5.0;
-
+
FlatManifold<dim,spacedim> manifold(periodicity);
-
+
Quadrature<spacedim> quad;
std::vector<std::vector<Point<spacedim> > >ps(10,std::vector<Point<spacedim> >(2));
Point<spacedim> middle;
std::vector<double > ws(2, 0.5);
-
+
// Case 1: both points are close to left boundary of periodicity
ps[0][0][0] = 1;
ps[0][1][0] = 2;
// Case 10: same, opposite order
ps[9][0][0] = 5+1e-10;
ps[9][1][0] = -1e-10;
-
- for(unsigned int i=0; i<ps.size(); ++i) {
- quad = Quadrature<spacedim>(ps[i],ws);
- middle = manifold.get_new_point(quad);
- deallog << "P0: " << ps[i][0] << " , P1: " << ps[i][1] << " , Middle: " << middle << std::endl;
- }
-
+
+ for (unsigned int i=0; i<ps.size(); ++i)
+ {
+ quad = Quadrature<spacedim>(ps[i],ws);
+ middle = manifold.get_new_point(quad);
+ deallog << "P0: " << ps[i][0] << " , P1: " << ps[i][1] << " , Middle: " << middle << std::endl;
+ }
+
}
int main ()
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-8);
-
+
test<1,1>();
test<1,2>();
test<2,2>();
test<2,3>();
test<3,3>();
-
+
return 0;
}
template <int dim, int spacedim>
void test(unsigned int ref=1)
{
- deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
-
+ deallog << "Testing dim " << dim
+ << ", spacedim " << spacedim << std::endl;
+
// Here the only allowed axis is z. In cylinder the default is x.
std::string push_forward_expression;
std::string pull_back_expression;
- switch(spacedim) {
- case 2:
- push_forward_expression = "x; y";
- pull_back_expression = "x; y";
- break;
- case 3:
- push_forward_expression = "x; y; z";
- pull_back_expression = "x; y; z";
- break;
- default:
- Assert(false, ExcInternalError());
- }
-
- FunctionManifold<dim,spacedim,spacedim> manifold(push_forward_expression,
- pull_back_expression);
+ switch (spacedim)
+ {
+ case 2:
+ push_forward_expression = "x; y";
+ pull_back_expression = "x; y";
+ break;
+ case 3:
+ push_forward_expression = "x; y; z";
+ pull_back_expression = "x; y; z";
+ break;
+ default:
+ Assert(false, ExcInternalError());
+ }
+
+ FunctionManifold<dim,spacedim,spacedim> manifold(push_forward_expression,
+ pull_back_expression);
Triangulation<dim,spacedim> tria;
GridGenerator::hyper_cube (tria, 0, 1);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- cell->set_all_manifold_ids(1);
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ cell->set_all_manifold_ids(1);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(2);
-
+
GridOut gridout;
gridout.write_msh(tria, deallog.get_file_stream());
}
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
-
+
+
test<2,2>();
test<3,3>();
-
+
return 0;
}
template <int dim, int spacedim>
void test(unsigned int ref=1)
{
- deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
-
+ deallog << "Testing dim " << dim
+ << ", spacedim " << spacedim << std::endl;
+
// Here the only allowed axis is z. In cylinder the default is x.
std::string push_forward_expression;
std::string pull_back_expression;
- switch(spacedim) {
- case 2:
- push_forward_expression = "x^2; y^2";
- pull_back_expression = "sqrt(x); sqrt(y)";
- break;
- case 3:
- push_forward_expression = "x^2; y^2; z^2";
- pull_back_expression = "sqrt(x); sqrt(y); sqrt(z)";
- break;
- default:
- Assert(false, ExcInternalError());
- }
-
- FunctionManifold<dim,spacedim,spacedim> manifold(push_forward_expression,
- pull_back_expression);
+ switch (spacedim)
+ {
+ case 2:
+ push_forward_expression = "x^2; y^2";
+ pull_back_expression = "sqrt(x); sqrt(y)";
+ break;
+ case 3:
+ push_forward_expression = "x^2; y^2; z^2";
+ pull_back_expression = "sqrt(x); sqrt(y); sqrt(z)";
+ break;
+ default:
+ Assert(false, ExcInternalError());
+ }
+
+ FunctionManifold<dim,spacedim,spacedim> manifold(push_forward_expression,
+ pull_back_expression);
Triangulation<dim,spacedim> tria;
GridGenerator::hyper_cube (tria, 0, 1);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- cell->set_all_manifold_ids(1);
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ cell->set_all_manifold_ids(1);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(2);
-
+
GridOut gridout;
gridout.write_msh(tria, deallog.get_file_stream());
}
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
-
+
+
test<2,2>();
test<3,3>();
-
+
return 0;
}
#include <deal.II/grid/grid_out.h>
template<int dim, int spacedim>
-void print_info(Triangulation<dim,spacedim> &tria) {
+void print_info(Triangulation<dim,spacedim> &tria)
+{
typename Triangulation<dim,spacedim>::active_cell_iterator cell;
for (cell = tria.begin_active(); cell != tria.end(); ++cell)
{
- deallog << "cell: " << cell
- << ", material_id: "
- << (int)cell->material_id()
- << ", manifold_id: "
- << (int)cell->manifold_id() << std::endl;
+ deallog << "cell: " << cell
+ << ", material_id: "
+ << (int)cell->material_id()
+ << ", manifold_id: "
+ << (int)cell->manifold_id() << std::endl;
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- deallog << "face: " << cell->face(f)
- << ", boundary_id: "
- << (int)cell->face(f)->boundary_id()
- << ", manifold_id: "
- << (int)cell->face(f)->manifold_id() << std::endl;
+ deallog << "face: " << cell->face(f)
+ << ", boundary_id: "
+ << (int)cell->face(f)->boundary_id()
+ << ", manifold_id: "
+ << (int)cell->face(f)->manifold_id() << std::endl;
}
}
int main ()
{
initlog(true);
-
+
test<1,1>();
test<1,2>();
test<2,2>();
#include <deal.II/grid/grid_out.h>
template<int dim, int spacedim>
-void print_info(Triangulation<dim,spacedim> &tria) {
+void print_info(Triangulation<dim,spacedim> &tria)
+{
typename Triangulation<dim,spacedim>::active_cell_iterator cell;
for (cell = tria.begin_active(); cell != tria.end(); ++cell)
{
- deallog << "cell: " << cell
- << ", material_id: "
- << (int)cell->material_id()
- << ", manifold_id: "
- << (int)cell->manifold_id() << std::endl;
+ deallog << "cell: " << cell
+ << ", material_id: "
+ << (int)cell->material_id()
+ << ", manifold_id: "
+ << (int)cell->manifold_id() << std::endl;
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- deallog << "face: " << cell->face(f)
- << ", boundary_id: "
- << (int)cell->face(f)->boundary_id()
- << ", manifold_id: "
- << (int)cell->face(f)->manifold_id() << std::endl;
+ deallog << "face: " << cell->face(f)
+ << ", boundary_id: "
+ << (int)cell->face(f)->boundary_id()
+ << ", manifold_id: "
+ << (int)cell->face(f)->manifold_id() << std::endl;
}
}
int main ()
{
initlog(true);
-
+
test<1,1>();
test<1,2>();
test<2,2>();
template <int dim, int spacedim>
void test(unsigned int ref=1)
{
- deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
+ deallog << "Testing dim " << dim
+ << ", spacedim " << spacedim << std::endl;
SphericalManifold<dim,spacedim> manifold;
-
+
Triangulation<dim,spacedim> tria;
GridGenerator::hyper_shell (tria, Point<spacedim>(), .3, .6, 12);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- cell->set_all_manifold_ids(1);
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ cell->set_all_manifold_ids(1);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(1);
-
+
GridOut gridout;
gridout.write_msh(tria, deallog.get_file_stream());
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<2,2>();
test<3,3>();
-
+
return 0;
}
//---------------------------- spherical_manifold_02.cc ---------------------------
-// Test that the flat manifold does what it should on a sphere.
+// Test that the flat manifold does what it should on a sphere.
#include "../tests.h"
void test(unsigned int ref=1)
{
SphericalManifold<dim,spacedim> manifold;
-
+
Triangulation<dim,spacedim> tria;
GridGenerator::hyper_ball (tria);
-
+
typename Triangulation<dim,spacedim>::active_cell_iterator cell;
-
- for(cell = tria.begin_active(); cell != tria.end(); ++cell)
+
+ for (cell = tria.begin_active(); cell != tria.end(); ++cell)
cell->set_all_manifold_ids(1);
-
- for(cell = tria.begin_active(); cell != tria.end(); ++cell) {
- if(cell->center().distance(Point<spacedim>()) < 1e-10)
- cell->set_all_manifold_ids(0);
- }
-
+
+ for (cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ if (cell->center().distance(Point<spacedim>()) < 1e-10)
+ cell->set_all_manifold_ids(0);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(2);
-
+
GridOut gridout;
gridout.write_msh(tria, deallog.get_file_stream());
}
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<2,2>();
test<3,3>();
-
+
return 0;
}
void test(unsigned int ref=1)
{
deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
+ << ", spacedim " << spacedim << std::endl;
SphericalManifold<dim,spacedim> manifold;
-
+
Triangulation<dim,spacedim> tria;
Point<spacedim> p0;
Point<spacedim> p1;
p1[0] = 1;
p0[1] = .1;
- if(spacedim == 2) {
- p1[1] = 2*numbers::PI-.1; // theta
- } else if(spacedim == 3) {
- p1[1] = numbers::PI-.1;
- p1[2] = 2*numbers::PI-.1;
- }
+ if (spacedim == 2)
+ {
+ p1[1] = 2*numbers::PI-.1; // theta
+ }
+ else if (spacedim == 3)
+ {
+ p1[1] = numbers::PI-.1;
+ p1[2] = 2*numbers::PI-.1;
+ }
GridGenerator::hyper_rectangle (tria, p0, p1);
tria.refine_global(3);
- const std::vector<Point<spacedim> > & vertices = tria.get_vertices();
-
- for(unsigned int i=0; i<vertices.size(); ++i) {
- Point<spacedim> p0 = manifold.push_forward(vertices[i]);
- Point<spacedim> p1 = manifold.pull_back(p0);
-
- if(p1.distance(vertices[i]) > 1e-10)
- deallog << "ERROR! d: " << p1.distance(vertices[i])
- << " - " << p1 << " != " << vertices[i] << std::endl;
- }
-
-
-
+ const std::vector<Point<spacedim> > &vertices = tria.get_vertices();
+
+ for (unsigned int i=0; i<vertices.size(); ++i)
+ {
+ Point<spacedim> p0 = manifold.push_forward(vertices[i]);
+ Point<spacedim> p1 = manifold.pull_back(p0);
+
+ if (p1.distance(vertices[i]) > 1e-10)
+ deallog << "ERROR! d: " << p1.distance(vertices[i])
+ << " - " << p1 << " != " << vertices[i] << std::endl;
+ }
+
+
+
}
int main ()
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<2,2>();
test<3,3>();
//---------------------------- spherical_manifold_04.cc ---------------------------
-// Test that the flat manifold does what it should on a sphere surface.
+// Test that the flat manifold does what it should on a sphere surface.
#include "../tests.h"
void test(unsigned int ref=1)
{
SphericalManifold<dim,spacedim> manifold;
-
+
Triangulation<spacedim, spacedim> volume_tria;
Triangulation<dim, spacedim> tria;
GridGenerator::hyper_ball (volume_tria);
GridGenerator::extract_boundary_mesh(volume_tria, tria);
typename Triangulation<dim,spacedim>::active_cell_iterator cell;
-
- for(cell = tria.begin_active(); cell != tria.end(); ++cell)
+
+ for (cell = tria.begin_active(); cell != tria.end(); ++cell)
cell->set_all_manifold_ids(1);
-
- for(cell = tria.begin_active(); cell != tria.end(); ++cell) {
- if(cell->center().distance(Point<spacedim>()) < 1e-10)
- cell->set_all_manifold_ids(0);
- }
-
+
+ for (cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ if (cell->center().distance(Point<spacedim>()) < 1e-10)
+ cell->set_all_manifold_ids(0);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(2);
-
+
GridOut gridout;
gridout.write_msh(tria, deallog.get_file_stream());
}
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<1,2>();
test<2,3>();
-
+
return 0;
}
//---------------------------- spherical_manifold_04.cc ---------------------------
-// Test that the flat manifold does what it should on a sphere surface.
+// Test that the flat manifold does what it should on a sphere surface.
#include "../tests.h"
template <int dim>
void test(unsigned int degree)
{
- deallog << "Testing dim=" << dim <<", degree="
- << degree << std::endl;
-
+ deallog << "Testing dim=" << dim <<", degree="
+ << degree << std::endl;
+
SphericalManifold<dim> manifold;
Triangulation<dim> tria;
GridGenerator::hyper_shell(tria, Point<dim>(), .4, .6, 6);
typename Triangulation<dim>::active_cell_iterator cell;
-
- for(cell = tria.begin_active(); cell != tria.end(); ++cell)
+
+ for (cell = tria.begin_active(); cell != tria.end(); ++cell)
cell->set_all_manifold_ids(1);
tria.set_manifold(1, manifold);
DoFHandler<dim> dh(tria);
dh.distribute_dofs(fe);
QGaussLobatto<dim> quad(degree+1);
-
+
FEValues<dim> fe_v(mapping, fe, quad, update_quadrature_points);
// char fname[50];
// sprintf(fname, "out_%d_%d.gpl", dim, degree);
// std::ofstream ofile(fname);
- std::ostream &ofile = deallog.get_file_stream();
-
- for(typename DoFHandler<dim>::active_cell_iterator cell = dh.begin_active();
- cell != dh.end(); ++cell) {
- fe_v.reinit(cell);
- for(unsigned int q=0; q<quad.size(); ++q) {
- ofile << fe_v.get_quadrature_points()[q] << std::endl;
+ std::ostream &ofile = deallog.get_file_stream();
+
+ for (typename DoFHandler<dim>::active_cell_iterator cell = dh.begin_active();
+ cell != dh.end(); ++cell)
+ {
+ fe_v.reinit(cell);
+ for (unsigned int q=0; q<quad.size(); ++q)
+ {
+ ofile << fe_v.get_quadrature_points()[q] << std::endl;
+ }
+ ofile << std::endl;
}
- ofile << std::endl;
- }
ofile << std::endl;
}
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
- for(unsigned int d=1; d<5; ++d) {
- test<2>(d);
- test<3>(d);
- }
+ for (unsigned int d=1; d<5; ++d)
+ {
+ test<2>(d);
+ test<3>(d);
+ }
return 0;
}
template <int dim, int spacedim>
void test(unsigned int ref=1)
{
- deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
+ deallog << "Testing dim " << dim
+ << ", spacedim " << spacedim << std::endl;
SphericalManifold<dim,spacedim> manifold;
-
+
Triangulation<dim,spacedim> tria;
GridGenerator::hyper_shell (tria, Point<spacedim>(), .3, .6, 12);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- cell->set_all_manifold_ids(1);
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ cell->set_all_manifold_ids(1);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(1);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- for(unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell; ++f)
- if(cell->face(f)->at_boundary())
- deallog << "Center: " << cell->face(f)->center(true)
- << ", Norm: " << cell->face(f)->center(true).norm() << std::endl;
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->face(f)->at_boundary())
+ deallog << "Center: " << cell->face(f)->center(true)
+ << ", Norm: " << cell->face(f)->center(true).norm() << std::endl;
+ }
+
}
int main ()
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<2,2>();
test<3,3>();
-
+
return 0;
}
template <int dim, int spacedim>
void test(unsigned int ref=1)
{
- deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
+ deallog << "Testing dim " << dim
+ << ", spacedim " << spacedim << std::endl;
SphericalManifold<dim,spacedim> manifold;
-
+
Triangulation<dim,spacedim> tria;
GridGenerator::hyper_shell (tria, Point<spacedim>(), .3, .6, 12);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- cell->set_all_manifold_ids(1);
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ cell->set_all_manifold_ids(1);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(1);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- for(unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell; ++f)
- if(cell->face(f)->at_boundary())
- deallog << "Center: " << cell->face(f)->center(true, true)
- << ", Norm: " << cell->face(f)->center(true, true).norm() << std::endl;
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->face(f)->at_boundary())
+ deallog << "Center: " << cell->face(f)->center(true, true)
+ << ", Norm: " << cell->face(f)->center(true, true).norm() << std::endl;
+ }
+
}
int main ()
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<2,2>();
test<3,3>();
-
+
return 0;
}
template <int dim, int spacedim>
void test(unsigned int ref=1)
{
- deallog << "Testing dim " << dim
- << ", spacedim " << spacedim << std::endl;
+ deallog << "Testing dim " << dim
+ << ", spacedim " << spacedim << std::endl;
SphericalManifold<dim,spacedim> manifold;
-
+
Triangulation<dim,spacedim> tria;
GridGenerator::hyper_shell (tria, Point<spacedim>(), .3, .6, 12);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- cell->set_all_manifold_ids(1);
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ cell->set_all_manifold_ids(1);
+ }
+
tria.set_manifold(1, manifold);
tria.refine_global(1);
- for(typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) {
- for(unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell; ++f)
- if(cell->face(f)->at_boundary())
- deallog << "Center: " << cell->face(f)->center(true, true)
- << ", Norm: " << cell->face(f)->center(true, true).norm() << std::endl;
- }
-
+ for (typename Triangulation<dim,spacedim>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell)
+ {
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ if (cell->face(f)->at_boundary())
+ deallog << "Center: " << cell->face(f)->center(true, true)
+ << ", Norm: " << cell->face(f)->center(true, true).norm() << std::endl;
+ }
+
}
int main ()
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
test<2,2>();
test<3,3>();
-
+
return 0;
}
update_JxW_values);
FEEvaluation<dim,fe_degree,fe_degree+1>
- fe_eval (mapping, dof.get_fe(), QGauss<1>(fe_degree+1),
- update_values | update_gradients | update_JxW_values);
+ fe_eval (mapping, dof.get_fe(), QGauss<1>(fe_degree+1),
+ update_values | update_gradients | update_JxW_values);
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
const unsigned int n_q_points = quadrature_formula.size();
update_JxW_values);
FEEvaluation<dim,degree_p+1,degree_p+2,dim>
- phi_u (mapping, dof.get_fe(), QGauss<1>(degree_p+2),
- update_values | update_gradients | update_JxW_values,
- 0);
+ phi_u (mapping, dof.get_fe(), QGauss<1>(degree_p+2),
+ update_values | update_gradients | update_JxW_values,
+ 0);
FEEvaluation<dim,degree_p,degree_p+2> phi_p (dof.get_fe(), phi_u, dim);
const unsigned int dofs_per_cell = dof.get_fe().dofs_per_cell;
unsigned int dummy = 0;
WorkStream::
- run (dof.begin_active(), dof.end(),
- &assemble_on_cell<dim,fe_degree>,
- ©_data_local_to_global,
- Assembly::Scratch::Data<dim,fe_degree>(dof.get_fe()),
- dummy,
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (dof.begin_active(), dof.end(),
+ &assemble_on_cell<dim,fe_degree>,
+ ©_data_local_to_global,
+ Assembly::Scratch::Data<dim,fe_degree>(dof.get_fe()),
+ dummy,
+ 2*MultithreadInfo::n_threads(),
+ 1);
deallog << "OK" << std::endl;
}
typedef VectorizedArray<Number> vector_t;
// allocate FEEvaluation. This test will test proper alignment
AlignedVector<FEEvaluation<dim,degree_p+1,degree_p+2,dim,Number> > velocity
- (1, FEEvaluation<dim,degree_p+1,degree_p+2,dim,Number>(data, 0));
+ (1, FEEvaluation<dim,degree_p+1,degree_p+2,dim,Number>(data, 0));
AlignedVector<FEEvaluation<dim,degree_p, degree_p+2,1, Number> > pressure
- (1, FEEvaluation<dim,degree_p, degree_p+2,1, Number>(data, 1));
+ (1, FEEvaluation<dim,degree_p, degree_p+2,1, Number>(data, 1));
for (unsigned int cell=cell_range.first; cell<cell_range.second; ++cell)
{
for (unsigned int j=0; j<N; ++j)
y_ref[i] += shape[i][j] * x[j];
}
-
+
// apply function for tensor product
internal::EvaluatorTensorProduct<internal::evaluate_evenodd,1,M-1,N,double> evaluator(shape_sym, shape_sym, shape_sym);
if (type == 0)
return 0;
}
-
+
VECTOR src_cpy = src;
constraints.distribute(src_cpy);
FEEvaluation<dim,fe_degree,fe_degree+1,1,Number>
- fe_eval(dof_handler.get_fe(), QGauss<1>(fe_degree+1),
- update_gradients | update_values | update_JxW_values);
+ fe_eval(dof_handler.get_fe(), QGauss<1>(fe_degree+1),
+ update_gradients | update_values | update_JxW_values);
dst = 0;
typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
- endc = dof_handler.end();
+ endc = dof_handler.end();
for ( ; cell != endc; ++cell)
{
fe_eval.reinit(cell);
VECTOR src_cpy = src;
constraints.distribute(src_cpy);
FEEvaluation<dim,fe_degree,fe_degree+1,dim,Number> fe_eval
- (dof_handler.get_fe(), QGauss<1>(fe_degree+1),
- update_values | update_gradients | update_JxW_values);
+ (dof_handler.get_fe(), QGauss<1>(fe_degree+1),
+ update_values | update_gradients | update_JxW_values);
dst = 0;
typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
- endc = dof_handler.end();
+ endc = dof_handler.end();
for ( ; cell != endc; ++cell)
{
fe_eval.reinit(cell);
data.create_cell_subrange_hp (cell_range, 1);
if (subrange_deg.second > subrange_deg.first)
helmholtz_operator<dim,1,Vector<Number> > (data, dst, src,
- subrange_deg);
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 2);
if (subrange_deg.second > subrange_deg.first)
helmholtz_operator<dim,2,Vector<Number> > (data, dst, src,
- subrange_deg);
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 3);
if (subrange_deg.second > subrange_deg.first)
helmholtz_operator<dim,3,Vector<Number> > (data, dst, src,
- subrange_deg);
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 4);
if (subrange_deg.second > subrange_deg.first)
helmholtz_operator<dim,4,Vector<Number> > (data, dst, src,
- subrange_deg);
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 5);
if (subrange_deg.second > subrange_deg.first)
helmholtz_operator<dim,5,Vector<Number> > (data, dst, src,
- subrange_deg);
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 6);
if (subrange_deg.second > subrange_deg.first)
helmholtz_operator<dim,6,Vector<Number> > (data, dst, src,
- subrange_deg);
+ subrange_deg);
subrange_deg = data.create_cell_subrange_hp (cell_range, 7);
if (subrange_deg.second > subrange_deg.first)
helmholtz_operator<dim,7,Vector<Number> > (data, dst, src,
- subrange_deg);
+ subrange_deg);
}
void vmult (Vector<Number> &dst,
// ---------------------------------------------------------------------
-// simplified form for step-48 test
+// simplified form for step-48 test
#include "../tests.h"
{
public:
InitialSolution (const unsigned int n_components = 1,
- const double time = 0.) : Function<dim>(n_components, time) {}
+ const double time = 0.) : Function<dim>(n_components, time) {}
virtual double value (const Point<dim> &p,
const unsigned int component = 0) const;
};
// orders
std::pair<unsigned int,unsigned int> subrange_deg;
#define CALL_METHOD(degree) \
- subrange_deg = data.create_cell_subrange_hp(cell_range, degree); \
- if (subrange_deg.second > subrange_deg.first) \
- helmholtz_operator<dim,degree,Vector<Number> > (data, dst, src, subrange_deg)
+ subrange_deg = data.create_cell_subrange_hp(cell_range, degree); \
+ if (subrange_deg.second > subrange_deg.first) \
+ helmholtz_operator<dim,degree,Vector<Number> > (data, dst, src, subrange_deg)
CALL_METHOD(1);
CALL_METHOD(2);
void partition (const SparsityPattern &sparsity_pattern,
- const unsigned int n_partitions)
+ const unsigned int n_partitions)
{
// generate the data structures for
// METIS. Note that this is particularly
// compressed row storage format. we only
// have to set up a few auxiliary arrays
idx_t
- n = static_cast<signed int>(sparsity_pattern.n_rows()),
- ncon = 1, // number of balancing constraints (should be >0)
- nparts = static_cast<int>(n_partitions), // number of subdomains to create
- dummy; // the numbers of edges cut by the
+ n = static_cast<signed int>(sparsity_pattern.n_rows()),
+ ncon = 1, // number of balancing constraints (should be >0)
+ nparts = static_cast<int>(n_partitions), // number of subdomains to create
+ dummy; // the numbers of edges cut by the
// resulting partition
// use default options for METIS
for (SparsityPattern::size_type row=0; row<sparsity_pattern.n_rows(); ++row)
{
for (SparsityPattern::iterator col=sparsity_pattern.begin(row);
- col < sparsity_pattern.end(row); ++col)
- int_colnums.push_back(col->column());
+ col < sparsity_pattern.end(row); ++col)
+ int_colnums.push_back(col->column());
int_rowstart.push_back(int_colnums.size());
}
deallog << options[i] << ' ';
deallog << std::endl;
deallog << sizeof(idx_t) << std::endl;
-
-
+
+
// Make use of METIS' error code.
int ierr;
// create
ierr = METIS_PartGraphRecursive(&n, &ncon, &int_rowstart[0], &int_colnums[0],
- NULL, NULL, NULL,
- &nparts,NULL,NULL,&options[0],
- &dummy,&int_partition_indices[0]);
+ NULL, NULL, NULL,
+ &nparts,NULL,NULL,&options[0],
+ &dummy,&int_partition_indices[0]);
deallog << "METIS outputs:" << std::endl;
deallog << dummy << std::endl;
SparsityPattern cell_connectivity;
GridTools::get_face_connectivity_of_cells (triangulation, cell_connectivity);
- partition (cell_connectivity, 5);
+ partition (cell_connectivity, 5);
}
{
unsigned int index = 0;
for (typename Triangulation<dim>::active_cell_iterator cell=tria.begin_active();
- cell!=tria.end(); ++cell, ++index)
+ cell!=tria.end(); ++cell, ++index)
AssertThrow (cell->active_cell_index() == index, ExcInternalError());
AssertThrow (index == tria.n_active_cells(), ExcInternalError());
template<int dim>
void pack_function (const typename parallel::distributed::Triangulation<dim,dim>::cell_iterator &cell,
- const typename parallel::distributed::Triangulation<dim,dim>::CellStatus status,
- void *data)
+ const typename parallel::distributed::Triangulation<dim,dim>::CellStatus status,
+ void *data)
{
static int some_number = 0;
deallog << "packing cell " << cell->id() << " with data=" << some_number << " status=";
{
Assert(!cell->has_children(), ExcInternalError());
}
-
- int * intdata = reinterpret_cast<int*>(data);
+
+ int *intdata = reinterpret_cast<int *>(data);
*intdata = some_number;
++some_number;
template<int dim>
void unpack_function (const typename parallel::distributed::Triangulation<dim,dim>::cell_iterator &cell,
- const typename parallel::distributed::Triangulation<dim,dim>::CellStatus status,
- const void *data)
+ const typename parallel::distributed::Triangulation<dim,dim>::CellStatus status,
+ const void *data)
{
- const int * intdata = reinterpret_cast<const int*>(data);
+ const int *intdata = reinterpret_cast<const int *>(data);
deallog << "unpacking cell " << cell->id() << " with data=" << (*intdata) << " status=";
if (status==parallel::distributed::Triangulation<dim,dim>::CELL_PERSIST)
deallog << "PERSIST";
else if (status==parallel::distributed::Triangulation<dim,dim>::CELL_REFINE)
- deallog << "REFINE";
+ deallog << "REFINE";
else if (status==parallel::distributed::Triangulation<dim,dim>::CELL_COARSEN)
deallog << "COARSEN";
deallog << std::endl;
GridGenerator::subdivided_hyper_cube(tr, 2);
tr.refine_global(1);
deallog << "cells before: " << tr.n_global_active_cells() << std::endl;
-
+
typename Triangulation<dim,dim>::active_cell_iterator cell;
for (cell = tr.begin_active();
cell != tr.end();
++cell)
{
- if (cell->id().to_string()=="0_1:0")
- {
- cell->set_refine_flag();
- }
- else if (cell->parent()->id().to_string()=="3_0:")
- cell->set_coarsen_flag();
-
- if (cell->is_locally_owned())
- {
- deallog << "myid=" << myid << " cellid=" << cell->id();
- if (cell->coarsen_flag_set())
- deallog << " coarsening" << std::endl;
- else if (cell->refine_flag_set())
- deallog << " refining" << std::endl;
- else
- deallog << std::endl;
- }
- }
+ if (cell->id().to_string()=="0_1:0")
+ {
+ cell->set_refine_flag();
+ }
+ else if (cell->parent()->id().to_string()=="3_0:")
+ cell->set_coarsen_flag();
+
+ if (cell->is_locally_owned())
+ {
+ deallog << "myid=" << myid << " cellid=" << cell->id();
+ if (cell->coarsen_flag_set())
+ deallog << " coarsening" << std::endl;
+ else if (cell->refine_flag_set())
+ deallog << " refining" << std::endl;
+ else
+ deallog << std::endl;
+ }
+ }
unsigned int offset = tr.register_data_attach(sizeof(int), pack_function<dim>);
deallog << "offset=" << offset << std::endl;
tr.execute_coarsening_and_refinement();
-
+
deallog << "cells after: " << tr.n_global_active_cells() << std::endl;
/*
cell != tr.end();
++cell)
{
- if (cell->is_locally_owned())
- deallog << "myid=" << myid << " cellid=" << cell->id() << std::endl;
- }*/
+ if (cell->is_locally_owned())
+ deallog << "myid=" << myid << " cellid=" << cell->id() << std::endl;
+ }*/
+
+ tr.notify_ready_to_unpack(offset, unpack_function<dim>);
- tr.notify_ready_to_unpack(offset, unpack_function<dim>);
-
const unsigned int checksum = tr.get_checksum ();
deallog << "Checksum: "
<< checksum
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::subdivided_hyper_cube(tr, 16);
tr.refine_global(1);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << tr.n_locally_owned_active_cells_per_processor ()[p]
- << " locally owned active cells"
- << std::endl;
+ << ": "
+ << tr.n_locally_owned_active_cells_per_processor ()[p]
+ << " locally owned active cells"
+ << std::endl;
}
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::subdivided_hyper_cube(tr, 16);
tr.refine_global(1);
weights[i] = 1;
tr.repartition (weights);
}
-
+
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << tr.n_locally_owned_active_cells_per_processor ()[p]
- << " locally owned active cells"
- << std::endl;
+ << ": "
+ << tr.n_locally_owned_active_cells_per_processor ()[p]
+ << " locally owned active cells"
+ << std::endl;
}
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::subdivided_hyper_cube(tr, 16);
tr.refine_global(1);
{
tr.repartition ();
}
-
+
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << tr.n_locally_owned_active_cells_per_processor ()[p]
- << " locally owned active cells"
- << std::endl;
+ << ": "
+ << tr.n_locally_owned_active_cells_per_processor ()[p]
+ << " locally owned active cells"
+ << std::endl;
}
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::subdivided_hyper_cube(tr, 16);
tr.refine_global(1);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << tr.n_locally_owned_active_cells_per_processor ()[p]
- << " locally owned active cells"
- << std::endl;
+ << ": "
+ << tr.n_locally_owned_active_cells_per_processor ()[p]
+ << " locally owned active cells"
+ << std::endl;
}
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::subdivided_hyper_cube(tr, 16);
tr.refine_global(1);
// repartition the mesh; attach different weights to all cells
std::vector<unsigned int> weights (tr.n_active_cells());
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(); cell != tr.end(); ++cell)
+ cell = tr.begin_active(); cell != tr.end(); ++cell)
weights[cell->active_cell_index()]
= (cell->center()[0] < 0.5
- ||
- cell->center()[1] < 0.5
- ?
- 1
- :
- 4);
+ ||
+ cell->center()[1] < 0.5
+ ?
+ 1
+ :
+ 4);
tr.repartition (weights);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << tr.n_locally_owned_active_cells_per_processor ()[p]
- << " locally owned active cells"
- << std::endl;
+ << ": "
+ << tr.n_locally_owned_active_cells_per_processor ()[p]
+ << " locally owned active cells"
+ << std::endl;
// let each processor sum up its weights
std::vector<double> integrated_weights (numproc, 0.0);
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(); cell != tr.end(); ++cell)
+ cell = tr.begin_active(); cell != tr.end(); ++cell)
if (cell->is_locally_owned())
integrated_weights[myid]
- += (cell->center()[0] < 0.5
- ||
- cell->center()[1] < 0.5
- ?
- 1
- :
- 4);
+ += (cell->center()[0] < 0.5
+ ||
+ cell->center()[1] < 0.5
+ ?
+ 1
+ :
+ 4);
Utilities::MPI::sum (integrated_weights, MPI_COMM_WORLD, integrated_weights);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << integrated_weights[p]
- << " weight"
- << std::endl;
+ << ": "
+ << integrated_weights[p]
+ << " weight"
+ << std::endl;
}
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::subdivided_hyper_cube(tr, 16);
tr.refine_global(1);
// repartition the mesh; attach different weights to all cells
std::vector<unsigned int> weights (tr.n_active_cells());
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(); cell != tr.end(); ++cell)
+ cell = tr.begin_active(); cell != tr.end(); ++cell)
weights[cell->active_cell_index()]
= (cell->center()[0] < 0.5
- ||
- cell->center()[1] < 0.5
- ?
- 1
- :
- 1000);
+ ||
+ cell->center()[1] < 0.5
+ ?
+ 1
+ :
+ 1000);
tr.repartition (weights);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << tr.n_locally_owned_active_cells_per_processor ()[p]
- << " locally owned active cells"
- << std::endl;
+ << ": "
+ << tr.n_locally_owned_active_cells_per_processor ()[p]
+ << " locally owned active cells"
+ << std::endl;
// let each processor sum up its weights
std::vector<double> integrated_weights (numproc, 0.0);
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(); cell != tr.end(); ++cell)
+ cell = tr.begin_active(); cell != tr.end(); ++cell)
if (cell->is_locally_owned())
integrated_weights[myid]
- += (cell->center()[0] < 0.5
- ||
- cell->center()[1] < 0.5
- ?
- 1
- :
- 1000);
+ += (cell->center()[0] < 0.5
+ ||
+ cell->center()[1] < 0.5
+ ?
+ 1
+ :
+ 1000);
Utilities::MPI::sum (integrated_weights, MPI_COMM_WORLD, integrated_weights);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << integrated_weights[p]
- << " weight"
- << std::endl;
+ << ": "
+ << integrated_weights[p]
+ << " weight"
+ << std::endl;
}
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
// create a 16x16 or 16x16x16 mesh where each cell has size 1x1 ir 1x1x1
GridGenerator::subdivided_hyper_cube(tr, 16, 0, 16);
-
+
// repartition the mesh; attach different weights to all cells
std::vector<unsigned int> weights (tr.n_active_cells());
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(); cell != tr.end(); ++cell)
+ cell = tr.begin_active(); cell != tr.end(); ++cell)
weights[cell->active_cell_index()]
= (
- // bottom left corner
- (cell->center()[0] < 1)
- &&
- (cell->center()[1] < 1)
- &&
- (dim == 3 ?
- (cell->center()[2] < 1) :
- true)
- ?
- // one cell has more weight than all others together
- tr.n_global_active_cells()
- :
- 1);
+ // bottom left corner
+ (cell->center()[0] < 1)
+ &&
+ (cell->center()[1] < 1)
+ &&
+ (dim == 3 ?
+ (cell->center()[2] < 1) :
+ true)
+ ?
+ // one cell has more weight than all others together
+ tr.n_global_active_cells()
+ :
+ 1);
tr.repartition (weights);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << tr.n_locally_owned_active_cells_per_processor ()[p]
- << " locally owned active cells"
- << std::endl;
+ << ": "
+ << tr.n_locally_owned_active_cells_per_processor ()[p]
+ << " locally owned active cells"
+ << std::endl;
// let each processor sum up its weights
std::vector<double> integrated_weights (numproc, 0.0);
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(); cell != tr.end(); ++cell)
+ cell = tr.begin_active(); cell != tr.end(); ++cell)
if (cell->is_locally_owned())
integrated_weights[myid]
- += (
- // bottom left corner
- (cell->center()[0] < 1)
- &&
- (cell->center()[1] < 1)
- &&
- (dim == 3 ?
- (cell->center()[2] < 1) :
- true)
- ?
- tr.n_global_active_cells()
- :
- 1);
+ += (
+ // bottom left corner
+ (cell->center()[0] < 1)
+ &&
+ (cell->center()[1] < 1)
+ &&
+ (dim == 3 ?
+ (cell->center()[2] < 1) :
+ true)
+ ?
+ tr.n_global_active_cells()
+ :
+ 1);
Utilities::MPI::sum (integrated_weights, MPI_COMM_WORLD, integrated_weights);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << integrated_weights[p]
- << " weight"
- << std::endl;
+ << ": "
+ << integrated_weights[p]
+ << " weight"
+ << std::endl;
}
unsigned int numproc = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
// create a 16x16 or 16x16x16 mesh where each cell has size 1x1 ir 1x1x1
GridGenerator::subdivided_hyper_cube(tr, 8, 0, 16);
// repartition the mesh; attach different weights to all cells
std::vector<unsigned int> weights (tr.n_active_cells());
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(); cell != tr.end(); ++cell)
+ cell = tr.begin_active(); cell != tr.end(); ++cell)
weights[cell->active_cell_index()]
= (
- // bottom left corner
- (cell->center()[0] < 1)
- &&
- (cell->center()[1] < 1)
- &&
- (dim == 3 ?
- (cell->center()[2] < 1) :
- true)
- ?
- // one cell has more weight than all others together
- tr.n_global_active_cells()
- :
- 1);
+ // bottom left corner
+ (cell->center()[0] < 1)
+ &&
+ (cell->center()[1] < 1)
+ &&
+ (dim == 3 ?
+ (cell->center()[2] < 1) :
+ true)
+ ?
+ // one cell has more weight than all others together
+ tr.n_global_active_cells()
+ :
+ 1);
tr.repartition (weights);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << tr.n_locally_owned_active_cells_per_processor ()[p]
- << " locally owned active cells"
- << std::endl;
+ << ": "
+ << tr.n_locally_owned_active_cells_per_processor ()[p]
+ << " locally owned active cells"
+ << std::endl;
// let each processor sum up its weights
std::vector<double> integrated_weights (numproc, 0.0);
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(); cell != tr.end(); ++cell)
+ cell = tr.begin_active(); cell != tr.end(); ++cell)
if (cell->is_locally_owned())
integrated_weights[myid]
- += (
- // bottom left corner
- (cell->center()[0] < 1)
- &&
- (cell->center()[1] < 1)
- &&
- (dim == 3 ?
- (cell->center()[2] < 1) :
- true)
- ?
- tr.n_global_active_cells()
- :
- 1);
+ += (
+ // bottom left corner
+ (cell->center()[0] < 1)
+ &&
+ (cell->center()[1] < 1)
+ &&
+ (dim == 3 ?
+ (cell->center()[2] < 1) :
+ true)
+ ?
+ tr.n_global_active_cells()
+ :
+ 1);
Utilities::MPI::sum (integrated_weights, MPI_COMM_WORLD, integrated_weights);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
for (unsigned int p=0; p<numproc; ++p)
deallog << "processor " << p
- << ": "
- << integrated_weights[p]
- << " weight"
- << std::endl;
+ << ": "
+ << integrated_weights[p]
+ << " weight"
+ << std::endl;
}
cat_file((std::string(filename) + "_0000.vtu").c_str());
}
else if (myid==1)
- cat_file((std::string(filename) + "_0001.vtu").c_str());
+ cat_file((std::string(filename) + "_0001.vtu").c_str());
else if (myid==2)
- cat_file((std::string(filename) + "_0002.vtu").c_str());
+ cat_file((std::string(filename) + "_0002.vtu").c_str());
else
AssertThrow(false, ExcNotImplemented());
-
+
}
template<int dim, int spacedim>
deallog << "dofs " << dh.n_dofs() << std::endl;
DataOut<dim,DoFHandler<dim,spacedim> > data_out;
- data_out.attach_triangulation (tr);
- Vector<float> subdomain (tr.n_active_cells());
- for (unsigned int i=0; i<subdomain.size(); ++i)
- subdomain(i) = tr.locally_owned_subdomain();
- data_out.add_data_vector (subdomain, "subdomain");
-
- std::string name = "f0.vtu";
- name[1] += tr.locally_owned_subdomain();
-
- {
- std::ofstream file(name.c_str());
- data_out.build_patches ();
- data_out.write_vtu (file);
- }
- cat_file(name.c_str());
+ data_out.attach_triangulation (tr);
+ Vector<float> subdomain (tr.n_active_cells());
+ for (unsigned int i=0; i<subdomain.size(); ++i)
+ subdomain(i) = tr.locally_owned_subdomain();
+ data_out.add_data_vector (subdomain, "subdomain");
+
+ std::string name = "f0.vtu";
+ name[1] += tr.locally_owned_subdomain();
+
+ {
+ std::ofstream file(name.c_str());
+ data_out.build_patches ();
+ data_out.write_vtu (file);
+ }
+ cat_file(name.c_str());
}
if (myid==0)
deallog << sums[0] << ' ' << sums[1] << std::endl;
}
-
+
{
Vector<double> values(2);
values[0] = 1.5;
if (myid==0)
deallog << sums[0] << ' ' << sums[1] << std::endl;
}
-
+
{
Vector<double> sums(2);
sums[0] = 1.5;
const std::vector<bool> locally_owned_vertices
= GridTools::get_locally_owned_vertices (tr);
-
+
if (myid == 0)
deallog << "#vertices = "
- << tr.n_vertices()
- << std::endl
- << "#locally_owned_vertices = "
- << std::count (locally_owned_vertices.begin(),
- locally_owned_vertices.end(),
- true)
- << std::endl;
+ << tr.n_vertices()
+ << std::endl
+ << "#locally_owned_vertices = "
+ << std::count (locally_owned_vertices.begin(),
+ locally_owned_vertices.end(),
+ true)
+ << std::endl;
// now do the move
Point<dim> shift;
for (unsigned int v=0; v<tr.n_vertices(); ++v)
if (locally_owned_vertices[v] == true)
{
- // maybe not the most elegant way to do it, but it works for the purpose
- // of the test...
- const_cast<Point<dim>&>(tr.get_vertices()[v]) += shift;
- ++n_vertices_moved;
+ // maybe not the most elegant way to do it, but it works for the purpose
+ // of the test...
+ const_cast<Point<dim>&>(tr.get_vertices()[v]) += shift;
+ ++n_vertices_moved;
}
Assert (Utilities::MPI::sum (n_vertices_moved, MPI_COMM_WORLD)
- ==
- (dim==2 ? 25 : 125),
- ExcInternalError());
+ ==
+ (dim==2 ? 25 : 125),
+ ExcInternalError());
tr.communicate_locally_moved_vertices (locally_owned_vertices);
{
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); ++i)
{
- deallog << "Partition " << i << std::endl;
-
+ deallog << "Partition " << i << std::endl;
+
cat_file((std::string("communicate_moved_vertices_01.dat.") + Utilities::int_to_string(i)).c_str());
}
}
-
-
+
+
if (myid == 0)
deallog << "OK" << std::endl;
}
typename Triangulation<dim>::active_cell_iterator cell = triangulation.begin_active ();
if (cell->is_locally_owned ())
cell->set_refine_flag ();
-
+
triangulation.execute_coarsening_and_refinement ();
if (myid == 0)
deallog << "#cells = " << triangulation.n_global_active_cells() << std::endl;
vec = 1;
vec_ghosted = vec;
vec = -1;
-
+
constraints.condense (vec_ghosted, vec);
vec.print(deallog.get_file_stream());
IndexSet local_active_together(3);
local_active_together.add_range(0,3);
//local_active_together.compress();
-
+
ConstraintMatrix cm(local_active_together);
cm.add_line(1);
cm.close();
905: --------------------------------------------------------
905: An error occurred in line <1898> of file </scratch/deal-trunk/deal.II/include/deal.II/lac/constraint_matrix.h> in function
905: void dealii::ConstraintMatrix::add_line(dealii::ConstraintMatrix::size_type)
-905: The violated condition was:
+905: The violated condition was:
905: line != numbers::invalid_size_type
905: The name and call sequence of the exception was:
905: ExcInternalError()
-905: Additional Information:
+905: Additional Information:
905: (none)
905: --------------------------------------------------------
*/
template<int dim>
void test()
{
- parallel::distributed::Triangulation<dim> triangulation(MPI_COMM_WORLD);
- GridGenerator::hyper_ball(triangulation);
-
- if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
- {
- typename Triangulation<dim>::active_cell_iterator
- cell = triangulation.begin_active();
- //cell->set_refine_flag ();
- (++cell)->set_refine_flag ();
- }
-
- triangulation.execute_coarsening_and_refinement();
- deallog << "n_cells: " << triangulation.n_global_active_cells() << std::endl;
- FE_RaviartThomas<dim> fe(0); // crashing
- //FESystem<dim> fe(FE_Q<dim>(2), 1); // working
- DoFHandler<dim> dof_handler(triangulation);
-
- dof_handler.distribute_dofs(fe);
-
- ConstraintMatrix constraints;
- DoFTools::make_hanging_node_constraints(dof_handler, constraints);
-
- IndexSet relevant_set;
- DoFTools::extract_locally_relevant_dofs (dof_handler, relevant_set);
- deallog << "relevant set:" << std::endl;
- relevant_set.print(deallog.get_file_stream());
- deallog << "constraints:" << std::endl;
- constraints.print(deallog.get_file_stream());
-
- if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
- deallog << "OK" << std::endl;
+ parallel::distributed::Triangulation<dim> triangulation(MPI_COMM_WORLD);
+ GridGenerator::hyper_ball(triangulation);
+
+ if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
+ {
+ typename Triangulation<dim>::active_cell_iterator
+ cell = triangulation.begin_active();
+ //cell->set_refine_flag ();
+ (++cell)->set_refine_flag ();
+ }
+
+ triangulation.execute_coarsening_and_refinement();
+ deallog << "n_cells: " << triangulation.n_global_active_cells() << std::endl;
+ FE_RaviartThomas<dim> fe(0); // crashing
+ //FESystem<dim> fe(FE_Q<dim>(2), 1); // working
+ DoFHandler<dim> dof_handler(triangulation);
+
+ dof_handler.distribute_dofs(fe);
+
+ ConstraintMatrix constraints;
+ DoFTools::make_hanging_node_constraints(dof_handler, constraints);
+
+ IndexSet relevant_set;
+ DoFTools::extract_locally_relevant_dofs (dof_handler, relevant_set);
+ deallog << "relevant set:" << std::endl;
+ relevant_set.print(deallog.get_file_stream());
+ deallog << "constraints:" << std::endl;
+ constraints.print(deallog.get_file_stream());
+
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ deallog << "OK" << std::endl;
}
int main(int argc, char *argv[])
-{
+{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
MPILogInitAll log;
test<2>();
-
+
}
void test(FiniteElement<dim> &fe)
{
deallog << "dim=" << dim << std::endl;
-
- parallel::distributed::Triangulation<dim> triangulation(MPI_COMM_WORLD);
- GridGenerator::hyper_ball(triangulation);
- triangulation.refine_global(1);
-
- if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
- {
- typename Triangulation<dim>::active_cell_iterator
- cell = triangulation.begin_active();
- for (;cell!=triangulation.end();++cell)
- if (Testing::rand()%2)
- cell->set_refine_flag ();
- }
-
- triangulation.execute_coarsening_and_refinement();
- deallog << "n_cells: " << triangulation.n_global_active_cells() << std::endl;
- DoFHandler<dim> dof_handler(triangulation);
-
- dof_handler.distribute_dofs(fe);
-
- ConstraintMatrix constraints;
- DoFTools::make_hanging_node_constraints(dof_handler, constraints);
-
- if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
- deallog << "OK" << std::endl;
+
+ parallel::distributed::Triangulation<dim> triangulation(MPI_COMM_WORLD);
+ GridGenerator::hyper_ball(triangulation);
+ triangulation.refine_global(1);
+
+ if (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0)
+ {
+ typename Triangulation<dim>::active_cell_iterator
+ cell = triangulation.begin_active();
+ for (; cell!=triangulation.end(); ++cell)
+ if (Testing::rand()%2)
+ cell->set_refine_flag ();
+ }
+
+ triangulation.execute_coarsening_and_refinement();
+ deallog << "n_cells: " << triangulation.n_global_active_cells() << std::endl;
+ DoFHandler<dim> dof_handler(triangulation);
+
+ dof_handler.distribute_dofs(fe);
+
+ ConstraintMatrix constraints;
+ DoFTools::make_hanging_node_constraints(dof_handler, constraints);
+
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ deallog << "OK" << std::endl;
}
template <int dim>
fes.push_back(std_cxx11::shared_ptr<FiniteElement<dim> >(new FE_DGQ<dim>(2)));
fes.push_back(std_cxx11::shared_ptr<FiniteElement<dim> >(new FE_Q_DG0<dim>(2)));
- for (unsigned int i=0;i<fes.size();++i)
+ for (unsigned int i=0; i<fes.size(); ++i)
{
deallog << fes[i]->get_name() << std::endl;
test<dim>(*fes[i]);
}
-
+
}
int main(int argc, char *argv[])
-{
+{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
MPILogInitAll log;
MappingQ1<dim> mapping;
Vector<float> indicators(tr.n_active_cells());
DerivativeApproximation::approximate_gradient (mapping,
- dofh,
- vec_rel,
- indicators);
+ dofh,
+ vec_rel,
+ indicators);
// we got here, so no exception.
if (myid == 0)
{
public:
double value (const Point<dim> &p, const unsigned int) const
- {
- return p*p;
- }
+ {
+ return p*p;
+ }
};
IndexSet locally_relevant_set;
DoFTools::extract_locally_relevant_dofs (dofh,
- locally_relevant_set);
+ locally_relevant_set);
// create a vector representing a function that is independent of the number
// of processors involved
Vector<float> indicators(tr.n_active_cells());
DerivativeApproximation::approximate_gradient (dofh,
- vec_rel,
- indicators);
+ vec_rel,
+ indicators);
// what we get must be a set of derivative indicators, one for each
// cell of the distributed mesh. they need to be the same, no matter
filename += Utilities::int_to_string(dim);
std::ofstream logfile
- ((filename+ "-" + Utilities::int_to_string(my_id,2)).c_str());
+ ((filename+ "-" + Utilities::int_to_string(my_id,2)).c_str());
GridOut().write_gnuplot (tria, logfile);
MPI_Barrier(MPI_COMM_WORLD);
if (my_id==0)
for (unsigned int i=0;
i<Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); ++i)
- {
- deallog << "Process " << i << ":" << std::endl;
- cat_file((filename + "-" + Utilities::int_to_string(i,2)).c_str());
- }
+ {
+ deallog << "Process " << i << ":" << std::endl;
+ cat_file((filename + "-" + Utilities::int_to_string(i,2)).c_str());
+ }
deallog << "OK" << std::endl;
}
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
- {
- std::ofstream logfile("output");
- deallog << std::setprecision(4);
- logfile << std::setprecision(4);
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- test1<2> (true);
- test1<2> (false);
- test1<3> (true);
- test1<3> (false);
- }
+ {
+ std::ofstream logfile("output");
+ deallog << std::setprecision(4);
+ logfile << std::setprecision(4);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test1<2> (true);
+ test1<2> (false);
+ test1<3> (true);
+ test1<3> (false);
+ }
else
- {
- test1<2> (true);
- test1<2> (false);
- test1<3> (true);
- test1<3> (false);
- }
+ {
+ test1<2> (true);
+ test1<2> (false);
+ test1<3> (true);
+ test1<3> (false);
+ }
return 0;
}
for (typename Triangulation<dim>::active_cell_iterator
cell = tria.begin_active(); cell != tria.end(); ++cell)
if (cell->is_locally_owned())
- {
- const Point<dim> &p = cell->center();
- bool all_positive = true;
- for (unsigned int d=0; d<dim; ++d)
- if (p(d) <= 0.) all_positive = false;
- if (all_positive)
- cell->set_refine_flag();
- }
+ {
+ const Point<dim> &p = cell->center();
+ bool all_positive = true;
+ for (unsigned int d=0; d<dim; ++d)
+ if (p(d) <= 0.) all_positive = false;
+ if (all_positive)
+ cell->set_refine_flag();
+ }
tria.execute_coarsening_and_refinement();
GridTools::distort_random (0.1, tria, keep_boundary);
filename += Utilities::int_to_string(dim);
std::ofstream logfile
- ((filename+ "-" + Utilities::int_to_string(my_id,2)).c_str());
+ ((filename+ "-" + Utilities::int_to_string(my_id,2)).c_str());
GridOut().write_gnuplot (tria, logfile);
MPI_Barrier(MPI_COMM_WORLD);
if (my_id==0)
for (unsigned int i=0;
i<Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); ++i)
- {
- deallog << "Process " << i << ":" << std::endl;
- cat_file((filename + "-" + Utilities::int_to_string(i,2)).c_str());
- }
+ {
+ deallog << "Process " << i << ":" << std::endl;
+ cat_file((filename + "-" + Utilities::int_to_string(i,2)).c_str());
+ }
deallog << "OK" << std::endl;
}
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
- {
- std::ofstream logfile("output");
- deallog << std::setprecision(4);
- logfile << std::setprecision(4);
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- test1<2> (true);
- test1<2> (false);
- test1<3> (true);
- test1<3> (false);
- }
+ {
+ std::ofstream logfile("output");
+ deallog << std::setprecision(4);
+ logfile << std::setprecision(4);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test1<2> (true);
+ test1<2> (false);
+ test1<3> (true);
+ test1<3> (false);
+ }
else
- {
- test1<2> (true);
- test1<2> (false);
- test1<3> (true);
- test1<3> (false);
- }
+ {
+ test1<2> (true);
+ test1<2> (false);
+ test1<3> (true);
+ test1<3> (false);
+ }
return 0;
}
bla.add_index(0);
partitioning.push_back(bla);
-
+
csp.reinit(partitioning);
for (unsigned int i=0; i<n; ++i)
csp.add(i, myid);
for (unsigned int i=0; i<numprocs; ++i)
locally_owned_dofs_per_cpu2[i].add_range((i)*num_local, (i+1)*num_local);
-
+
SparsityTools::distribute_sparsity_pattern<>(csp,
locally_owned_dofs_per_cpu2,
MPI_COMM_WORLD,
// at the interface between cells
Point<dim> p;
for (unsigned int d=0; d<dim; ++d)
- p[d] = 1./3;
-
+ p[d] = 1./3;
+
typename parallel::distributed::Triangulation<dim>::active_cell_iterator
- cell = GridTools::find_active_cell_around_point (tr, p);
+ cell = GridTools::find_active_cell_around_point (tr, p);
const unsigned int
- n_locally_owned
- = Utilities::MPI::sum (cell->is_locally_owned() ? 1 : 0,
- MPI_COMM_WORLD);
-
+ n_locally_owned
+ = Utilities::MPI::sum (cell->is_locally_owned() ? 1 : 0,
+ MPI_COMM_WORLD);
+
const unsigned int
- n_locally_owned_or_ghost
- = Utilities::MPI::sum (!cell->is_artificial() ? 1 : 0,
- MPI_COMM_WORLD);
-
+ n_locally_owned_or_ghost
+ = Utilities::MPI::sum (!cell->is_artificial() ? 1 : 0,
+ MPI_COMM_WORLD);
+
if (myid == 0)
deallog << "Locally owned: "
<< n_locally_owned
<< std::endl
- << "Locally owned or ghost: "
+ << "Locally owned or ghost: "
<< n_locally_owned_or_ghost
<< std::endl;
}
FE_Q<dim> fe(1);
DoFHandler<dim> dof_handler (tr);
dof_handler.distribute_dofs (fe);
-
+
// there are 2^(2*dim) cells to be owned by this distributed
// triangulation. however, since p4est makes sure that all active
// children belonging to the same parent are stored on the same
// cells or now by setting a bit mask that we then add up.
// output which processor owns something and which don't
const int cells_owned = Utilities::MPI::sum (tr.n_locally_owned_active_cells() > 0
- ?
- 1 << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)
- :
- 0,
- MPI_COMM_WORLD);
+ ?
+ 1 << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)
+ :
+ 0,
+ MPI_COMM_WORLD);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
{
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
- deallog << "Processor " << i << " has cells: "
- << ((cells_owned & (1 << i)) ? "yes" : "no")
- << std::endl;
-
- unsigned int n_owning_processors = 0;
+ deallog << "Processor " << i << " has cells: "
+ << ((cells_owned & (1 << i)) ? "yes" : "no")
+ << std::endl;
+
+ unsigned int n_owning_processors = 0;
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
- if (cells_owned & (1 << i))
- ++n_owning_processors;
+ if (cells_owned & (1 << i))
+ ++n_owning_processors;
deallog << "# processors owning cells=" << n_owning_processors << std::endl;
}
// now check how many processors own DoFs using the same procedure
const int dofs_owned = Utilities::MPI::sum (dof_handler.has_active_dofs()
- ?
- 1 << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)
- :
- 0,
- MPI_COMM_WORLD);
+ ?
+ 1 << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)
+ :
+ 0,
+ MPI_COMM_WORLD);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
{
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
- deallog << "Processor " << i << " has dofs: "
- << ((dofs_owned & (1 << i)) ? "yes" : "no")
- << std::endl;
-
- unsigned int n_owning_processors = 0;
+ deallog << "Processor " << i << " has dofs: "
+ << ((dofs_owned & (1 << i)) ? "yes" : "no")
+ << std::endl;
+
+ unsigned int n_owning_processors = 0;
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
- if (dofs_owned & (1 << i))
- ++n_owning_processors;
+ if (dofs_owned & (1 << i))
+ ++n_owning_processors;
deallog << "# processors owning dofs=" << n_owning_processors << std::endl;
}
-
+
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
deallog << std::endl;
}
FE_Nothing<dim> fe(1);
DoFHandler<dim> dof_handler (tr);
dof_handler.distribute_dofs (fe);
-
+
// there are 2^(2*dim) cells to be owned by this distributed
// triangulation. however, since p4est makes sure that all active
// children belonging to the same parent are stored on the same
// cells or now by setting a bit mask that we then add up.
// output which processor owns something and which don't
const int cells_owned = Utilities::MPI::sum (tr.n_locally_owned_active_cells() > 0
- ?
- 1 << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)
- :
- 0,
- MPI_COMM_WORLD);
+ ?
+ 1 << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)
+ :
+ 0,
+ MPI_COMM_WORLD);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
{
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
- deallog << "Processor " << i << " has cells: "
- << ((cells_owned & (1 << i)) ? "yes" : "no")
- << std::endl;
-
- unsigned int n_owning_processors = 0;
+ deallog << "Processor " << i << " has cells: "
+ << ((cells_owned & (1 << i)) ? "yes" : "no")
+ << std::endl;
+
+ unsigned int n_owning_processors = 0;
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
- if (cells_owned & (1 << i))
- ++n_owning_processors;
+ if (cells_owned & (1 << i))
+ ++n_owning_processors;
deallog << "# processors owning cells=" << n_owning_processors << std::endl;
}
// now check how many processors own DoFs using the same procedure
const int dofs_owned = Utilities::MPI::sum (dof_handler.has_active_dofs()
- ?
- 1 << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)
- :
- 0,
- MPI_COMM_WORLD);
+ ?
+ 1 << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)
+ :
+ 0,
+ MPI_COMM_WORLD);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
{
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
- deallog << "Processor " << i << " has dofs: "
- << ((dofs_owned & (1 << i)) ? "yes" : "no")
- << std::endl;
-
- unsigned int n_owning_processors = 0;
+ deallog << "Processor " << i << " has dofs: "
+ << ((dofs_owned & (1 << i)) ? "yes" : "no")
+ << std::endl;
+
+ unsigned int n_owning_processors = 0;
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); ++i)
- if (dofs_owned & (1 << i))
- ++n_owning_processors;
+ if (dofs_owned & (1 << i))
+ ++n_owning_processors;
deallog << "# processors owning dofs=" << n_owning_processors << std::endl;
}
-
+
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
deallog << std::endl;
}
#include "../tests.h"
#include <deal.II/base/logstream.h>
#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/utilities.h>
-#include <deal.II/base/conditional_ostream.h>
-#include <deal.II/base/index_set.h>
+#include <deal.II/base/utilities.h>
+#include <deal.II/base/conditional_ostream.h>
+#include <deal.II/base/index_set.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/grid/tria_iterator.h>
-#include <deal.II/grid/grid_tools.h>
+#include <deal.II/grid/grid_tools.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/lac/petsc_parallel_vector.h>
#include <deal.II/lac/petsc_parallel_sparse_matrix.h>
-#include <deal.II/distributed/tria.h>
-#include <deal.II/distributed/grid_refinement.h>
+#include <deal.II/distributed/tria.h>
+#include <deal.II/distributed/grid_refinement.h>
#include <deal.II/numerics/data_out.h>
#include <deal.II/numerics/vector_tools.h>
using namespace dealii;
-//#define DISTRIBUTED
+//#define DISTRIBUTED
template<int dim>
void test_int(const unsigned int n_global = 0,
const unsigned int n_local = 0)
{
-
+
MPI_Comm mpi_communicator (MPI_COMM_WORLD);
const unsigned int n_mpi_processes (Utilities::MPI::n_mpi_processes(mpi_communicator));
const unsigned int this_mpi_process (Utilities::MPI::this_mpi_process(mpi_communicator));
-
+
ConditionalOStream pcout (std::cout,
- (Utilities::MPI::this_mpi_process(mpi_communicator)
- == 0));
+ (Utilities::MPI::this_mpi_process(mpi_communicator)
+ == 0));
parallel::distributed::Triangulation<dim> tria_distrib(mpi_communicator);
GridGenerator::merge_triangulations (triangulation1, triangulation2, tria_distrib);
GridGenerator::merge_triangulations (triangulation1, triangulation2, tria_sequential);
}
-
+
tria_distrib.refine_global (n_global);
tria_sequential.refine_global(n_global);
-
+
for (unsigned int i = 0; i < n_local; i++)
{
// refine both the distributed and the sequential triangulation. the
// following relies on the fact that the first cell of the "global"
// triangulation happens to be on processor 0
if (this_mpi_process == 0)
- {
- for (typename Triangulation<dim>::active_cell_iterator
- cell = tria_distrib.begin_active();
- cell != tria_distrib.end(); ++cell)
- if (cell->is_locally_owned())
- {
- cell->set_refine_flag ();
- break;
- }
- }
-
-
+ {
+ for (typename Triangulation<dim>::active_cell_iterator
+ cell = tria_distrib.begin_active();
+ cell != tria_distrib.end(); ++cell)
+ if (cell->is_locally_owned())
+ {
+ cell->set_refine_flag ();
+ break;
+ }
+ }
+
+
tria_sequential.begin_active()->set_refine_flag ();
-
-
+
+
tria_distrib.prepare_coarsening_and_refinement ();
tria_distrib.execute_coarsening_and_refinement ();
-
+
tria_sequential.prepare_coarsening_and_refinement ();
tria_sequential.execute_coarsening_and_refinement ();
}
-
+
deallog << n_global << " " << n_local
- << " distrib=" << tria_distrib.has_hanging_nodes()
- << "; shared=" << tria_sequential.has_hanging_nodes()
- << std::endl;
+ << " distrib=" << tria_distrib.has_hanging_nodes()
+ << "; shared=" << tria_sequential.has_hanging_nodes()
+ << std::endl;
}
deallog.attach(logfile);
deallog.depth_console(0);
deallog.threshold_double(1.e-10);
-
+
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
test_int<2>(0,0);
test_int<2>(2,0);
test_int<2>(3,1);
-
+
test_int<3>(0,0);
test_int<3>(2,0);
- test_int<3>(3,1);
+ test_int<3>(3,1);
}
};
template<int dim>
-void setup(DoFHandler<dim> & dh,
- FE_Q<dim> & fe,
- LA::MPI::Vector & vec,
- LA::MPI::Vector & lr_vec)
+void setup(DoFHandler<dim> &dh,
+ FE_Q<dim> &fe,
+ LA::MPI::Vector &vec,
+ LA::MPI::Vector &lr_vec)
{
dh.distribute_dofs (fe);
vec.reinit(dh.locally_owned_dofs(), MPI_COMM_WORLD);
IndexSet locally_relevant;
DoFTools::extract_locally_relevant_dofs (dh, locally_relevant);
- lr_vec.reinit(locally_relevant, MPI_COMM_WORLD);
+ lr_vec.reinit(locally_relevant, MPI_COMM_WORLD);
}
template<int dim>
-void output(DoFHandler<dim> & dh, LA::MPI::Vector & v, unsigned int loop, const std::string filename_)
+void output(DoFHandler<dim> &dh, LA::MPI::Vector &v, unsigned int loop, const std::string filename_)
{
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
data_out.build_patches (1);
std::ostringstream filename;
filename << filename_
- << Utilities::int_to_string (loop, 2)
- << "."
- << Utilities::int_to_string (myid,2)
- << ".vtu";
-
+ << Utilities::int_to_string (loop, 2)
+ << "."
+ << Utilities::int_to_string (myid,2)
+ << ".vtu";
+
std::ofstream output (filename.str().c_str());
data_out.write_vtu (output);
if (myid)
{
std::vector<std::string> filenames;
for (unsigned int i=0; i<Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD); ++i)
- filenames.push_back (filename_ +
- Utilities::int_to_string (loop, 2) +
- "." +
- Utilities::int_to_string(i, 2) +
- ".vtu");
+ filenames.push_back (filename_ +
+ Utilities::int_to_string (loop, 2) +
+ "." +
+ Utilities::int_to_string(i, 2) +
+ ".vtu");
const std::string
- pvtu_master_filename = (filename_ +
- Utilities::int_to_string (loop, 2) +
- ".pvtu");
+ pvtu_master_filename = (filename_ +
+ Utilities::int_to_string (loop, 2) +
+ ".pvtu");
std::ofstream pvtu_master (pvtu_master_filename.c_str());
data_out.write_pvtu_record (pvtu_master, filenames);
}
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim,dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim,dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::hyper_cube(tr);
tr.refine_global(2);
parallel::distributed::Triangulation<dim> tr2(MPI_COMM_WORLD,
- dealii::Triangulation<dim,dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim,dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::hyper_cube(tr2);
tr2.refine_global(2);
-
+
FE_Q<dim> fe(1);
DoFHandler<dim> dh(tr);
DoFHandler<dim> dh2(tr2);
SomeFunction<dim> func;
-
+
for (unsigned int loop = 0; loop < 5; ++loop)
{
std::vector<bool> r_flags(tr.n_active_cells()*dim, false);
std::vector<bool> c_flags(tr.n_active_cells(), false);
- for (unsigned int i=0;i<c_flags.size();++i)
- {
- int roll = Testing::rand()%4;
- if (roll >= 2)
- {
- for (unsigned int j=0;j<dim;++j)
- r_flags[i*dim+j] = true;
- }
- else if (roll == 1)
- c_flags[i] = true;
- }
+ for (unsigned int i=0; i<c_flags.size(); ++i)
+ {
+ int roll = Testing::rand()%4;
+ if (roll >= 2)
+ {
+ for (unsigned int j=0; j<dim; ++j)
+ r_flags[i*dim+j] = true;
+ }
+ else if (roll == 1)
+ c_flags[i] = true;
+ }
tr.load_coarsen_flags(c_flags);
tr.load_refine_flags(r_flags);
tr.execute_coarsening_and_refinement ();
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
LA::MPI::Vector vec1;
lr_vec1 = vec1;
{
- Vector<double> local_errors (tr.n_active_cells());
- VectorTools::integrate_difference (dh, lr_vec1, func, local_errors,
- QGauss<dim>(3), VectorTools::L2_norm);
- double total_local_error = local_errors.l2_norm();
- const double total_global_error
- = std::sqrt (Utilities::MPI::sum (total_local_error * total_local_error, MPI_COMM_WORLD));
- if (myid == 0)
- deallog << "err: " << total_global_error << std::endl;
+ Vector<double> local_errors (tr.n_active_cells());
+ VectorTools::integrate_difference (dh, lr_vec1, func, local_errors,
+ QGauss<dim>(3), VectorTools::L2_norm);
+ double total_local_error = local_errors.l2_norm();
+ const double total_global_error
+ = std::sqrt (Utilities::MPI::sum (total_local_error * total_local_error, MPI_COMM_WORLD));
+ if (myid == 0)
+ deallog << "err: " << total_global_error << std::endl;
}
-
+
//output(dh, lr_vec1, loop, "solutionA-");
//output(dh2, lr_vec2, loop, "solutionB-");
-
+
// also update tr2 to be the same as tr1
tr2.load_coarsen_flags(c_flags);
tr2.load_refine_flags(r_flags);
const unsigned int checksum = tr.get_checksum ();
const unsigned int checksum2 = tr2.get_checksum ();
if (myid == 0)
- deallog << "Checksum: "
- << checksum << " " << checksum2
- << std::endl;
+ deallog << "Checksum: "
+ << checksum << " " << checksum2
+ << std::endl;
}
}
class SeventhProblem
{
public:
- SeventhProblem (unsigned int prob_number);
- ~SeventhProblem ();
- void run (unsigned int cycle);
+ SeventhProblem (unsigned int prob_number);
+ ~SeventhProblem ();
+ void run (unsigned int cycle);
private:
- void setup_system ();
- void setup_second_system ();
- void assemble_system ();
- void solve ();
- MPI_Comm mpi_communicator;
- parallel::distributed::Triangulation<2>::Settings settings;
- parallel::distributed::Triangulation<dim> triangulation;
- DoFHandler<dim> dof_handler;
- FE_Q<dim> fe;
- IndexSet locally_owned_dofs;
- IndexSet locally_relevant_dofs;
- ConstraintMatrix constraints;
- TrilinosWrappers::SparseMatrix system_matrix;
- TrilinosWrappers::MPI::Vector locally_relevant_solution;
- TrilinosWrappers::MPI::Vector interpolated_locally_relevant_solution;
- TrilinosWrappers::MPI::Vector system_rhs;
- parallel::distributed::Triangulation<dim> second_triangulation;
- DoFHandler<dim> second_dof_handler;
- FE_Q<dim> second_fe;
- IndexSet second_locally_owned_dofs;
- IndexSet second_locally_relevant_dofs;
- TrilinosWrappers::MPI::Vector second_locally_relevant_solution;
- ConditionalOStream pcout;
- unsigned int prob_number;
+ void setup_system ();
+ void setup_second_system ();
+ void assemble_system ();
+ void solve ();
+ MPI_Comm mpi_communicator;
+ parallel::distributed::Triangulation<2>::Settings settings;
+ parallel::distributed::Triangulation<dim> triangulation;
+ DoFHandler<dim> dof_handler;
+ FE_Q<dim> fe;
+ IndexSet locally_owned_dofs;
+ IndexSet locally_relevant_dofs;
+ ConstraintMatrix constraints;
+ TrilinosWrappers::SparseMatrix system_matrix;
+ TrilinosWrappers::MPI::Vector locally_relevant_solution;
+ TrilinosWrappers::MPI::Vector interpolated_locally_relevant_solution;
+ TrilinosWrappers::MPI::Vector system_rhs;
+ parallel::distributed::Triangulation<dim> second_triangulation;
+ DoFHandler<dim> second_dof_handler;
+ FE_Q<dim> second_fe;
+ IndexSet second_locally_owned_dofs;
+ IndexSet second_locally_relevant_dofs;
+ TrilinosWrappers::MPI::Vector second_locally_relevant_solution;
+ ConditionalOStream pcout;
+ unsigned int prob_number;
};
template <int dim>
SeventhProblem<dim>::SeventhProblem (unsigned int prob_number)
-:
-mpi_communicator (MPI_COMM_WORLD),
-settings (parallel::distributed::Triangulation<2,2>::no_automatic_repartitioning),
-triangulation (mpi_communicator,
- typename Triangulation<dim>::MeshSmoothing
- (Triangulation<dim>::smoothing_on_refinement |
- Triangulation<dim>::smoothing_on_coarsening),
- settings),
-dof_handler (triangulation),
-fe (2),
-second_triangulation (mpi_communicator,
- typename Triangulation<dim>::MeshSmoothing
- (Triangulation<dim>::smoothing_on_refinement |
- Triangulation<dim>::smoothing_on_coarsening),
- settings),
-second_dof_handler (second_triangulation),
-second_fe (2),
-pcout (deallog.get_file_stream(),
- (Utilities::MPI::this_mpi_process(mpi_communicator)
- == 0)),
-prob_number(prob_number)
+ :
+ mpi_communicator (MPI_COMM_WORLD),
+ settings (parallel::distributed::Triangulation<2,2>::no_automatic_repartitioning),
+ triangulation (mpi_communicator,
+ typename Triangulation<dim>::MeshSmoothing
+ (Triangulation<dim>::smoothing_on_refinement |
+ Triangulation<dim>::smoothing_on_coarsening),
+ settings),
+ dof_handler (triangulation),
+ fe (2),
+ second_triangulation (mpi_communicator,
+ typename Triangulation<dim>::MeshSmoothing
+ (Triangulation<dim>::smoothing_on_refinement |
+ Triangulation<dim>::smoothing_on_coarsening),
+ settings),
+ second_dof_handler (second_triangulation),
+ second_fe (2),
+ pcout (deallog.get_file_stream(),
+ (Utilities::MPI::this_mpi_process(mpi_communicator)
+ == 0)),
+ prob_number(prob_number)
{}
template <int dim>
SeventhProblem<dim>::~SeventhProblem ()
{
- dof_handler.clear ();
- second_dof_handler.clear ();
+ dof_handler.clear ();
+ second_dof_handler.clear ();
}
template <int dim>
void SeventhProblem<dim>::setup_system ()
{
- dof_handler.distribute_dofs (fe);
- locally_owned_dofs = dof_handler.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (dof_handler,
- locally_relevant_dofs);
- locally_relevant_solution.reinit (locally_owned_dofs,
- locally_relevant_dofs, mpi_communicator);
- system_rhs.reinit (locally_owned_dofs, mpi_communicator);
- system_rhs = 0;
- constraints.clear ();
- constraints.reinit (locally_relevant_dofs);
- DoFTools::make_hanging_node_constraints (dof_handler, constraints);
- VectorTools::interpolate_boundary_values (dof_handler,
- 0,
- ZeroFunction<dim>(),
- constraints);
- constraints.close ();
- CompressedSimpleSparsityPattern csp (locally_relevant_dofs);
- DoFTools::make_sparsity_pattern (dof_handler, csp,
- constraints, false);
- SparsityTools::distribute_sparsity_pattern (csp,
- dof_handler.n_locally_owned_dofs_per_processor(),
- mpi_communicator,
- locally_relevant_dofs);
- system_matrix.reinit (locally_owned_dofs,
- locally_owned_dofs,
- csp,
- mpi_communicator);
+ dof_handler.distribute_dofs (fe);
+ locally_owned_dofs = dof_handler.locally_owned_dofs ();
+ DoFTools::extract_locally_relevant_dofs (dof_handler,
+ locally_relevant_dofs);
+ locally_relevant_solution.reinit (locally_owned_dofs,
+ locally_relevant_dofs, mpi_communicator);
+ system_rhs.reinit (locally_owned_dofs, mpi_communicator);
+ system_rhs = 0;
+ constraints.clear ();
+ constraints.reinit (locally_relevant_dofs);
+ DoFTools::make_hanging_node_constraints (dof_handler, constraints);
+ VectorTools::interpolate_boundary_values (dof_handler,
+ 0,
+ ZeroFunction<dim>(),
+ constraints);
+ constraints.close ();
+ CompressedSimpleSparsityPattern csp (locally_relevant_dofs);
+ DoFTools::make_sparsity_pattern (dof_handler, csp,
+ constraints, false);
+ SparsityTools::distribute_sparsity_pattern (csp,
+ dof_handler.n_locally_owned_dofs_per_processor(),
+ mpi_communicator,
+ locally_relevant_dofs);
+ system_matrix.reinit (locally_owned_dofs,
+ locally_owned_dofs,
+ csp,
+ mpi_communicator);
}
template <int dim>
void SeventhProblem<dim>::setup_second_system ()
{
- second_dof_handler.distribute_dofs (fe);
- second_locally_owned_dofs = second_dof_handler.locally_owned_dofs ();
- DoFTools::extract_locally_relevant_dofs (second_dof_handler,
- second_locally_relevant_dofs);
- second_locally_relevant_solution.reinit (second_locally_owned_dofs,
- second_locally_relevant_dofs, mpi_communicator);
- interpolated_locally_relevant_solution.reinit(second_locally_owned_dofs,
- second_locally_relevant_dofs, mpi_communicator);
+ second_dof_handler.distribute_dofs (fe);
+ second_locally_owned_dofs = second_dof_handler.locally_owned_dofs ();
+ DoFTools::extract_locally_relevant_dofs (second_dof_handler,
+ second_locally_relevant_dofs);
+ second_locally_relevant_solution.reinit (second_locally_owned_dofs,
+ second_locally_relevant_dofs, mpi_communicator);
+ interpolated_locally_relevant_solution.reinit(second_locally_owned_dofs,
+ second_locally_relevant_dofs, mpi_communicator);
}
template <int dim>
void SeventhProblem<dim>::assemble_system ()
{
- const QGauss<dim> quadrature_formula(3);
- FEValues<dim> fe_values (fe, quadrature_formula,
- update_values | update_gradients |
- update_quadrature_points |
- update_JxW_values);
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.size();
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- Vector<double> cell_rhs (dofs_per_cell);
- std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
- typename DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
- for (; cell!=endc; ++cell)
- if (cell->is_locally_owned())
- {
- cell_matrix = 0;
- cell_rhs = 0;
- fe_values.reinit (cell);
- for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
- {
- const double
- rhs_value
- = (fe_values.quadrature_point(q_point)[1]
- >
- 0.5+0.25*std::sin(4.0 * numbers::PI *
- fe_values.quadrature_point(q_point)[0])
- ? 1 : -1);
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- {
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
- fe_values.shape_grad(j,q_point) *
- fe_values.JxW(q_point));
- cell_rhs(i) += (rhs_value *
- fe_values.shape_value(i,q_point) *
- fe_values.JxW(q_point));
- }
- }
- cell->get_dof_indices (local_dof_indices);
- constraints.distribute_local_to_global (cell_matrix,
- cell_rhs,
- local_dof_indices,
- system_matrix,
- system_rhs);
- }
- system_matrix.compress (VectorOperation::add);
- system_rhs.compress (VectorOperation::add);
+ const QGauss<dim> quadrature_formula(3);
+ FEValues<dim> fe_values (fe, quadrature_formula,
+ update_values | update_gradients |
+ update_quadrature_points |
+ update_JxW_values);
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.size();
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ Vector<double> cell_rhs (dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+ typename DoFHandler<dim>::active_cell_iterator
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
+ for (; cell!=endc; ++cell)
+ if (cell->is_locally_owned())
+ {
+ cell_matrix = 0;
+ cell_rhs = 0;
+ fe_values.reinit (cell);
+ for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+ {
+ const double
+ rhs_value
+ = (fe_values.quadrature_point(q_point)[1]
+ >
+ 0.5+0.25*std::sin(4.0 * numbers::PI *
+ fe_values.quadrature_point(q_point)[0])
+ ? 1 : -1);
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ {
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point));
+ cell_rhs(i) += (rhs_value *
+ fe_values.shape_value(i,q_point) *
+ fe_values.JxW(q_point));
+ }
+ }
+ cell->get_dof_indices (local_dof_indices);
+ constraints.distribute_local_to_global (cell_matrix,
+ cell_rhs,
+ local_dof_indices,
+ system_matrix,
+ system_rhs);
+ }
+ system_matrix.compress (VectorOperation::add);
+ system_rhs.compress (VectorOperation::add);
}
template <int dim>
void SeventhProblem<dim>::solve ()
{
- LA::MPI::Vector
- completely_distributed_solution (locally_owned_dofs, mpi_communicator);
- SolverControl solver_control (dof_handler.n_dofs(), 1e-12);
- TrilinosWrappers::SolverCG solver(solver_control, mpi_communicator);
- TrilinosWrappers::PreconditionAMG preconditioner;
- TrilinosWrappers::PreconditionAMG::AdditionalData data;
- preconditioner.initialize(system_matrix, data);
- solver.solve (system_matrix, completely_distributed_solution, system_rhs,
- preconditioner);
- pcout << " Solved in " << solver_control.last_step()
- << " iterations." << std::endl;
- constraints.distribute (completely_distributed_solution);
- locally_relevant_solution = completely_distributed_solution;
+ LA::MPI::Vector
+ completely_distributed_solution (locally_owned_dofs, mpi_communicator);
+ SolverControl solver_control (dof_handler.n_dofs(), 1e-12);
+ TrilinosWrappers::SolverCG solver(solver_control, mpi_communicator);
+ TrilinosWrappers::PreconditionAMG preconditioner;
+ TrilinosWrappers::PreconditionAMG::AdditionalData data;
+ preconditioner.initialize(system_matrix, data);
+ solver.solve (system_matrix, completely_distributed_solution, system_rhs,
+ preconditioner);
+ pcout << " Solved in " << solver_control.last_step()
+ << " iterations." << std::endl;
+ constraints.distribute (completely_distributed_solution);
+ locally_relevant_solution = completely_distributed_solution;
}
template <int dim>
void SeventhProblem<dim>::run (unsigned int cycle)
{
- if (cycle == 0)
+ if (cycle == 0)
{
- GridGenerator::hyper_cube (triangulation);
- triangulation.refine_global (1);
- GridGenerator::hyper_cube (second_triangulation);
- second_triangulation.refine_global (1);
- setup_system();
+ GridGenerator::hyper_cube (triangulation);
+ triangulation.refine_global (1);
+ GridGenerator::hyper_cube (second_triangulation);
+ second_triangulation.refine_global (1);
+ setup_system();
}
- else
+ else
{
- Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
- KellyErrorEstimator<dim>::estimate (dof_handler,
- QGauss<dim-1>(3),
- typename FunctionMap<dim>::type(),
- locally_relevant_solution,
- estimated_error_per_cell);
-
- parallel::distributed::GridRefinement::
- refine_and_coarsen_fixed_number (triangulation,
- estimated_error_per_cell,
- 0.5, 0.3);
- std::vector<bool> r_flags;
- std::vector<bool> c_flags;
- triangulation.prepare_coarsening_and_refinement();
- triangulation.save_refine_flags(r_flags);
- triangulation.save_coarsen_flags(c_flags);
-
- triangulation.execute_coarsening_and_refinement ();
-
- setup_system();
- pcout << " Number of active cells: "
- << triangulation.n_global_active_cells()
- << std::endl
- << " Number of degrees of freedom: "
- << dof_handler.n_dofs()
- << std::endl;
- assemble_system ();
- solve ();
-
- setup_second_system();
- second_locally_relevant_solution = locally_relevant_solution;
+ Vector<float> estimated_error_per_cell (triangulation.n_active_cells());
+ KellyErrorEstimator<dim>::estimate (dof_handler,
+ QGauss<dim-1>(3),
+ typename FunctionMap<dim>::type(),
+ locally_relevant_solution,
+ estimated_error_per_cell);
- VectorTools::interpolate_to_different_mesh(dof_handler, locally_relevant_solution,
- second_dof_handler, interpolated_locally_relevant_solution);
- second_triangulation.load_coarsen_flags(c_flags);
- second_triangulation.load_refine_flags(r_flags);
- second_triangulation.execute_coarsening_and_refinement();
+ parallel::distributed::GridRefinement::
+ refine_and_coarsen_fixed_number (triangulation,
+ estimated_error_per_cell,
+ 0.5, 0.3);
+ std::vector<bool> r_flags;
+ std::vector<bool> c_flags;
+ triangulation.prepare_coarsening_and_refinement();
+ triangulation.save_refine_flags(r_flags);
+ triangulation.save_coarsen_flags(c_flags);
+
+ triangulation.execute_coarsening_and_refinement ();
+
+ setup_system();
+ pcout << " Number of active cells: "
+ << triangulation.n_global_active_cells()
+ << std::endl
+ << " Number of degrees of freedom: "
+ << dof_handler.n_dofs()
+ << std::endl;
+ assemble_system ();
+ solve ();
+
+ setup_second_system();
+ second_locally_relevant_solution = locally_relevant_solution;
+
+ VectorTools::interpolate_to_different_mesh(dof_handler, locally_relevant_solution,
+ second_dof_handler, interpolated_locally_relevant_solution);
+ second_triangulation.load_coarsen_flags(c_flags);
+ second_triangulation.load_refine_flags(r_flags);
+ second_triangulation.execute_coarsening_and_refinement();
}
}
void seventh_grid()
{
-
+
ConditionalOStream pcout(deallog.get_file_stream(),
- (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)
- == 0));
-
- pcout << "7th Starting" << std::endl;
- SeventhProblem<2> lap(1);
- const unsigned int n_cycles = 5;
- for (unsigned int cycle=0; cycle<n_cycles; ++cycle)
+ (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD)
+ == 0));
+
+ pcout << "7th Starting" << std::endl;
+ SeventhProblem<2> lap(1);
+ const unsigned int n_cycles = 5;
+ for (unsigned int cycle=0; cycle<n_cycles; ++cycle)
{
- pcout << "Cycle " << cycle << ':' << std::endl;
- lap.run(cycle);
+ pcout << "Cycle " << cycle << ':' << std::endl;
+ lap.run(cycle);
}
- pcout << "OK" << std::endl;
+ pcout << "OK" << std::endl;
}
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
MPILogInitAll log;
deallog.depth_file(0);
-
+
seventh_grid ();
}
template <int dim>
void
myIntegrator<dim>::face(MeshWorker::DoFInfo<dim> &info1, MeshWorker::DoFInfo<dim> &info2,
- CellInfo &, CellInfo &) const
+ CellInfo &, CellInfo &) const
{
deallog << "F cell1 = " << info1.cell->id()
- << " face = " << info1.face_number
- << " cell2 = " << info2.cell->id()
- << " face2 = " << info2.face_number
- << std::endl;
+ << " face = " << info1.face_number
+ << " cell2 = " << info2.cell->id()
+ << " face2 = " << info2.face_number
+ << std::endl;
}
class DoNothingAssembler
{
- public:
- template <class DOFINFO>
- void initialize_info(DOFINFO &info, bool face) const {}
- template<class DOFINFO>
- void assemble(const DOFINFO &info){}
- template<class DOFINFO>
- void assemble(const DOFINFO &info1,
- const DOFINFO &info2) {}
+public:
+ template <class DOFINFO>
+ void initialize_info(DOFINFO &info, bool face) const {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info) {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info1,
+ const DOFINFO &info2) {}
- };
+};
template <int dim>
void
MeshWorker::integration_loop<dim, dim, typename DoFHandler<dim>::active_cell_iterator, DoNothingAssembler>
- (dofs.begin_active(), dofs.end(),
- dof_info, info_box,
- local,
- assembler,
- lctrl);
+ (dofs.begin_active(), dofs.end(),
+ dof_info, info_box,
+ local,
+ assembler,
+ lctrl);
// MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
// (dofs.begin_active(), dofs.end(),
void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
{
deallog << "* own_cells=" << lctrl.own_cells
- << " ghost_cells=" << lctrl.ghost_cells
- << " own_faces=" << lctrl.own_faces
- << " faces_to_ghost=" << lctrl.faces_to_ghost
- << std::endl;
+ << " ghost_cells=" << lctrl.ghost_cells
+ << " own_faces=" << lctrl.own_faces
+ << " faces_to_ghost=" << lctrl.faces_to_ghost
+ << std::endl;
test_simple(dofs, lctrl);
}
reps.push_back(2);
reps.push_back(1);
GridGenerator::subdivided_hyper_rectangle (tr, reps,
- Point<dim>(), Point<dim>(2.0,1.0));
+ Point<dim>(), Point<dim>(2.0,1.0));
FE_DGP<dim> fe(0);
-
+
DoFHandler<dim> dofs(tr);
dofs.distribute_dofs(fe);
lctrl.own_faces = MeshWorker::LoopControl::never;
lctrl.faces_to_ghost = MeshWorker::LoopControl::never;
- lctrl.own_cells = false; lctrl.ghost_cells = false;
+ lctrl.own_cells = false;
+ lctrl.ghost_cells = false;
test_loop(dofs, lctrl);
- lctrl.own_cells = true; lctrl.ghost_cells = false;
+ lctrl.own_cells = true;
+ lctrl.ghost_cells = false;
test_loop(dofs, lctrl);
- lctrl.own_cells = false; lctrl.ghost_cells = true;
+ lctrl.own_cells = false;
+ lctrl.ghost_cells = true;
test_loop(dofs, lctrl);
- lctrl.own_cells = true; lctrl.ghost_cells = true;
+ lctrl.own_cells = true;
+ lctrl.ghost_cells = true;
test_loop(dofs, lctrl);
deallog << "*** 2. FACES ***" << std::endl;
- lctrl.own_cells = false; lctrl.ghost_cells = false;
+ lctrl.own_cells = false;
+ lctrl.ghost_cells = false;
lctrl.own_faces = MeshWorker::LoopControl::one;
lctrl.faces_to_ghost = MeshWorker::LoopControl::never;
template <int dim>
void
myIntegrator<dim>::face(MeshWorker::DoFInfo<dim> &info1, MeshWorker::DoFInfo<dim> &info2,
- CellInfo &, CellInfo &) const
+ CellInfo &, CellInfo &) const
{
deallog << "F cell1 = " << info1.cell->id()
- << " face = " << info1.face_number
- << " cell2 = " << info2.cell->id()
- << " face2 = " << info2.face_number
- << std::endl;
+ << " face = " << info1.face_number
+ << " cell2 = " << info2.cell->id()
+ << " face2 = " << info2.face_number
+ << std::endl;
}
class DoNothingAssembler
{
- public:
- template <class DOFINFO>
- void initialize_info(DOFINFO &info, bool face) const {}
- template<class DOFINFO>
- void assemble(const DOFINFO &info){}
- template<class DOFINFO>
- void assemble(const DOFINFO &info1,
- const DOFINFO &info2) {}
+public:
+ template <class DOFINFO>
+ void initialize_info(DOFINFO &info, bool face) const {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info) {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info1,
+ const DOFINFO &info2) {}
};
MeshWorker::integration_loop<dim, dim, typename DoFHandler<dim>::active_cell_iterator, DoNothingAssembler>
- (dofs.begin_active(), dofs.end(),
- dof_info, info_box,
- local,
- assembler,
- lctrl);
+ (dofs.begin_active(), dofs.end(),
+ dof_info, info_box,
+ local,
+ assembler,
+ lctrl);
// MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
// (dofs.begin_active(), dofs.end(),
void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
{
deallog << "* own_cells=" << lctrl.own_cells
- << " ghost_cells=" << lctrl.ghost_cells
- << " own_faces=" << lctrl.own_faces
- << " faces_to_ghost=" << lctrl.faces_to_ghost
- << std::endl;
+ << " ghost_cells=" << lctrl.ghost_cells
+ << " own_faces=" << lctrl.own_faces
+ << " faces_to_ghost=" << lctrl.faces_to_ghost
+ << std::endl;
test_simple(dofs, lctrl);
}
tr.execute_coarsening_and_refinement();
FE_DGP<dim> fe(0);
-
+
DoFHandler<dim> dofs(tr);
dofs.distribute_dofs(fe);
template <int dim>
void
myIntegrator<dim>::face(MeshWorker::DoFInfo<dim> &info1, MeshWorker::DoFInfo<dim> &info2,
- CellInfo &, CellInfo &) const
+ CellInfo &, CellInfo &) const
{
deallog << "F cell1 = " << info1.cell->id()
- << " face = " << info1.face_number
- << " cell2 = " << info2.cell->id()
- << " face2 = " << info2.face_number
- << std::endl;
+ << " face = " << info1.face_number
+ << " cell2 = " << info2.cell->id()
+ << " face2 = " << info2.face_number
+ << std::endl;
}
class DoNothingAssembler
{
- public:
- template <class DOFINFO>
- void initialize_info(DOFINFO &info, bool face) const {}
- template<class DOFINFO>
- void assemble(const DOFINFO &info){}
- template<class DOFINFO>
- void assemble(const DOFINFO &info1,
- const DOFINFO &info2) {}
+public:
+ template <class DOFINFO>
+ void initialize_info(DOFINFO &info, bool face) const {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info) {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info1,
+ const DOFINFO &info2) {}
};
MeshWorker::integration_loop<dim, dim, typename DoFHandler<dim>::active_cell_iterator, DoNothingAssembler>
- (dofs.begin_active(), dofs.end(),
- dof_info, info_box,
- local,
- assembler,
- lctrl);
+ (dofs.begin_active(), dofs.end(),
+ dof_info, info_box,
+ local,
+ assembler,
+ lctrl);
// MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
// (dofs.begin_active(), dofs.end(),
void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
{
deallog << "* own_cells=" << lctrl.own_cells
- << " ghost_cells=" << lctrl.ghost_cells
- << " own_faces=" << lctrl.own_faces
- << " faces_to_ghost=" << lctrl.faces_to_ghost
- << std::endl;
+ << " ghost_cells=" << lctrl.ghost_cells
+ << " own_faces=" << lctrl.own_faces
+ << " faces_to_ghost=" << lctrl.faces_to_ghost
+ << std::endl;
test_simple(dofs, lctrl);
}
if (myid==0)
{
typename parallel::distributed::Triangulation<dim>::active_cell_iterator
- it = tr.begin_active();
+ it = tr.begin_active();
it->set_refine_flag();
- ++it;++it;++it;
+ ++it;
+ ++it;
+ ++it;
it->set_refine_flag();
}
tr.execute_coarsening_and_refinement();
FE_DGP<dim> fe(0);
-
+
DoFHandler<dim> dofs(tr);
dofs.distribute_dofs(fe);
template <int dim>
void
myIntegrator<dim>::face(MeshWorker::DoFInfo<dim> &info1, MeshWorker::DoFInfo<dim> &info2,
- CellInfo &, CellInfo &) const
+ CellInfo &, CellInfo &) const
{
deallog << "F cell1 = " << info1.cell->id()
- << " face = " << info1.face_number
- << " cell2 = " << info2.cell->id()
- << " face2 = " << info2.face_number
- << std::endl;
+ << " face = " << info1.face_number
+ << " cell2 = " << info2.cell->id()
+ << " face2 = " << info2.face_number
+ << std::endl;
}
class DoNothingAssembler
{
- public:
- template <class DOFINFO>
- void initialize_info(DOFINFO &info, bool face) const {}
- template<class DOFINFO>
- void assemble(const DOFINFO &info){}
- template<class DOFINFO>
- void assemble(const DOFINFO &info1,
- const DOFINFO &info2) {}
+public:
+ template <class DOFINFO>
+ void initialize_info(DOFINFO &info, bool face) const {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info) {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info1,
+ const DOFINFO &info2) {}
};
MeshWorker::integration_loop<dim, dim, typename DoFHandler<dim>::active_cell_iterator, DoNothingAssembler>
- (dofs.begin_active(), dofs.end(),
- dof_info, info_box,
- local,
- assembler,
- lctrl);
+ (dofs.begin_active(), dofs.end(),
+ dof_info, info_box,
+ local,
+ assembler,
+ lctrl);
// MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
// (dofs.begin_active(), dofs.end(),
void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
{
deallog << "* own_cells=" << lctrl.own_cells
- << " ghost_cells=" << lctrl.ghost_cells
- << " own_faces=" << lctrl.own_faces
- << " faces_to_ghost=" << lctrl.faces_to_ghost
- << std::endl;
+ << " ghost_cells=" << lctrl.ghost_cells
+ << " own_faces=" << lctrl.own_faces
+ << " faces_to_ghost=" << lctrl.faces_to_ghost
+ << std::endl;
test_simple(dofs, lctrl);
}
tr.execute_coarsening_and_refinement();
FE_DGP<dim> fe(0);
-
+
DoFHandler<dim> dofs(tr);
dofs.distribute_dofs(fe);
template <int dim>
void
myIntegrator<dim>::face(MeshWorker::DoFInfo<dim> &info1, MeshWorker::DoFInfo<dim> &info2,
- CellInfo &, CellInfo &) const
+ CellInfo &, CellInfo &) const
{
deallog << "F cell1 = " << info1.cell->id()
- << " face = " << info1.face_number
- << " cell2 = " << info2.cell->id()
- << " face2 = " << info2.face_number
- << std::endl;
+ << " face = " << info1.face_number
+ << " cell2 = " << info2.cell->id()
+ << " face2 = " << info2.face_number
+ << std::endl;
}
class DoNothingAssembler
{
- public:
- template <class DOFINFO>
- void initialize_info(DOFINFO &info, bool face) const {}
- template<class DOFINFO>
- void assemble(const DOFINFO &info){}
- template<class DOFINFO>
- void assemble(const DOFINFO &info1,
- const DOFINFO &info2) {}
+public:
+ template <class DOFINFO>
+ void initialize_info(DOFINFO &info, bool face) const {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info) {}
+ template<class DOFINFO>
+ void assemble(const DOFINFO &info1,
+ const DOFINFO &info2) {}
- };
+};
template <int dim>
void
MeshWorker::integration_loop<dim, dim, typename DoFHandler<dim>::active_cell_iterator, DoNothingAssembler>
- (dofs.begin_active(), dofs.end(),
- dof_info, info_box,
- local,
- assembler,
- lctrl);
+ (dofs.begin_active(), dofs.end(),
+ dof_info, info_box,
+ local,
+ assembler,
+ lctrl);
// MeshWorker::loop<dim, dim, MeshWorker::DoFInfo<dim>, MeshWorker::IntegrationInfoBox<dim> >
// (dofs.begin_active(), dofs.end(),
void test_loop(DoFHandler<dim> &dofs, MeshWorker::LoopControl &lctrl)
{
deallog << "* own_cells=" << lctrl.own_cells
- << " ghost_cells=" << lctrl.ghost_cells
- << " own_faces=" << lctrl.own_faces
- << " faces_to_ghost=" << lctrl.faces_to_ghost
- << std::endl;
+ << " ghost_cells=" << lctrl.ghost_cells
+ << " own_faces=" << lctrl.own_faces
+ << " faces_to_ghost=" << lctrl.faces_to_ghost
+ << std::endl;
test_simple(dofs, lctrl);
}
parallel::distributed::Triangulation<dim>::construct_multigrid_hierarchy*/);
GridGenerator::hyper_cube(tr);
tr.refine_global(2);
-
+
FE_DGP<dim> fe(0);
-
+
DoFHandler<dim> dofs(tr);
dofs.distribute_dofs(fe);
*/
deallog << "*** 2. FACES ***" << std::endl;
- lctrl.own_cells = false; lctrl.ghost_cells = false;
+ lctrl.own_cells = false;
+ lctrl.ghost_cells = false;
lctrl.own_faces = MeshWorker::LoopControl::one;
lctrl.faces_to_ghost = MeshWorker::LoopControl::never;
/*
An error occurred in line <126> of file <mg_05.cc> in function
void test() [with int dim = 2]
-The violated condition was:
+The violated condition was:
cell->neighbor(f)->level_subdomain_id()<100
The name and call sequence of the exception was:
ExcInternalError()
-Additional Information:
+Additional Information:
(none)
*/
GridGenerator::hyper_cube(tr);
tr.refine_global(3);
- for (unsigned int ii=0;ii<5;++ii)
+ for (unsigned int ii=0; ii<5; ++ii)
{
typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(),
- endc = tr.end();
-
+ cell = tr.begin_active(),
+ endc = tr.end();
+
for (; cell!=endc; ++cell)
- if (Testing::rand()%42==1)
- cell->set_refine_flag ();
-
+ if (Testing::rand()%42==1)
+ cell->set_refine_flag ();
+
tr.execute_coarsening_and_refinement ();
-
+
DoFHandler<dim> dofh(tr);
-
- //output(tr);
-
+
+ //output(tr);
+
static const FE_Q<dim> fe(1);
dofh.distribute_dofs (fe);
dofh.distribute_mg_dofs (fe);
-
+
{
- for (unsigned int lvl=0; lvl<tr.n_levels(); ++lvl)
- {
-// deallog << "level " << lvl << ": "<< std::endl;
- typename DoFHandler<dim>::cell_iterator
- cell = dofh.begin(lvl),
- endc = dofh.end(lvl);
-
- for (; cell!=endc; ++cell)
- {
- if (cell->level_subdomain_id()!=tr.locally_owned_subdomain())
- continue;
- for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
- {
- if (cell->at_boundary(f))
- continue;
-
-// deallog << cell->neighbor(f)->level_subdomain_id() << std::endl;
- // is cell level-artificial?
- Assert(cell->neighbor(f)->level_subdomain_id()<100, ExcInternalError());
-
- std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
- cell->neighbor(f)->get_mg_dof_indices(dofs);
- for (unsigned int i=0;i<fe.n_dofs_per_cell();++i)
- {
- Assert(dofs[i]!=numbers::invalid_dof_index, ExcInternalError());
- }
-
- }
- }
- }
+ for (unsigned int lvl=0; lvl<tr.n_levels(); ++lvl)
+ {
+// deallog << "level " << lvl << ": "<< std::endl;
+ typename DoFHandler<dim>::cell_iterator
+ cell = dofh.begin(lvl),
+ endc = dofh.end(lvl);
+
+ for (; cell!=endc; ++cell)
+ {
+ if (cell->level_subdomain_id()!=tr.locally_owned_subdomain())
+ continue;
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ if (cell->at_boundary(f))
+ continue;
+
+// deallog << cell->neighbor(f)->level_subdomain_id() << std::endl;
+ // is cell level-artificial?
+ Assert(cell->neighbor(f)->level_subdomain_id()<100, ExcInternalError());
+
+ std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
+ cell->neighbor(f)->get_mg_dof_indices(dofs);
+ for (unsigned int i=0; i<fe.n_dofs_per_cell(); ++i)
+ {
+ Assert(dofs[i]!=numbers::invalid_dof_index, ExcInternalError());
+ }
+
+ }
+ }
+ }
}
}
-
+
if (myid==0)
deallog << "OK" << std::endl;
}
/*
An error occurred in line <1858> of file </ssd/deal-trunk/deal.II/source/dofs/dof_handler_policy.cc> in function
void dealii::internal::DoFHandler::Policy::{anonymous}::communicate_mg_dof_indices_on_marked_cells(const dealii::DoFHandler<dim, spacedim>&, const std::map<unsigned int, std::set<unsigned int> >&, const std::vector<unsigned int>&, const std::vector<unsigned int>&, unsigned int) [with int dim = 2, int spacedim = 2]
-The violated condition was:
+The violated condition was:
senders.find(status.MPI_SOURCE)!=senders.end()
The name and call sequence of the exception was:
ExcInternalError()
-Additional Information:
+Additional Information:
(none)
*/
GridGenerator::hyper_cube_slit(tr,-1,1);
tr.refine_global(2);
- for (unsigned int ii=0;ii<15;++ii)
+ for (unsigned int ii=0; ii<15; ++ii)
{
deallog << "loop " << ii << std::endl;
-
+
typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active(),
- endc = tr.end();
-
+ cell = tr.begin_active(),
+ endc = tr.end();
+
for (; cell!=endc; ++cell)
- if (Testing::rand()%42==1)
- cell->set_refine_flag ();
-
+ if (Testing::rand()%42==1)
+ cell->set_refine_flag ();
+
tr.execute_coarsening_and_refinement ();
-
+
DoFHandler<dim> dofh(tr);
-
- //output(tr);
-
+
+ //output(tr);
+
static const FE_Q<dim> fe(1);
dofh.distribute_dofs (fe);
dofh.distribute_mg_dofs (fe);
-
+
{
- for (unsigned int lvl=0; lvl<tr.n_levels(); ++lvl)
- {
- typename DoFHandler<dim>::cell_iterator
- cell = dofh.begin(lvl),
- endc = dofh.end(lvl);
-
- for (; cell!=endc; ++cell)
- {
- if (cell->level_subdomain_id()!=tr.locally_owned_subdomain())
- continue;
- for (unsigned int f=0;f<GeometryInfo<dim>::faces_per_cell;++f)
- {
- if (cell->at_boundary(f))
- continue;
-
- //deallog << cell->neighbor(f)->level_subdomain_id() << std::endl;
- // is cell level-artificial?
- Assert(cell->neighbor(f)->level_subdomain_id()<100, ExcInternalError());
-
- std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
- cell->neighbor(f)->get_mg_dof_indices(dofs);
- for (unsigned int i=0;i<fe.n_dofs_per_cell();++i)
- {
- Assert(dofs[i]!=numbers::invalid_dof_index, ExcInternalError());
- }
-
- }
- }
- }
+ for (unsigned int lvl=0; lvl<tr.n_levels(); ++lvl)
+ {
+ typename DoFHandler<dim>::cell_iterator
+ cell = dofh.begin(lvl),
+ endc = dofh.end(lvl);
+
+ for (; cell!=endc; ++cell)
+ {
+ if (cell->level_subdomain_id()!=tr.locally_owned_subdomain())
+ continue;
+ for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+ {
+ if (cell->at_boundary(f))
+ continue;
+
+ //deallog << cell->neighbor(f)->level_subdomain_id() << std::endl;
+ // is cell level-artificial?
+ Assert(cell->neighbor(f)->level_subdomain_id()<100, ExcInternalError());
+
+ std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
+ cell->neighbor(f)->get_mg_dof_indices(dofs);
+ for (unsigned int i=0; i<fe.n_dofs_per_cell(); ++i)
+ {
+ Assert(dofs[i]!=numbers::invalid_dof_index, ExcInternalError());
+ }
+
+ }
+ }
+ }
}
}
-
+
if (myid==0)
deallog << "OK" << std::endl;
}
first_vector_components.push_back(0);
GridTools::collect_periodic_faces(
- dof_handler, 2, 3, 1, periodicity_vector, Tensor<1, dim>(), matrix);
+ dof_handler, 2, 3, 1, periodicity_vector, Tensor<1, dim>(), matrix);
DoFTools::make_periodicity_constraints<DoFHandler<dim>>(
- periodicity_vector, constraints, fe.component_mask(velocities)),
- first_vector_components;
+ periodicity_vector, constraints, fe.component_mask(velocities)),
+ first_vector_components;
#endif
}
first_vector_components.push_back(0);
GridTools::collect_periodic_faces(
- triangulation, 2, 3, 1, periodicity_vector, Tensor<1, dim>(), matrix);
+ triangulation, 2, 3, 1, periodicity_vector, Tensor<1, dim>(), matrix);
triangulation.add_periodicity(periodicity_vector);
#endif
// write with small com
if (myid<3)
- {
- deallog << "writing with " << Utilities::MPI::n_mpi_processes(com_small) << std::endl;
-
- parallel::distributed::Triangulation<dim> tr (com_small);
- GridGenerator::hyper_cube (tr);
- tr.refine_global (2);
- for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active();
- cell != tr.end(); ++cell)
- if (!cell->is_ghost() && !cell->is_artificial())
- if (cell->center().norm() < 0.3)
- {
- cell->set_refine_flag();
- }
-
- tr.execute_coarsening_and_refinement ();
+ {
+ deallog << "writing with " << Utilities::MPI::n_mpi_processes(com_small) << std::endl;
- FE_Q<dim> fe (1);
- DoFHandler<dim> dh (tr);
- dh.distribute_dofs (fe);
+ parallel::distributed::Triangulation<dim> tr (com_small);
+ GridGenerator::hyper_cube (tr);
+ tr.refine_global (2);
+ for (typename Triangulation<dim>::active_cell_iterator
+ cell = tr.begin_active();
+ cell != tr.end(); ++cell)
+ if (!cell->is_ghost() && !cell->is_artificial())
+ if (cell->center().norm() < 0.3)
+ {
+ cell->set_refine_flag();
+ }
- IndexSet locally_owned_dofs = dh.locally_owned_dofs ();
- IndexSet locally_relevant_dofs;
- DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs);
+ tr.execute_coarsening_and_refinement ();
- PETScWrappers::MPI::Vector x (locally_owned_dofs, com_small);
- PETScWrappers::MPI::Vector rel_x (locally_owned_dofs, locally_relevant_dofs, com_small);
+ FE_Q<dim> fe (1);
+ DoFHandler<dim> dh (tr);
+ dh.distribute_dofs (fe);
- parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans (dh);
+ IndexSet locally_owned_dofs = dh.locally_owned_dofs ();
+ IndexSet locally_relevant_dofs;
+ DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs);
- for (unsigned int i = 0; i < locally_owned_dofs.n_elements(); ++i)
- {
- unsigned int idx = locally_owned_dofs.nth_index_in_set (i);
- x (idx) = idx;
- deallog << '[' << idx << ']' << ' ' << x(idx) << std::endl;
- }
+ PETScWrappers::MPI::Vector x (locally_owned_dofs, com_small);
+ PETScWrappers::MPI::Vector rel_x (locally_owned_dofs, locally_relevant_dofs, com_small);
-
- x.compress(VectorOperation::insert);
- rel_x=x;
+ parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans (dh);
- soltrans.prepare_serialization (rel_x);
+ for (unsigned int i = 0; i < locally_owned_dofs.n_elements(); ++i)
+ {
+ unsigned int idx = locally_owned_dofs.nth_index_in_set (i);
+ x (idx) = idx;
+ deallog << '[' << idx << ']' << ' ' << x(idx) << std::endl;
+ }
+
+
+ x.compress(VectorOperation::insert);
+ rel_x=x;
+
+ soltrans.prepare_serialization (rel_x);
+
+ tr.save ("file");
+ // tr.write_mesh_vtk("before");
+ deallog << "#cells = " << tr.n_global_active_cells() << " norm= " << x.l2_norm() << std::endl;
+ deallog << "Checksum: "
+ << tr.get_checksum ()
+ << std::endl;
+ }
- tr.save ("file");
- // tr.write_mesh_vtk("before");
- deallog << "#cells = " << tr.n_global_active_cells() << " norm= " << x.l2_norm() << std::endl;
- deallog << "Checksum: "
- << tr.get_checksum ()
- << std::endl;
- }
-
MPI_Barrier (MPI_COMM_WORLD);
deallog << "reading with " << Utilities::MPI::n_mpi_processes(com_all) << std::endl;
-
+
{
parallel::distributed::Triangulation<dim> tr (com_all);
PETScWrappers::MPI::Vector solution (locally_owned_dofs, com_all);
solution = 0;
-
+
parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans (dh);
soltrans.deserialize (solution);
<< tr.get_checksum ()
<< std::endl;
deallog << "norm: "
- << solution.l2_norm()
+ << solution.l2_norm()
<< std::endl;
// tr.write_mesh_vtk("after");
}
// copy vector content to non-ghosted vectors, manually created.
parallel::distributed::Vector<double> v_dist(local_owned, MPI_COMM_WORLD),
- w_dist(v_dist), u_dist(v_dist);
+ w_dist(v_dist), u_dist(v_dist);
v_dist = v;
w_dist = w;
data_out.write_vtu_in_parallel("output.vtu", MPI_COMM_WORLD);
MPI_Barrier(MPI_COMM_WORLD);
-
+
if (myid==0)
{
std::vector<std::string> filenames;
filenames.push_back("output.vtu");
- {
- std::ofstream master("output.pvtu");
- data_out.write_pvtu_record (master, filenames);
+ {
+ std::ofstream master("output.pvtu");
+ data_out.write_pvtu_record (master, filenames);
}
-
+
cat_file("output.vtu");
- cat_file("output.pvtu");
+ cat_file("output.pvtu");
}
deallog << "OK" << std::endl;
}
:
std::cout,
(Utilities::MPI::this_mpi_process(mpi_communicator)
- == 0))
+ == 0))
{}
endc = dof_handler.end();
for (; cell!=endc; ++cell)
if (cell->is_locally_owned())
- {
- cell_matrix = 0;
- cell_rhs = 0;
-
- fe_values.reinit (cell);
-
- for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
{
- double rhs_value
- = (std::cos(2*numbers::PI*fe_values.quadrature_point(q_point)[0]) *
- std::exp(-1*fe_values.quadrature_point(q_point)[0]) *
- std::cos(2*numbers::PI*fe_values.quadrature_point(q_point)[1]) *
- std::exp(-2*fe_values.quadrature_point(q_point)[1]));
-
- if (dim==3)
- rhs_value*=
- std::cos(2*numbers::PI*fe_values.quadrature_point(q_point)[2]) *
- std::exp (- 3 * fe_values.quadrature_point(q_point)[2]);
-
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- {
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
- fe_values.shape_grad(j,q_point) *
- fe_values.JxW(q_point));
-
- cell_rhs(i) += (rhs_value *
- fe_values.shape_value(i,q_point) *
- fe_values.JxW(q_point));
- }
+ cell_matrix = 0;
+ cell_rhs = 0;
+
+ fe_values.reinit (cell);
+
+ for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+ {
+ double rhs_value
+ = (std::cos(2*numbers::PI*fe_values.quadrature_point(q_point)[0]) *
+ std::exp(-1*fe_values.quadrature_point(q_point)[0]) *
+ std::cos(2*numbers::PI*fe_values.quadrature_point(q_point)[1]) *
+ std::exp(-2*fe_values.quadrature_point(q_point)[1]));
+
+ if (dim==3)
+ rhs_value*=
+ std::cos(2*numbers::PI*fe_values.quadrature_point(q_point)[2]) *
+ std::exp (- 3 * fe_values.quadrature_point(q_point)[2]);
+
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ {
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point));
+
+ cell_rhs(i) += (rhs_value *
+ fe_values.shape_value(i,q_point) *
+ fe_values.JxW(q_point));
+ }
+ }
+
+ cell->get_dof_indices (local_dof_indices);
+ constraints.distribute_local_to_global (cell_matrix,
+ cell_rhs,
+ local_dof_indices,
+ system_matrix,
+ system_rhs);
}
- cell->get_dof_indices (local_dof_indices);
- constraints.distribute_local_to_global (cell_matrix,
- cell_rhs,
- local_dof_indices,
- system_matrix,
- system_rhs);
- }
-
system_matrix.compress (VectorOperation::add);
system_rhs.compress (VectorOperation::add);
}
locally_relevant_solution,
estimated_error_per_cell);
parallel::distributed::GridRefinement::
- refine_and_coarsen_fixed_number (triangulation,
- estimated_error_per_cell,
- 0.3, 0.03);
+ refine_and_coarsen_fixed_number (triangulation,
+ estimated_error_per_cell,
+ 0.3, 0.03);
triangulation.execute_coarsening_and_refinement ();
}
template <int dim>
void LaplaceProblem<dim>::get_point_value
- (const Point<dim> point, const int proc, Vector<double> &value) const
+ (const Point<dim> point, const int proc, Vector<double> &value) const
{
typename DoFHandler<dim>::active_cell_iterator cell
= GridTools::find_active_cell_around_point (dof_handler, point);
std::vector<double> tmp2 (value.size());
MPI_Reduce(&(tmp[0]), &(tmp2[0]), value.size(), MPI_DOUBLE,
MPI_SUM, proc, mpi_communicator);
-
+
for (unsigned int i=0; i<value.size(); ++i)
value[i]=tmp2[i];
}
template <int dim>
void LaplaceProblem<dim>::check_periodicity
- (const unsigned int cycle) const
+ (const unsigned int cycle) const
{}
template <>
unsigned int n_points = 2;
for (unsigned int i = 0; i<cycle; i++)
n_points*=2;
-
+
for (unsigned int i=1; i< n_points; i++)
- {
- Vector<double> value1(1);
- Vector<double> value2(1);
-
- Point <2> point1;
- point1(0)=1.*i/n_points;
- point1(1)=0.;
- Point <2> point2;
- point2(0)=1.*i/n_points;
- point2(1)=1.;
-
- get_point_value (point1, 0, value1);
- get_point_value (point2, 0, value2);
-
- if (Utilities::MPI::this_mpi_process(mpi_communicator)==0)
{
- pcout << point1 << "\t" << value1[0] << std::endl;
- if (std::abs(value2[0]-value1[0])>1e-8)
- {
- std::cout<<point1<< "\t" << value1[0] << std::endl;
- std::cout<<point2<< "\t" << value2[0] << std::endl;
- Assert(false, ExcInternalError());
- }
+ Vector<double> value1(1);
+ Vector<double> value2(1);
+
+ Point <2> point1;
+ point1(0)=1.*i/n_points;
+ point1(1)=0.;
+ Point <2> point2;
+ point2(0)=1.*i/n_points;
+ point2(1)=1.;
+
+ get_point_value (point1, 0, value1);
+ get_point_value (point2, 0, value2);
+
+ if (Utilities::MPI::this_mpi_process(mpi_communicator)==0)
+ {
+ pcout << point1 << "\t" << value1[0] << std::endl;
+ if (std::abs(value2[0]-value1[0])>1e-8)
+ {
+ std::cout<<point1<< "\t" << value1[0] << std::endl;
+ std::cout<<point2<< "\t" << value2[0] << std::endl;
+ Assert(false, ExcInternalError());
+ }
+ }
}
- }
}
template <>
unsigned int n_points = 2;
for (unsigned int i = 0; i<cycle; i++)
n_points*=2;
-
+
for (unsigned int i=1; i< n_points; i++)
for (unsigned int j=1; j< n_points; j++)
- {
- Vector<double> value1(1);
- Vector<double> value2(1);
- Vector<double> value3(1);
- Vector<double> value4(1);
-
- Point <3> point1;
- point1(0)=1.*i/n_points;
- point1(1)=1.*j/n_points;
- point1(2)=0.;
- Point <3> point2;
- point2(0)=1.*i/n_points;
- point2(1)=1.*j/n_points;
- point2(2)=1.;
- Point <3> point3;
- point3(0)=1.*i/n_points;
- point3(1)=0.;
- point3(2)=1.*j/n_points;;
- Point <3> point4;
- point4(0)=1.*i/n_points;
- point4(1)=1.;
- point4(2)=1.*j/n_points;;
-
- get_point_value (point1, 0, value1);
- get_point_value (point2, 0, value2);
- get_point_value (point3, 0, value3);
- get_point_value (point4, 0, value4);
-
- if (Utilities::MPI::this_mpi_process(mpi_communicator)==0)
- {
- pcout << point1 << "\t" << value1[0] << std::endl;
- if (std::abs(value2[0]-value1[0])>1e-8)
- {
- std::cout<<point1<< "\t" << value1[0] << std::endl;
- std::cout<<point2<< "\t" << value2[0] << std::endl;
- Assert(false, ExcInternalError());
- }
- pcout << point3 << "\t" << value3[0] << std::endl;
- if (std::abs(value4[0]-value3[0])>1e-8)
{
- std::cout<<point3<< "\t" << value3[0] << std::endl;
- std::cout<<point4<< "\t" << value4[0] << std::endl;
- Assert(false, ExcInternalError());
+ Vector<double> value1(1);
+ Vector<double> value2(1);
+ Vector<double> value3(1);
+ Vector<double> value4(1);
+
+ Point <3> point1;
+ point1(0)=1.*i/n_points;
+ point1(1)=1.*j/n_points;
+ point1(2)=0.;
+ Point <3> point2;
+ point2(0)=1.*i/n_points;
+ point2(1)=1.*j/n_points;
+ point2(2)=1.;
+ Point <3> point3;
+ point3(0)=1.*i/n_points;
+ point3(1)=0.;
+ point3(2)=1.*j/n_points;;
+ Point <3> point4;
+ point4(0)=1.*i/n_points;
+ point4(1)=1.;
+ point4(2)=1.*j/n_points;;
+
+ get_point_value (point1, 0, value1);
+ get_point_value (point2, 0, value2);
+ get_point_value (point3, 0, value3);
+ get_point_value (point4, 0, value4);
+
+ if (Utilities::MPI::this_mpi_process(mpi_communicator)==0)
+ {
+ pcout << point1 << "\t" << value1[0] << std::endl;
+ if (std::abs(value2[0]-value1[0])>1e-8)
+ {
+ std::cout<<point1<< "\t" << value1[0] << std::endl;
+ std::cout<<point2<< "\t" << value2[0] << std::endl;
+ Assert(false, ExcInternalError());
+ }
+ pcout << point3 << "\t" << value3[0] << std::endl;
+ if (std::abs(value4[0]-value3[0])>1e-8)
+ {
+ std::cout<<point3<< "\t" << value3[0] << std::endl;
+ std::cout<<point4<< "\t" << value4[0] << std::endl;
+ Assert(false, ExcInternalError());
+ }
+ }
}
- }
- }
}
-
+
//only needed for graphical output
template <int dim>
void LaplaceProblem<dim>::output_results (const unsigned int cycle) const
void LaplaceProblem<dim>::run ()
{
pcout << std::endl<< "Testing for dim="<<dim<<std::endl;
-
+
const unsigned int n_cycles = 3;
for (unsigned int cycle=0; cycle<n_cycles; ++cycle)
{
reps.push_back(2);
if (dim==3)
reps.push_back(2);
-
+
Point<dim> p1(true);
Point<dim> p2(true);
- for (unsigned int i=0;i<dim;++i)
+ for (unsigned int i=0; i<dim; ++i)
p2(i)=1.0;
GridGenerator::subdivided_hyper_rectangle
- (triangulation,reps,p1,p2,true);
+ (triangulation,reps,p1,p2,true);
std::vector<GridTools::PeriodicFacePair<typename parallel::distributed::Triangulation<dim>::cell_iterator> >
- periodicity_vector;
-
- for(int i=1; i<dim; ++i)
+ periodicity_vector;
+
+ for (int i=1; i<dim; ++i)
GridTools::collect_periodic_faces
- ( triangulation, /*b_id1*/ 2*i, /*b_id2*/ 2*i+1,
- /*direction*/ i, periodicity_vector);
-
+ ( triangulation, /*b_id1*/ 2*i, /*b_id2*/ 2*i+1,
+ /*direction*/ i, periodicity_vector);
+
triangulation.add_periodicity(periodicity_vector);
triangulation.refine_global (1);
}
else
- {
- refine_grid ();
- }
+ {
+ refine_grid ();
+ }
setup_system ();
assemble_system ();
deallog.depth_console (0);
if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD)==0)
- {
- std::ofstream logfile("output");
- deallog.attach(logfile, false);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
{
- LaplaceProblem<2> laplace_problem;
- laplace_problem.run ();
- }
- {
- LaplaceProblem<3> laplace_problem;
- laplace_problem.run ();
+ std::ofstream logfile("output");
+ deallog.attach(logfile, false);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+ {
+ LaplaceProblem<2> laplace_problem;
+ laplace_problem.run ();
+ }
+ {
+ LaplaceProblem<3> laplace_problem;
+ laplace_problem.run ();
+ }
}
- }
else
- {
- {
- LaplaceProblem<2> laplace_problem;
- laplace_problem.run ();
- }
{
- LaplaceProblem<3> laplace_problem;
- laplace_problem.run ();
+ {
+ LaplaceProblem<2> laplace_problem;
+ laplace_problem.run ();
+ }
+ {
+ LaplaceProblem<3> laplace_problem;
+ laplace_problem.run ();
+ }
}
- }
}
catch (std::exception &exc)
{
DoFTools::extract_locally_relevant_dofs (dof_handler, locally_relevant_dofs);
relevant_partitioning.push_back(locally_relevant_dofs.get_view(0, n_u));
relevant_partitioning.push_back(locally_relevant_dofs.get_view(n_u, n_u+n_p));
-
+
constraints.clear ();
constraints.reinit(locally_relevant_dofs);
first_vector_components.push_back(0);
GridTools::collect_periodic_faces(
- dof_handler, 2, 3, 1, periodicity_vector, Tensor<1, dim>(), matrix);
+ dof_handler, 2, 3, 1, periodicity_vector, Tensor<1, dim>(), matrix);
DoFTools::make_periodicity_constraints<DoFHandler<dim>>(
- periodicity_vector, constraints, fe.component_mask(velocities),
- first_vector_components);
+ periodicity_vector, constraints, fe.component_mask(velocities),
+ first_vector_components);
#endif
}
first_vector_components.push_back(0);
GridTools::collect_periodic_faces(
- triangulation, 2, 3, 1, periodicity_vector, Tensor<1, dim>(), matrix);
+ triangulation, 2, 3, 1, periodicity_vector, Tensor<1, dim>(), matrix);
triangulation.add_periodicity(periodicity_vector);
#endif
(Utilities::MPI::this_mpi_process(mpi_communicator)
== 0)),
rot_matrix(dim)
-{
- rot_matrix[0][dim-1] = -1.;
- rot_matrix[dim-1][0] = 1.;
- if (dim==3)
- rot_matrix[1][1] = 1.;
- offset[0] = 0;
- offset[1] = 0;
-}
+ {
+ rot_matrix[0][dim-1] = -1.;
+ rot_matrix[dim-1][0] = 1.;
+ if (dim==3)
+ rot_matrix[1][1] = 1.;
+ offset[0] = 0;
+ offset[1] = 0;
+ }
DoFTools::extract_locally_relevant_dofs (dof_handler, locally_relevant_dofs);
relevant_partitioning.push_back(locally_relevant_dofs.get_view(0, n_u));
relevant_partitioning.push_back(locally_relevant_dofs.get_view(n_u, n_u+n_p));
-
+
constraints.clear ();
constraints.reinit(locally_relevant_dofs);
rot_matrix);
DoFTools::make_periodicity_constraints<DoFHandler<dim> >
- (periodicity_vector, constraints, fe.component_mask(velocities),
- first_vector_components);
+ (periodicity_vector, constraints, fe.component_mask(velocities),
+ first_vector_components);
VectorTools::interpolate_boundary_values (dof_handler,
1,
fe.component_mask(velocities));
}
constraints.close ();
-
+
{
TrilinosWrappers::BlockSparsityPattern bsp
(owned_partitioning, owned_partitioning,
{
for (unsigned int j=0; j<=i; ++j)
{
- local_matrix(i,j) += (2 * (symgrad_phi_u[i] * symgrad_phi_u[j])
+ local_matrix(i,j) += (2 * (symgrad_phi_u[i] * symgrad_phi_u[j])
- div_phi_u[i] * phi_p[j]
- phi_p[i] * div_phi_u[j]
+ phi_p[i] * phi_p[j])
(const Point<dim> point, const int proc, Vector<double> &value) const
{
try
- {
- const typename DoFHandler<dim>::active_cell_iterator cell
- = GridTools::find_active_cell_around_point (dof_handler, point);
+ {
+ const typename DoFHandler<dim>::active_cell_iterator cell
+ = GridTools::find_active_cell_around_point (dof_handler, point);
- if (cell->is_locally_owned())
- VectorTools::point_value (dof_handler, solution,
- point, value);
- }
+ if (cell->is_locally_owned())
+ VectorTools::point_value (dof_handler, solution,
+ point, value);
+ }
catch (GridTools::ExcPointNotFound<dim> &p)
- {
- pcout<< "Point: " << point << " is not inside a cell!" <<std::endl;
- }
+ {
+ pcout<< "Point: " << point << " is not inside a cell!" <<std::endl;
+ }
std::vector<double> tmp (value.size());
// first collect all points locally
for (; cell!=endc; ++cell)
- if(cell->is_locally_owned() && cell->at_boundary())
- for (unsigned int face_no=0;face_no<GeometryInfo<dim>::faces_per_cell;
+ if (cell->is_locally_owned() && cell->at_boundary())
+ for (unsigned int face_no=0; face_no<GeometryInfo<dim>::faces_per_cell;
++face_no)
- {
- const typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
- if (face->at_boundary())
{
- if(face->boundary_id()==0)
- {
- fe_face_values.reinit(cell, face_no);
- const std::vector<Point<dim> > tmp_points
- = fe_face_values.get_quadrature_points();
- for (unsigned int i=0; i<tmp_points.size(); ++i)
- for (unsigned int c=0; c<dim; ++c)
- local_quad_points_first.push_back(tmp_points[i](c));
- }
- else if(face->boundary_id()==4)
- {
- fe_face_values.reinit(cell, face_no);
- const std::vector<Point<dim> > tmp_points
- = fe_face_values.get_quadrature_points();
- for (unsigned int i=0; i<tmp_points.size(); ++i)
- for (unsigned int c=0; c<dim; ++c)
- local_quad_points_second.push_back(tmp_points[i](c));
- }
+ const typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
+ if (face->at_boundary())
+ {
+ if (face->boundary_id()==0)
+ {
+ fe_face_values.reinit(cell, face_no);
+ const std::vector<Point<dim> > tmp_points
+ = fe_face_values.get_quadrature_points();
+ for (unsigned int i=0; i<tmp_points.size(); ++i)
+ for (unsigned int c=0; c<dim; ++c)
+ local_quad_points_first.push_back(tmp_points[i](c));
+ }
+ else if (face->boundary_id()==4)
+ {
+ fe_face_values.reinit(cell, face_no);
+ const std::vector<Point<dim> > tmp_points
+ = fe_face_values.get_quadrature_points();
+ for (unsigned int i=0; i<tmp_points.size(); ++i)
+ for (unsigned int c=0; c<dim; ++c)
+ local_quad_points_second.push_back(tmp_points[i](c));
+ }
+ }
}
- }
// next exchange them
std::vector<double> global_quad_points_first;
{
}
std::vector<double> global_quad_points_second;
{
- // how many elements are sent from which process?
+ // how many elements are sent from which process?
unsigned int n_my_elements = local_quad_points_second.size();
const unsigned int n_processes = Utilities::MPI::n_mpi_processes(mpi_communicator);
std::vector<int> n_elements (n_processes);
// at the corresponding points on the boundary with the second indicator
{
for (unsigned int i=0; i<global_quad_points_first.size(); i+=dim)
- {
- Vector<double> value_1(dim+1);
- Vector<double> value_2(dim+1);
-
- Point<dim> point_1, point_2;
- Vector<double> vector_point_1(dim);
- for (unsigned int c=0; c<dim; ++c)
{
- vector_point_1(c) = global_quad_points_first[i+c];
- point_1(c) = vector_point_1(c);
- }
- Vector<double> vector_point_2(dim);
- rot_matrix.Tvmult(vector_point_2, vector_point_1);
- for (unsigned int c=0; c<dim; ++c)
- point_2(c) = vector_point_2(c)+offset[c];
+ Vector<double> value_1(dim+1);
+ Vector<double> value_2(dim+1);
- get_point_value (point_1, 0, value_1);
- get_point_value (point_2, 0, value_2);
-
- if (Utilities::MPI::this_mpi_process(mpi_communicator)==0)
- {
- Vector<double> vel_value_1 (dim);
- Vector<double> vel_value_2 (dim);
- Vector<double> expected_vel (dim);
+ Point<dim> point_1, point_2;
+ Vector<double> vector_point_1(dim);
for (unsigned int c=0; c<dim; ++c)
- {
- vel_value_1(c) = value_1(c);
- vel_value_2(c) = value_2(c);
- }
- rot_matrix.Tvmult(expected_vel, vel_value_1);
- pcout << "Point 1: " << point_1 << "\t Point 2: " << point_2 << std::endl;
- Vector<double> error = expected_vel;
- error -= vel_value_2;
- if (std::abs(error.l2_norm())>1e-8)
- {
- pcout << "first first_rotated second" <<std::endl;
- for (unsigned int c=0; c<dim; ++c)
- pcout << vel_value_1(c) << "\t" << expected_vel(c) << "\t" << vel_value_2(c) << std::endl;
- pcout << std::endl;
- Assert(false, ExcInternalError());
- }
+ {
+ vector_point_1(c) = global_quad_points_first[i+c];
+ point_1(c) = vector_point_1(c);
+ }
+ Vector<double> vector_point_2(dim);
+ rot_matrix.Tvmult(vector_point_2, vector_point_1);
+ for (unsigned int c=0; c<dim; ++c)
+ point_2(c) = vector_point_2(c)+offset[c];
+
+ get_point_value (point_1, 0, value_1);
+ get_point_value (point_2, 0, value_2);
+
+ if (Utilities::MPI::this_mpi_process(mpi_communicator)==0)
+ {
+ Vector<double> vel_value_1 (dim);
+ Vector<double> vel_value_2 (dim);
+ Vector<double> expected_vel (dim);
+ for (unsigned int c=0; c<dim; ++c)
+ {
+ vel_value_1(c) = value_1(c);
+ vel_value_2(c) = value_2(c);
+ }
+ rot_matrix.Tvmult(expected_vel, vel_value_1);
+ pcout << "Point 1: " << point_1 << "\t Point 2: " << point_2 << std::endl;
+ Vector<double> error = expected_vel;
+ error -= vel_value_2;
+ if (std::abs(error.l2_norm())>1e-8)
+ {
+ pcout << "first first_rotated second" <<std::endl;
+ for (unsigned int c=0; c<dim; ++c)
+ pcout << vel_value_1(c) << "\t" << expected_vel(c) << "\t" << vel_value_2(c) << std::endl;
+ pcout << std::endl;
+ Assert(false, ExcInternalError());
+ }
+ }
}
- }
}
// consider points on the boundary with the second indicator
// at the corresponding points on the boundary with the first indicator
{
for (unsigned int i=0; i<global_quad_points_second.size(); i+=dim)
- {
- Vector<double> value_1(dim+1);
- Vector<double> value_2(dim+1);
-
- Point<dim> point_1, point_2;
- Vector<double> vector_point_1(dim);
- for (unsigned int c=0; c<dim; ++c)
{
- vector_point_1(c) = global_quad_points_second[i+c];
- point_1(c) = vector_point_1(c);
- }
- Vector<double> vector_point_2(dim);
- for (unsigned int c=0; c<dim; ++c)
- vector_point_1(c) -= offset[c];
- rot_matrix.vmult(vector_point_2, vector_point_1);
- for (unsigned int c=0; c<dim; ++c)
- point_2(c) = vector_point_2(c);
-
- get_point_value (point_1, 0, value_1);
- get_point_value (point_2, 0, value_2);
+ Vector<double> value_1(dim+1);
+ Vector<double> value_2(dim+1);
- if (Utilities::MPI::this_mpi_process(mpi_communicator)==0)
- {
- Vector<double> vel_value_1 (dim);
- Vector<double> vel_value_2 (dim);
- Vector<double> expected_vel (dim);
+ Point<dim> point_1, point_2;
+ Vector<double> vector_point_1(dim);
for (unsigned int c=0; c<dim; ++c)
- {
- vel_value_1(c) = value_1(c);
- vel_value_2(c) = value_2(c);
- }
- rot_matrix.vmult(expected_vel, vel_value_1);
- pcout << "Point 1: " << point_1 << "\t Point 2: " << point_2 << std::endl;
- Vector<double> error = expected_vel;
- error -= vel_value_2;
- if (std::abs(error.l2_norm())>1e-8)
- {
- pcout << "first first_rotated second" <<std::endl;
- for (unsigned int c=0; c<dim; ++c)
- pcout << vel_value_1(c) << "\t" << expected_vel(c) << "\t" << vel_value_2(c) << std::endl;
- pcout << std::endl;
- Assert(false, ExcInternalError());
- }
+ {
+ vector_point_1(c) = global_quad_points_second[i+c];
+ point_1(c) = vector_point_1(c);
+ }
+ Vector<double> vector_point_2(dim);
+ for (unsigned int c=0; c<dim; ++c)
+ vector_point_1(c) -= offset[c];
+ rot_matrix.vmult(vector_point_2, vector_point_1);
+ for (unsigned int c=0; c<dim; ++c)
+ point_2(c) = vector_point_2(c);
+
+ get_point_value (point_1, 0, value_1);
+ get_point_value (point_2, 0, value_2);
+
+ if (Utilities::MPI::this_mpi_process(mpi_communicator)==0)
+ {
+ Vector<double> vel_value_1 (dim);
+ Vector<double> vel_value_2 (dim);
+ Vector<double> expected_vel (dim);
+ for (unsigned int c=0; c<dim; ++c)
+ {
+ vel_value_1(c) = value_1(c);
+ vel_value_2(c) = value_2(c);
+ }
+ rot_matrix.vmult(expected_vel, vel_value_1);
+ pcout << "Point 1: " << point_1 << "\t Point 2: " << point_2 << std::endl;
+ Vector<double> error = expected_vel;
+ error -= vel_value_2;
+ if (std::abs(error.l2_norm())>1e-8)
+ {
+ pcout << "first first_rotated second" <<std::endl;
+ for (unsigned int c=0; c<dim; ++c)
+ pcout << vel_value_1(c) << "\t" << expected_vel(c) << "\t" << vel_value_2(c) << std::endl;
+ pcout << std::endl;
+ Assert(false, ExcInternalError());
+ }
+ }
}
- }
}
}
//
// Test parallel::distributed::Triangulation::add_periodicity
-// for correct behavior on non standard oriented meshes.
+// for correct behavior on non standard oriented meshes.
// This test case is similar to dof_tools_21_b.cc.
//
using namespace dealii;
-template <int dim>
+template <int dim>
void set_periodicity(parallel::distributed::Triangulation<dim> &triangulation, bool reverse)
{
typename Triangulation<dim>::cell_iterator cell_1 = triangulation.begin();
typename Triangulation<dim>::cell_iterator cell_2 = cell_1++;
typename Triangulation<dim>::face_iterator face_1;
typename Triangulation<dim>::face_iterator face_2;
-
+
// Look for the two outermost faces:
for (unsigned int j=0; j<GeometryInfo<dim>::faces_per_cell; ++j)
- {
- if (cell_1->face(j)->center()(dim-1) > 2.9)
- face_1 = cell_1->face(j);
- if (cell_2->face(j)->center()(dim-1) < -2.9)
- face_2 = cell_2->face(j);
- }
+ {
+ if (cell_1->face(j)->center()(dim-1) > 2.9)
+ face_1 = cell_1->face(j);
+ if (cell_2->face(j)->center()(dim-1) < -2.9)
+ face_2 = cell_2->face(j);
+ }
face_1->set_boundary_id(42);
face_2->set_boundary_id(43);
-
+
std::vector<GridTools::PeriodicFacePair<typename parallel::distributed::Triangulation<dim>::cell_iterator> >
periodicity_vector;
-
+
if (reverse)
GridTools::collect_periodic_faces (triangulation, 43, 42, dim-1, periodicity_vector);
else
GridTools::collect_periodic_faces (triangulation, 42, 43, dim-1, periodicity_vector);
-
+
triangulation.add_periodicity(periodicity_vector);
-
+
triangulation.refine_global(3);
}
triangulation.create_triangulation(vertices, cells, SubCellData());
}
-
+
/* The 3D case */
triangulation.create_triangulation(vertices, cells, SubCellData());
}
-template<int dim>
+template<int dim>
void check
- (const unsigned int orientation,
- bool reverse)
+(const unsigned int orientation,
+ bool reverse)
{
dealii::parallel::distributed::Triangulation<dim> triangulation (MPI_COMM_WORLD);
IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();
IndexSet locally_relevant_dofs;
DoFTools::extract_locally_relevant_dofs (dof_handler, locally_relevant_dofs);
-
+
constraints.reinit(locally_relevant_dofs);
{
std::vector<GridTools::PeriodicFacePair<typename DoFHandler<dim>::cell_iterator> >
- periodicity_vector;
+ periodicity_vector;
GridTools::collect_periodic_faces (dof_handler, 42, 43, dim-1, periodicity_vector);
DoFTools::make_periodicity_constraints<DoFHandler<dim> >
- (periodicity_vector, constraints);
+ (periodicity_vector, constraints);
}
constraints.close ();
IndexSet constraints_lines = constraints.get_local_lines();
for (unsigned int i=0; i<constraints_lines.n_elements(); ++i)
- {
- const unsigned int line = constraints_lines.nth_index_in_set(i);
- if (constraints.is_constrained(line))
{
- const std::vector<std::pair<types::global_dof_index, double > >* entries
- = constraints.get_constraint_entries(line);
- Assert(entries->size()==1, ExcInternalError());
- const Point<dim> point1 = support_points[line];
- const Point<dim> point2 = support_points[(*entries)[0].first];
- Tensor<1, dim> difference = point1-point2;
- difference[dim-1] = 0.;
- AssertThrow(difference.norm()<1.e-9, ExcInternalError());
- if (locally_owned_dofs.is_element(line))
- ++n_local_constraints;
+ const unsigned int line = constraints_lines.nth_index_in_set(i);
+ if (constraints.is_constrained(line))
+ {
+ const std::vector<std::pair<types::global_dof_index, double > > *entries
+ = constraints.get_constraint_entries(line);
+ Assert(entries->size()==1, ExcInternalError());
+ const Point<dim> point1 = support_points[line];
+ const Point<dim> point2 = support_points[(*entries)[0].first];
+ Tensor<1, dim> difference = point1-point2;
+ difference[dim-1] = 0.;
+ AssertThrow(difference.norm()<1.e-9, ExcInternalError());
+ if (locally_owned_dofs.is_element(line))
+ ++n_local_constraints;
+ }
}
- }
- const unsigned int n_constraints
+ const unsigned int n_constraints
= Utilities::MPI::sum(n_local_constraints, MPI_COMM_WORLD);
const unsigned int n_expected_constraints = Utilities::fixed_int_power<9,dim-1>::value;
if (myid==0)
- deallog << "n_constraints: " << n_constraints
+ deallog << "n_constraints: " << n_constraints
<< " n_expected_constraints: " << n_expected_constraints
<< std::endl;
- AssertThrow(n_constraints == n_expected_constraints,
+ AssertThrow(n_constraints == n_expected_constraints,
ExcDimensionMismatch(n_constraints, n_expected_constraints));
}
-
+
int main (int argc, char *argv[])
{
try
{
deallog << "Test for 2D" << std::endl << std::endl;
for (int i = 0; i < 2; ++i)
- {
- deallog << "Triangulation: " << i << std::endl;
- check<2> (i, false);
- check<2> (i, true);
- }
-
+ {
+ deallog << "Triangulation: " << i << std::endl;
+ check<2> (i, false);
+ check<2> (i, true);
+ }
+
deallog << "Test for 3D" << std::endl << std::endl;
for (int i = 0; i < 8; ++i)
- {
- // Generate a triangulation and match:
- deallog << "Triangulation: " << i << std::endl;
- check<3> (i, false);
- check<3> (i, true);
- }
+ {
+ // Generate a triangulation and match:
+ deallog << "Triangulation: " << i << std::endl;
+ check<3> (i, false);
+ check<3> (i, true);
+ }
}
}
catch (std::exception &exc)
void test()
{
parallel::distributed::Triangulation<dim> triangulation(MPI_COMM_WORLD);
-
+
FE_Q<dim> fe(1);
-
+
DoFHandler<dim> dof_handler (triangulation);
-
+
GridGenerator::hyper_cube(triangulation);
triangulation.refine_global (1);
-
+
dof_handler.distribute_dofs (fe);
IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs ();
parallel::distributed::Vector<double> locally_owned_solution
- (locally_owned_dofs, MPI_COMM_WORLD);
+ (locally_owned_dofs, MPI_COMM_WORLD);
locally_owned_solution=1;
Vector<double> value(1);
- for(; point_iterator!=points_end; point_iterator++)
- {
- try
+ for (; point_iterator!=points_end; point_iterator++)
{
- VectorTools::point_value (dof_handler, locally_owned_solution,
- *point_iterator, value);
- if (std::abs(value[0]-1.)>1e-8)
- ExcInternalError();
+ try
+ {
+ VectorTools::point_value (dof_handler, locally_owned_solution,
+ *point_iterator, value);
+ if (std::abs(value[0]-1.)>1e-8)
+ ExcInternalError();
+ }
+ catch (const VectorTools::ExcPointNotAvailableHere &)
+ {}
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
+ deallog << *point_iterator << " OK" << std::endl;
}
- catch (const VectorTools::ExcPointNotAvailableHere &)
- {}
-
- MPI_Barrier(MPI_COMM_WORLD);
-
- if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
- deallog << *point_iterator << " OK" << std::endl;
- }
}
int main(int argc, char *argv[])
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);
-
+
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
if (myid == 0)
- {
- std::ofstream logfile("output");
- deallog.attach(logfile, false);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- deallog.push("2d");
- test<2>();
- deallog.pop();
- deallog.push("3d");
- test<3>();
- deallog.pop();
- }
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile, false);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ deallog.push("2d");
+ test<2>();
+ deallog.pop();
+ deallog.push("3d");
+ test<3>();
+ deallog.pop();
+ }
else
- {
- test<2>();
- test<3>();
- }
+ {
+ test<2>();
+ test<3>();
+ }
return 0;
}
subdivisions[0] = 120;
subdivisions[1] = 1;
GridGenerator::subdivided_hyper_rectangle (triangulation,
- subdivisions,
- Point<2>(),
- Point<2>(1,1));
+ subdivisions,
+ Point<2>(),
+ Point<2>(1,1));
// initialize the refinement indicators with a set of particular values from the original
// testcase
const double values[] =
- {
- 1.48589e-08,
- 3.31859e-06,
- 3.31859e-06,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 0.0025918,
- 3.31859e-06,
- 1.48589e-08,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 1.48589e-08,
- 3.31859e-06,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 0.0025918,
- 3.31859e-06,
- 3.31859e-06,
- 1.48589e-08,
- 0.0025918,
- 0.0025918,
- 3.31859e-06,
- 3.31859e-06,
- 0.0025918,
- 0.0025918,
- 1.48589e-08,
- 3.31859e-06,
- 3.31859e-06,
- 0.0025918,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 3.31859e-06,
- 1.48589e-08,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 1.48589e-08,
- 3.31859e-06,
- 0.0025918,
- 0.0025918,
- 3.31859e-06,
- 0.0025918,
- 3.31859e-06,
- 3.31859e-06,
- 1.48589e-08,
- 0.0120662,
- 0.0446999,
- 0.0446999,
- 0.0644361,
- 0.0446999,
- 0.0644361,
- 0.0644361,
- 3.14051,
- 0.0446999,
- 0.0120662,
- 0.0644361,
- 0.0446999,
- 0.0644361,
- 0.0446999,
- 3.14051,
- 0.0644361,
- 0.0446999,
- 0.0644361,
- 0.0120662,
- 0.0446999,
- 0.0644361,
- 3.14051,
- 0.0446999,
- 0.0644361,
- 0.0644361,
- 0.0446999,
- 0.0446999,
- 0.0120662,
- 3.14051,
- 0.0644361,
- 0.0644361,
- 0.0446999,
- 0.0446999,
- 0.0644361,
- 0.0644361,
- 3.14051,
- 0.0120662,
- 0.0446999,
- 0.0446999,
- 0.0644361,
- 0.0644361,
- 0.0446999,
- 3.14051,
- 0.0644361,
- 0.0446999,
- 0.0120662,
- 0.0644361,
- 0.0446999,
- 0.0644361,
- 3.14051,
- 0.0446999,
- 0.0644361,
- 0.0446999,
- 0.0644361,
- 0.0120662,
- 0.0446999,
- 3.14051,
- 0.0644361,
- 0.0644361,
- 0.0446999,
- 0.0644361,
- 0.0446999,
- 0.0446999,
- 0.0120662
- };
-
+ {
+ 1.48589e-08,
+ 3.31859e-06,
+ 3.31859e-06,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 0.0025918,
+ 3.31859e-06,
+ 1.48589e-08,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 1.48589e-08,
+ 3.31859e-06,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 0.0025918,
+ 3.31859e-06,
+ 3.31859e-06,
+ 1.48589e-08,
+ 0.0025918,
+ 0.0025918,
+ 3.31859e-06,
+ 3.31859e-06,
+ 0.0025918,
+ 0.0025918,
+ 1.48589e-08,
+ 3.31859e-06,
+ 3.31859e-06,
+ 0.0025918,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 3.31859e-06,
+ 1.48589e-08,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 1.48589e-08,
+ 3.31859e-06,
+ 0.0025918,
+ 0.0025918,
+ 3.31859e-06,
+ 0.0025918,
+ 3.31859e-06,
+ 3.31859e-06,
+ 1.48589e-08,
+ 0.0120662,
+ 0.0446999,
+ 0.0446999,
+ 0.0644361,
+ 0.0446999,
+ 0.0644361,
+ 0.0644361,
+ 3.14051,
+ 0.0446999,
+ 0.0120662,
+ 0.0644361,
+ 0.0446999,
+ 0.0644361,
+ 0.0446999,
+ 3.14051,
+ 0.0644361,
+ 0.0446999,
+ 0.0644361,
+ 0.0120662,
+ 0.0446999,
+ 0.0644361,
+ 3.14051,
+ 0.0446999,
+ 0.0644361,
+ 0.0644361,
+ 0.0446999,
+ 0.0446999,
+ 0.0120662,
+ 3.14051,
+ 0.0644361,
+ 0.0644361,
+ 0.0446999,
+ 0.0446999,
+ 0.0644361,
+ 0.0644361,
+ 3.14051,
+ 0.0120662,
+ 0.0446999,
+ 0.0446999,
+ 0.0644361,
+ 0.0644361,
+ 0.0446999,
+ 3.14051,
+ 0.0644361,
+ 0.0446999,
+ 0.0120662,
+ 0.0644361,
+ 0.0446999,
+ 0.0644361,
+ 3.14051,
+ 0.0446999,
+ 0.0644361,
+ 0.0446999,
+ 0.0644361,
+ 0.0120662,
+ 0.0446999,
+ 3.14051,
+ 0.0644361,
+ 0.0644361,
+ 0.0446999,
+ 0.0644361,
+ 0.0446999,
+ 0.0446999,
+ 0.0120662
+ };
+
Vector<double> estimated_error_per_cell(&values[0],
- &values[0] + 120);
-
+ &values[0] + 120);
+
deallog << "Number of cells before refinement: " << triangulation.n_active_cells()
- << std::endl;
-
+ << std::endl;
+
parallel::distributed::GridRefinement::
- refine_and_coarsen_fixed_fraction (triangulation,
- estimated_error_per_cell,
- 0.3, 0.0);
+ refine_and_coarsen_fixed_fraction (triangulation,
+ estimated_error_per_cell,
+ 0.3, 0.0);
triangulation.execute_coarsening_and_refinement ();
-
+
deallog << "Number of cells after refinement: " << triangulation.n_active_cells()
- << std::endl;
+ << std::endl;
}
if (true)
{
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim,dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim,dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::hyper_cube(tr);
tr.refine_global(2);
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
//tr.write_mesh_vtk("a");
-
+
tr.repartition();
-
+
//tr.write_mesh_vtk("b");
-
+
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
-
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
+
const unsigned int checksum = tr.get_checksum ();
if (myid == 0)
deallog << "Checksum: "
template<int dim>
void pack_function (const typename parallel::distributed::Triangulation<dim,dim>::cell_iterator &cell,
const typename parallel::distributed::Triangulation<dim,dim>::CellStatus status,
- void *data)
+ void *data)
{
static int some_number = cell->index();
deallog << "packing cell " << cell->id() << " with data=" << some_number << " status=";
{
Assert(!cell->has_children(), ExcInternalError());
}
-
- int * intdata = reinterpret_cast<int*>(data);
+
+ int *intdata = reinterpret_cast<int *>(data);
*intdata = some_number;
++some_number;
template<int dim>
void unpack_function (const typename parallel::distributed::Triangulation<dim,dim>::cell_iterator &cell,
- const typename parallel::distributed::Triangulation<dim,dim>::CellStatus status,
- const void *data)
+ const typename parallel::distributed::Triangulation<dim,dim>::CellStatus status,
+ const void *data)
{
- const int * intdata = reinterpret_cast<const int*>(data);
+ const int *intdata = reinterpret_cast<const int *>(data);
deallog << "unpacking cell " << cell->id() << " with data=" << (*intdata) << " status=";
if (status==parallel::distributed::Triangulation<dim,dim>::CELL_PERSIST)
deallog << "PERSIST";
else if (status==parallel::distributed::Triangulation<dim,dim>::CELL_REFINE)
- deallog << "REFINE";
+ deallog << "REFINE";
else if (status==parallel::distributed::Triangulation<dim,dim>::CELL_COARSEN)
deallog << "COARSEN";
deallog << std::endl;
if (true)
{
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim,dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim,dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::hyper_cube(tr);
tr.refine_global(1);
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
+
+ deallog << "* global refine:" << std::endl;
- deallog << "* global refine:" << std::endl;
-
unsigned int offset = tr.register_data_attach(sizeof(int), pack_function<dim>);
-
+
tr.refine_global(1);
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
+
+ tr.notify_ready_to_unpack(offset, unpack_function<dim>);
- tr.notify_ready_to_unpack(offset, unpack_function<dim>);
-
//tr.write_mesh_vtk("a");
-
+
deallog << "* repartition:" << std::endl;
-
+
offset = tr.register_data_attach(sizeof(int), pack_function<dim>);
tr.repartition();
-
+
//tr.write_mesh_vtk("b");
-
+
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
+
+ tr.notify_ready_to_unpack(offset, unpack_function<dim>);
- tr.notify_ready_to_unpack(offset, unpack_function<dim>);
-
const unsigned int checksum = tr.get_checksum ();
if (myid == 0)
deallog << "Checksum: "
#include <fstream>
template<int dim>
-void print_cells(parallel::distributed::Triangulation<dim> & tr)
+void print_cells(parallel::distributed::Triangulation<dim> &tr)
{
for (typename Triangulation<dim>::active_cell_iterator
- cell = tr.begin_active();
+ cell = tr.begin_active();
cell != tr.end(); ++cell)
if (cell->is_locally_owned())
deallog << cell->id() << std::endl;
if (true)
{
parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD,
- dealii::Triangulation<dim,dim>::none,
- parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
+ dealii::Triangulation<dim,dim>::none,
+ parallel::distributed::Triangulation<dim>::no_automatic_repartitioning);
GridGenerator::hyper_cube(tr);
tr.refine_global(2);
deallog << "*** 1. everything on one core:" << std::endl;
-
+
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
print_cells(tr);
-
+
deallog << "*** 2. repartition:" << std::endl;
tr.repartition();
-
+
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
print_cells(tr);
deallog << "*** 3. repartition again (noop):" << std::endl;
tr.repartition();
-
+
deallog << "locally owned cells: " << tr.n_locally_owned_active_cells()
- << " / "
- << tr.n_global_active_cells()
- << std::endl;
+ << " / "
+ << tr.n_global_active_cells()
+ << std::endl;
print_cells(tr);
-
+
const unsigned int checksum = tr.get_checksum ();
if (myid == 0)
deallog << "Checksum: "
SolverControl coarse_solver_control (1000, 1e-10, false, false);
SolverCG<TrilinosWrappers::MPI::Vector> coarse_solver(coarse_solver_control);
PreconditionIdentity identity;
- TrilinosWrappers::SparseMatrix & coarse_matrix = mg_matrix[0];
+ TrilinosWrappers::SparseMatrix &coarse_matrix = mg_matrix[0];
MGCoarseGridLACIteration<SolverCG<TrilinosWrappers::MPI::Vector>,TrilinosWrappers::MPI::Vector>
coarse_grid_solver(coarse_solver, coarse_matrix, identity);
// assemble all faces adjacent to ghost cells to get the full
// information for all own cells without communication
lctrl.faces_to_ghost = MeshWorker::LoopControl::both;
-
+
MeshWorker::integration_loop<dim, dim> (
- dof_handler.begin_active(), dof_handler.end(),
+ dof_handler.begin_active(), dof_handler.end(),
dof_info, info_box,
integrator, assembler, lctrl);
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
MPILogInitAll log;
-
+
try
{
FE_DGQ<2> fe1(2);
// check correct behavior of sadd of Trilinos vectors
-// if they have different Epetra maps
+// if they have different Epetra maps
#include "../tests.h"
#include <deal.II/base/utilities.h>
const int local_begin = std::max(0, begin_index-entries_per_process/2);
const int local_end = entries_per_process*n_proc;
locally_relevant.add_range (local_begin, local_end);
-
+
TrilinosWrappers::MPI::Vector ghosted, distributed;
distributed.reinit(locally_owned, MPI_COMM_WORLD);
ghosted.reinit (locally_owned, locally_relevant, MPI_COMM_WORLD);
{
deallog << "Distributed:" << std::endl;
for (unsigned int i=begin_index; i<end_index; ++i)
- deallog << i << ": " << distributed(i) << std::endl;
-
+ deallog << i << ": " << distributed(i) << std::endl;
+
deallog << "Ghosted:" << std::endl;
for (unsigned int i=local_begin; i<local_end; ++i)
- deallog << i << ": " << ghosted(i) << std::endl;
+ deallog << i << ": " << ghosted(i) << std::endl;
}
// verify correct value
for (unsigned int i=begin_index; i<end_index; ++i)
Assert(distributed(i)==3, ExcInternalError());
-
+
for (unsigned int i=local_begin; i<local_end; ++i)
Assert(ghosted(i)==3, ExcInternalError());
}
int main (int argc, char **argv)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
-
+
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
deallog.push(Utilities::int_to_string(myid));
-
+
if (myid == 0)
- {
- std::ofstream logfile("output");
- deallog.attach(logfile);
- deallog << std::setprecision(4);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- test();
- }
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog << std::setprecision(4);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test();
+ }
else
test();
-
+
}
// check correct behaviour of sadd of Trilinos vectors
-// if they have different Epetra maps
+// if they have different Epetra maps
#include "../tests.h"
#include <deal.II/base/utilities.h>
locally_owned.add_range(begin_index, end_index);
locally_relevant.add_range
- (local_begin, local_end);
-
+ (local_begin, local_end);
+
distributed.reinit(locally_owned, MPI_COMM_WORLD);
distributed2.reinit(locally_owned, MPI_COMM_WORLD);
ghosted.reinit (locally_owned, locally_relevant, MPI_COMM_WORLD);
int main (int argc, char **argv)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
-
+
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
deallog.push(Utilities::int_to_string(myid));
-
+
if (myid == 0)
- {
- std::ofstream logfile("output");
- deallog.attach(logfile);
- deallog << std::setprecision(4);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- test();
- }
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog << std::setprecision(4);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test();
+ }
else
test();
-
+
}
// check correct behaviour of sadd of Trilinos vectors
-// if there are processes that doesn't own anything
+// if there are processes that doesn't own anything
#include "../tests.h"
#include <deal.II/base/utilities.h>
const unsigned int local_end = entries_per_process*(n_proc-1);
if (my_id != n_proc-1)
- {
- locally_owned.add_range(begin_index, end_index);
- locally_relevant.add_range(local_begin, local_end);
- }
-
+ {
+ locally_owned.add_range(begin_index, end_index);
+ locally_relevant.add_range(local_begin, local_end);
+ }
+
distributed.reinit(locally_owned, MPI_COMM_WORLD);
distributed2.reinit(locally_owned, MPI_COMM_WORLD);
ghosted.reinit (locally_owned, locally_relevant, MPI_COMM_WORLD);
int main (int argc, char **argv)
{
Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, testing_max_num_threads());
-
+
unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD);
deallog.push(Utilities::int_to_string(myid));
-
+
if (myid == 0)
- {
- std::ofstream logfile("output");
- deallog.attach(logfile);
- deallog << std::setprecision(4);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- test();
- }
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog << std::setprecision(4);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test();
+ }
else
test();
-
+
}
{
// should be { [0, 2), [2, n_rows) }
if (my_id == 0)
- locally_owned.add_range(0, 2);
+ locally_owned.add_range(0, 2);
else if (my_id == 1)
- locally_owned.add_range(2, n_rows);
+ locally_owned.add_range(2, n_rows);
}
else
Assert (false, ExcNotImplemented());
A.reinit (sp);
TrilinosWrappers::SparseMatrix B;
B.reinit (A);
-
+
A.add(0, 0, 0.1);
A.add(0, 2, 0.2);
if ((n_procs == 1) || (my_id == 1))
- A.add(2,3, 0.3);
+ A.add(2,3, 0.3);
double l1a = (n_procs==1) ? 0.3 : 0.4;
double l1b = n_procs*1.2;
-
+
A.compress(VectorOperation::add);
deallog << "1: " << A.l1_norm() << " " << B.l1_norm()
- << " (should be " << l1a << " 0.0)" << std::endl;
+ << " (should be " << l1a << " 0.0)" << std::endl;
deallog << "set B=A..." << std::endl;
-
- B.copy_from(A);
-
+
+ B.copy_from(A);
+
deallog << "2: " << A.l1_norm() << " " << B.l1_norm()
- << " (should be " << l1a << " " << l1a << ")" << std::endl;
+ << " (should be " << l1a << " " << l1a << ")" << std::endl;
if (my_id==0)
{
}
deallog << "reassemble A..." << std::endl;
-
+
A = 0;
A.add(0, 0, -1.2);
A.compress(VectorOperation::add);
deallog << "3: " << A.l1_norm() << " " << B.l1_norm()
- << " (should be " << l1b << " " << l1a << ")" << std::endl;
-
+ << " (should be " << l1b << " " << l1a << ")" << std::endl;
+
if (my_id==0)
{
deallog << "A(0,0)=" << A(0,0) << std::endl;
if (my_id == 0)
{
for (TrilinosWrappers::SparseMatrix::iterator p=A.begin(0);
- p != A.end(0);
- ++p)
- {
- AssertThrow (p->row() == 0, ExcInternalError());
- if (p->column() == 0)
- AssertThrow (p->value() == 0.1, ExcInternalError())
- else if (p->column() == 2)
- AssertThrow (p->value() == 0.2, ExcInternalError())
- else
- // well, we didn't write here, so the only thing that
- // should be in there is a zero
- AssertThrow (p->value() == 0.0, ExcInternalError());
- }
+ p != A.end(0);
+ ++p)
+ {
+ AssertThrow (p->row() == 0, ExcInternalError());
+ if (p->column() == 0)
+ AssertThrow (p->value() == 0.1, ExcInternalError())
+ else if (p->column() == 2)
+ AssertThrow (p->value() == 0.2, ExcInternalError())
+ else
+ // well, we didn't write here, so the only thing that
+ // should be in there is a zero
+ AssertThrow (p->value() == 0.0, ExcInternalError());
+ }
}
else
{
for (TrilinosWrappers::SparseMatrix::iterator p=A.begin(2);
- p != A.end(2);
- ++p)
- {
- AssertThrow (p->row() == 2, ExcInternalError());
- if (p->column() == 3)
- AssertThrow (p->value() == 0.3, ExcInternalError())
- else
- // well, we didn't write here, so the only thing that
- // should be in there is a zero
- AssertThrow (p->value() == 0.0, ExcInternalError());
- }
+ p != A.end(2);
+ ++p)
+ {
+ AssertThrow (p->row() == 2, ExcInternalError());
+ if (p->column() == 3)
+ AssertThrow (p->value() == 0.3, ExcInternalError())
+ else
+ // well, we didn't write here, so the only thing that
+ // should be in there is a zero
+ AssertThrow (p->value() == 0.0, ExcInternalError());
+ }
}
// now let each of the processors write something into the memory of
{
A.set (2, 3, 42.);
for (TrilinosWrappers::SparseMatrix::iterator p=A.begin(0);
- p != A.end(0);
- ++p)
- {
- AssertThrow (p->row() == 0, ExcInternalError());
- if (p->column() == 0)
- AssertThrow (p->value() == 0.1, ExcInternalError())
- else if (p->column() == 2)
- AssertThrow (p->value() == 0.2, ExcInternalError())
- else
- // well, we didn't write here, so the only thing that
- // should be in there is a zero
- AssertThrow (p->value() == 0.0, ExcInternalError());
- }
+ p != A.end(0);
+ ++p)
+ {
+ AssertThrow (p->row() == 0, ExcInternalError());
+ if (p->column() == 0)
+ AssertThrow (p->value() == 0.1, ExcInternalError())
+ else if (p->column() == 2)
+ AssertThrow (p->value() == 0.2, ExcInternalError())
+ else
+ // well, we didn't write here, so the only thing that
+ // should be in there is a zero
+ AssertThrow (p->value() == 0.0, ExcInternalError());
+ }
}
else
{
A.set (0, 0, 108.);
for (TrilinosWrappers::SparseMatrix::iterator p=A.begin(2);
- p != A.end(2);
- ++p)
- {
- AssertThrow (p->row() == 2, ExcInternalError());
- if (p->column() == 3)
- AssertThrow (p->value() == 0.3, ExcInternalError())
- else
- // well, we didn't write here, so the only thing that
- // should be in there is a zero
- AssertThrow (p->value() == 0.0, ExcInternalError());
- }
+ p != A.end(2);
+ ++p)
+ {
+ AssertThrow (p->row() == 2, ExcInternalError());
+ if (p->column() == 3)
+ AssertThrow (p->value() == 0.3, ExcInternalError())
+ else
+ // well, we didn't write here, so the only thing that
+ // should be in there is a zero
+ AssertThrow (p->value() == 0.0, ExcInternalError());
+ }
}
// then call compress() and ensure that we get the correct values
if (my_id == 0)
{
for (TrilinosWrappers::SparseMatrix::iterator p=A.begin(0);
- p != A.end(0);
- ++p)
- {
- AssertThrow (p->row() == 0, ExcInternalError());
- if (p->column() == 0)
- AssertThrow (p->value() == 108, ExcInternalError())
- else if (p->column() == 2)
- AssertThrow (p->value() == 0.2, ExcInternalError())
- else
- // well, we didn't write here, so the only thing that
- // should be in there is a zero
- AssertThrow (p->value() == 0.0, ExcInternalError());
- }
+ p != A.end(0);
+ ++p)
+ {
+ AssertThrow (p->row() == 0, ExcInternalError());
+ if (p->column() == 0)
+ AssertThrow (p->value() == 108, ExcInternalError())
+ else if (p->column() == 2)
+ AssertThrow (p->value() == 0.2, ExcInternalError())
+ else
+ // well, we didn't write here, so the only thing that
+ // should be in there is a zero
+ AssertThrow (p->value() == 0.0, ExcInternalError());
+ }
}
else
{
for (TrilinosWrappers::SparseMatrix::iterator p=A.begin(2);
- p != A.end(2);
- ++p)
- {
- AssertThrow (p->row() == 2, ExcInternalError());
- if (p->column() == 3)
- AssertThrow (p->value() == 42, ExcInternalError())
- else
- // well, we didn't write here, so the only thing that
- // should be in there is a zero
- AssertThrow (p->value() == 0.0, ExcInternalError());
- }
- }
-
+ p != A.end(2);
+ ++p)
+ {
+ AssertThrow (p->row() == 2, ExcInternalError());
+ if (p->column() == 3)
+ AssertThrow (p->value() == 42, ExcInternalError())
+ else
+ // well, we didn't write here, so the only thing that
+ // should be in there is a zero
+ AssertThrow (p->value() == 0.0, ExcInternalError());
+ }
+ }
+
if (my_id == 0)
deallog << "OK" << std::endl;
}
++p)
if (my_id == 0)
{
- deallog << "Looking at entry (" << p->row() << ','
- << p->column() << ") with value "
- << p->value()
- << std::endl;
- AssertThrow (p->row() == 0, ExcInternalError());
+ deallog << "Looking at entry (" << p->row() << ','
+ << p->column() << ") with value "
+ << p->value()
+ << std::endl;
+ AssertThrow (p->row() == 0, ExcInternalError());
}
else
{
- AssertThrow (p->row() == 2, ExcInternalError());
- }
-
+ AssertThrow (p->row() == 2, ExcInternalError());
+ }
+
if (my_id == 0)
deallog << "OK" << std::endl;
}
A.compress(VectorOperation::insert);
const TrilinosWrappers::SparseMatrix &B = A;
-
+
// now access elements by iterator. ensure that we can iterate over
// all rows but that iterators into rows not stored locally just
// look empty
++p)
if (my_id == 0)
{
- deallog << "Looking at entry (" << p->row() << ','
- << p->column() << ") with value "
- << p->value()
- << std::endl;
- AssertThrow (p->row() == 0, ExcInternalError());
+ deallog << "Looking at entry (" << p->row() << ','
+ << p->column() << ") with value "
+ << p->value()
+ << std::endl;
+ AssertThrow (p->row() == 0, ExcInternalError());
}
else
{
- AssertThrow (p->row() == 2, ExcInternalError());
- }
-
+ AssertThrow (p->row() == 2, ExcInternalError());
+ }
+
if (my_id == 0)
deallog << "OK" << std::endl;
}
try
{
if (myid == 0)
- {
- std::ofstream logfile("output");
- deallog.attach(logfile);
- deallog << std::setprecision(4);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- test();
- }
+ {
+ std::ofstream logfile("output");
+ deallog.attach(logfile);
+ deallog << std::setprecision(4);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ test();
+ }
else
- test();
+ test();
}
catch (const char *p)
{
MGTransferPrebuilt<Vector<double> > transfer_renumbered(hnc_renumbered, mg_constrained_dofs_renumbered);
transfer_renumbered.build_matrices(mgdof_renumbered);
-
+
// Fill vector u with some cell based numbering
Vector<double> u(mgdof.n_dofs());
initialize(mgdof,u);
MGLevelObject<Vector<double> > v(0, tr.n_levels()-1);
reinit_vector(mgdof, v);
-
+
// Copy u to a multigrid vector and print
transfer.copy_to_mg(mgdof, v, u);
print(mgdof, v);
-
+
// Forget everything so far and fill v with a cell based
// numbering. Prolongate from coarse grid up and transfer to u.
u=0;
transfer.copy_from_mg(mgdof, u, v);
Vector<double> diff = u;
-
+
// Do the same for the renumbered mesh
initialize(mgdof_renumbered,u);
reinit_vector(mgdof_renumbered, v);
transfer_renumbered.copy_to_mg(mgdof_renumbered, v, u);
deallog << "copy_to_mg" << std::endl;
print(mgdof_renumbered, v);
-
+
// Prolongate up from coarse mesh and make sure the result does not
// depend on numbering
u=0;
DoFHandler<dim> mg_dof_handler_renumbered;
const unsigned int degree;
- std::vector<std::set<types::global_dof_index> >
+ std::vector<std::set<types::global_dof_index> >
boundary_indices, boundary_indices_renumbered;
};
initlog(__FILE__);
{
- FESystem<1> fe(FE_Q<1>(1), 1, FE_DGQ<1>(0), 1);
- check<1> (fe);
+ FESystem<1> fe(FE_Q<1>(1), 1, FE_DGQ<1>(0), 1);
+ check<1> (fe);
}
{
- FESystem<2> fe(FE_RaviartThomas<2>(0),1, FE_DGQ<2>(0), 1);
- check<2> (fe);
+ FESystem<2> fe(FE_RaviartThomas<2>(0),1, FE_DGQ<2>(0), 1);
+ check<2> (fe);
}
{
- FESystem<2> fe(FE_Q<2>(1), 1, FE_DGQ<2>(0), 1);
- check<2> (fe);
+ FESystem<2> fe(FE_Q<2>(1), 1, FE_DGQ<2>(0), 1);
+ check<2> (fe);
}
{
- FESystem<3> fe(FE_Q<3>(1), 1, FE_DGQ<3>(0), 1);
- check<3> (fe);
+ FESystem<3> fe(FE_Q<3>(1), 1, FE_DGQ<3>(0), 1);
+ check<3> (fe);
}
deallog << "OK" << endl;
{
public:
LaplaceMatrix();
- virtual void cell(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const;
- virtual void boundary(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const;
- virtual void face(MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
- MeshWorker::IntegrationInfo<dim>& info1, MeshWorker::IntegrationInfo<dim>& info2) const;
+ virtual void cell(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const;
+ virtual void boundary(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const;
+ virtual void face(MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+ MeshWorker::IntegrationInfo<dim> &info1, MeshWorker::IntegrationInfo<dim> &info2) const;
};
template <int dim>
LaplaceMatrix<dim>::LaplaceMatrix()
- :
- MeshWorker::LocalIntegrator<dim>(true, false, false)
+ :
+ MeshWorker::LocalIntegrator<dim>(true, false, false)
{}
template <int dim>
-void LaplaceMatrix<dim>::cell(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const
+void LaplaceMatrix<dim>::cell(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const
{
- AssertDimension (dinfo.n_matrices(), 1);
+ AssertDimension (dinfo.n_matrices(), 1);
Laplace::cell_matrix(dinfo.matrix(0,false).matrix, info.fe_values(0));
}
template <int dim>
-void LaplaceMatrix<dim>::boundary(MeshWorker::DoFInfo<dim>& /*dinfo*/,
- typename MeshWorker::IntegrationInfo<dim>& /*info*/) const
+void LaplaceMatrix<dim>::boundary(MeshWorker::DoFInfo<dim> & /*dinfo*/,
+ typename MeshWorker::IntegrationInfo<dim> & /*info*/) const
{
// const unsigned int deg = info.fe_values(0).get_fe().tensor_degree();
// Laplace::nitsche_matrix(dinfo.matrix(0,false).matrix, info.fe_values(0),
-// Laplace::compute_penalty(dinfo, dinfo, deg, deg));
+// Laplace::compute_penalty(dinfo, dinfo, deg, deg));
}
template <int dim>
void LaplaceMatrix<dim>::face(
- MeshWorker::DoFInfo<dim>& /*dinfo1*/, MeshWorker::DoFInfo<dim>& /*dinfo2*/,
- MeshWorker::IntegrationInfo<dim>& /*info1*/, MeshWorker::IntegrationInfo<dim>& /*info2*/) const
+ MeshWorker::DoFInfo<dim> & /*dinfo1*/, MeshWorker::DoFInfo<dim> & /*dinfo2*/,
+ MeshWorker::IntegrationInfo<dim> & /*info1*/, MeshWorker::IntegrationInfo<dim> & /*info2*/) const
{
// const unsigned int deg = info1.fe_values(0).get_fe().tensor_degree();
-// Laplace::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
-// dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
-// info1.fe_values(0), info2.fe_values(0),
-// Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
+// Laplace::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
+// dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
+// info1.fe_values(0), info2.fe_values(0),
+// Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
}
template <int dim>
void assemble_system ();
void assemble_multigrid (const bool &use_mw);
void solve ();
- void refine_grid (const std::string& reftype);
+ void refine_grid (const std::string &reftype);
void output_results (const unsigned int cycle) const;
Triangulation<dim> triangulation;
// if (p.square() < 0.5*0.5)
// return 20;
// else
- return 1;
+ return 1;
}
template <int dim>
-void LaplaceProblem<dim>::assemble_multigrid (const bool& use_mw)
+void LaplaceProblem<dim>::assemble_multigrid (const bool &use_mw)
{
- if(use_mw == true)
- {
- mg_matrices = 0.;
+ if (use_mw == true)
+ {
+ mg_matrices = 0.;
- MappingQ1<dim> mapping;
- MeshWorker::IntegrationInfoBox<dim> info_box;
- UpdateFlags update_flags = update_values | update_gradients | update_hessians;
- info_box.add_update_flags_all(update_flags);
- info_box.initialize(fe, mapping);
+ MappingQ1<dim> mapping;
+ MeshWorker::IntegrationInfoBox<dim> info_box;
+ UpdateFlags update_flags = update_values | update_gradients | update_hessians;
+ info_box.add_update_flags_all(update_flags);
+ info_box.initialize(fe, mapping);
- MeshWorker::DoFInfo<dim> dof_info(mg_dof_handler);
+ MeshWorker::DoFInfo<dim> dof_info(mg_dof_handler);
- MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > assembler;
- assembler.initialize(mg_constrained_dofs);
- assembler.initialize(mg_matrices);
- assembler.initialize_interfaces(mg_interface_in, mg_interface_out);
+ MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > assembler;
+ assembler.initialize(mg_constrained_dofs);
+ assembler.initialize(mg_matrices);
+ assembler.initialize_interfaces(mg_interface_in, mg_interface_out);
- MeshWorker::integration_loop<dim, dim> (
+ MeshWorker::integration_loop<dim, dim> (
mg_dof_handler.begin_mg(), mg_dof_handler.end_mg(),
dof_info, info_box, matrix_integrator, assembler);
- const unsigned int nlevels = triangulation.n_levels();
- for (unsigned int level=0;level<nlevels;++level)
- {
- for(unsigned int i=0; i<mg_dof_handler.n_dofs(level); ++i)
- if(mg_matrices[level].diag_element(i)==0)
- mg_matrices[level].set(i,i,1.);
+ const unsigned int nlevels = triangulation.n_levels();
+ for (unsigned int level=0; level<nlevels; ++level)
+ {
+ for (unsigned int i=0; i<mg_dof_handler.n_dofs(level); ++i)
+ if (mg_matrices[level].diag_element(i)==0)
+ mg_matrices[level].set(i,i,1.);
+ }
}
- }
else
- {
- QGauss<dim> quadrature_formula(1+degree);
+ {
+ QGauss<dim> quadrature_formula(1+degree);
- FEValues<dim> fe_values (fe, quadrature_formula,
- update_values | update_gradients |
- update_quadrature_points | update_JxW_values);
+ FEValues<dim> fe_values (fe, quadrature_formula,
+ update_values | update_gradients |
+ update_quadrature_points | update_JxW_values);
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.size();
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.size();
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
- const Coefficient<dim> coefficient;
- std::vector<double> coefficient_values (n_q_points);
+ const Coefficient<dim> coefficient;
+ std::vector<double> coefficient_values (n_q_points);
- std::vector<std::vector<bool> > interface_dofs
- = mg_constrained_dofs.get_refinement_edge_indices ();
- std::vector<std::vector<bool> > boundary_interface_dofs
- = mg_constrained_dofs.get_refinement_edge_boundary_indices ();
+ std::vector<std::vector<bool> > interface_dofs
+ = mg_constrained_dofs.get_refinement_edge_indices ();
+ std::vector<std::vector<bool> > boundary_interface_dofs
+ = mg_constrained_dofs.get_refinement_edge_boundary_indices ();
- std::vector<ConstraintMatrix> boundary_constraints (triangulation.n_levels());
- std::vector<ConstraintMatrix> boundary_interface_constraints (triangulation.n_levels());
- for (unsigned int level=0; level<triangulation.n_levels(); ++level)
- {
- boundary_constraints[level].add_lines (interface_dofs[level]);
- boundary_constraints[level].add_lines (mg_constrained_dofs.get_boundary_indices()[level]);
- boundary_constraints[level].close ();
+ std::vector<ConstraintMatrix> boundary_constraints (triangulation.n_levels());
+ std::vector<ConstraintMatrix> boundary_interface_constraints (triangulation.n_levels());
+ for (unsigned int level=0; level<triangulation.n_levels(); ++level)
+ {
+ boundary_constraints[level].add_lines (interface_dofs[level]);
+ boundary_constraints[level].add_lines (mg_constrained_dofs.get_boundary_indices()[level]);
+ boundary_constraints[level].close ();
- boundary_interface_constraints[level]
- .add_lines (boundary_interface_dofs[level]);
- boundary_interface_constraints[level].close ();
- }
+ boundary_interface_constraints[level]
+ .add_lines (boundary_interface_dofs[level]);
+ boundary_interface_constraints[level].close ();
+ }
- typename DoFHandler<dim>::level_cell_iterator cell = mg_dof_handler.begin_mg(),
- endc = mg_dof_handler.end_mg();
+ typename DoFHandler<dim>::level_cell_iterator cell = mg_dof_handler.begin_mg(),
+ endc = mg_dof_handler.end_mg();
- for (; cell!=endc; ++cell)
- {
- cell_matrix = 0;
- fe_values.reinit (cell);
+ for (; cell!=endc; ++cell)
+ {
+ cell_matrix = 0;
+ fe_values.reinit (cell);
- coefficient.value_list (fe_values.get_quadrature_points(),
- coefficient_values);
+ coefficient.value_list (fe_values.get_quadrature_points(),
+ coefficient_values);
- for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- cell_matrix(i,j) += (coefficient_values[q_point] *
- fe_values.shape_grad(i,q_point) *
- fe_values.shape_grad(j,q_point) *
- fe_values.JxW(q_point));
-
- cell->get_mg_dof_indices (local_dof_indices);
-
- boundary_constraints[cell->level()]
- .distribute_local_to_global (cell_matrix,
- local_dof_indices,
- mg_matrices[cell->level()]);
-
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- if ( !(interface_dofs[cell->level()][local_dof_indices[i]]==true &&
- interface_dofs[cell->level()][local_dof_indices[j]]==false))
- cell_matrix(i,j) = 0;
-
- boundary_interface_constraints[cell->level()]
- .distribute_local_to_global (cell_matrix,
- local_dof_indices,
- mg_interface_in[cell->level()]);
+ for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ cell_matrix(i,j) += (coefficient_values[q_point] *
+ fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point));
+
+ cell->get_mg_dof_indices (local_dof_indices);
+
+ boundary_constraints[cell->level()]
+ .distribute_local_to_global (cell_matrix,
+ local_dof_indices,
+ mg_matrices[cell->level()]);
+
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ if ( !(interface_dofs[cell->level()][local_dof_indices[i]]==true &&
+ interface_dofs[cell->level()][local_dof_indices[j]]==false))
+ cell_matrix(i,j) = 0;
+
+ boundary_interface_constraints[cell->level()]
+ .distribute_local_to_global (cell_matrix,
+ local_dof_indices,
+ mg_interface_in[cell->level()]);
+ }
}
- }
}
template <int dim>
-void LaplaceProblem<dim>::refine_grid (const std::string& reftype)
+void LaplaceProblem<dim>::refine_grid (const std::string &reftype)
{
bool cell_refined = false;
if (reftype == "center" || !cell_refined)
{
for (typename Triangulation<dim>::active_cell_iterator
- cell = triangulation.begin_active();
- cell != triangulation.end(); ++cell)
- for (unsigned int vertex=0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
- {
- {
- const Point<dim> p = cell->vertex(vertex);
- const Point<dim> origin = (dim == 2 ?
- Point<dim>(0,0) :
- Point<dim>(0,0,0));
- const double dist = p.distance(origin);
- if(dist<0.25/numbers::PI)
- {
- cell->set_refine_flag ();
- cell_refined = true;
- break;
- }
- }
- }
+ cell = triangulation.begin_active();
+ cell != triangulation.end(); ++cell)
+ for (unsigned int vertex=0;
+ vertex < GeometryInfo<dim>::vertices_per_cell;
+ ++vertex)
+ {
+ {
+ const Point<dim> p = cell->vertex(vertex);
+ const Point<dim> origin = (dim == 2 ?
+ Point<dim>(0,0) :
+ Point<dim>(0,0,0));
+ const double dist = p.distance(origin);
+ if (dist<0.25/numbers::PI)
+ {
+ cell->set_refine_flag ();
+ cell_refined = true;
+ break;
+ }
+ }
+ }
}
if (reftype=="global" || !cell_refined)
triangulation.refine_global(1);
{
public:
LaplaceMatrix();
- virtual void cell(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const;
- virtual void boundary(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const;
- virtual void face(MeshWorker::DoFInfo<dim>& dinfo1, MeshWorker::DoFInfo<dim>& dinfo2,
- MeshWorker::IntegrationInfo<dim>& info1, MeshWorker::IntegrationInfo<dim>& info2) const;
+ virtual void cell(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const;
+ virtual void boundary(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const;
+ virtual void face(MeshWorker::DoFInfo<dim> &dinfo1, MeshWorker::DoFInfo<dim> &dinfo2,
+ MeshWorker::IntegrationInfo<dim> &info1, MeshWorker::IntegrationInfo<dim> &info2) const;
};
template <int dim>
LaplaceMatrix<dim>::LaplaceMatrix()
- :
- MeshWorker::LocalIntegrator<dim>(true, false, false)
+ :
+ MeshWorker::LocalIntegrator<dim>(true, false, false)
{}
template <int dim>
-void LaplaceMatrix<dim>::cell(MeshWorker::DoFInfo<dim>& dinfo, MeshWorker::IntegrationInfo<dim>& info) const
+void LaplaceMatrix<dim>::cell(MeshWorker::DoFInfo<dim> &dinfo, MeshWorker::IntegrationInfo<dim> &info) const
{
- AssertDimension (dinfo.n_matrices(), 1);
+ AssertDimension (dinfo.n_matrices(), 1);
Laplace::cell_matrix(dinfo.matrix(0,false).matrix, info.fe_values(0));
}
template <int dim>
-void LaplaceMatrix<dim>::boundary(MeshWorker::DoFInfo<dim>& /*dinfo*/,
- typename MeshWorker::IntegrationInfo<dim>& /*info*/) const
+void LaplaceMatrix<dim>::boundary(MeshWorker::DoFInfo<dim> & /*dinfo*/,
+ typename MeshWorker::IntegrationInfo<dim> & /*info*/) const
{
// const unsigned int deg = info.fe_values(0).get_fe().tensor_degree();
// Laplace::nitsche_matrix(dinfo.matrix(0,false).matrix, info.fe_values(0),
-// Laplace::compute_penalty(dinfo, dinfo, deg, deg));
+// Laplace::compute_penalty(dinfo, dinfo, deg, deg));
}
template <int dim>
void LaplaceMatrix<dim>::face(
- MeshWorker::DoFInfo<dim>& /*dinfo1*/, MeshWorker::DoFInfo<dim>& /*dinfo2*/,
- MeshWorker::IntegrationInfo<dim>& /*info1*/, MeshWorker::IntegrationInfo<dim>& /*info2*/) const
+ MeshWorker::DoFInfo<dim> & /*dinfo1*/, MeshWorker::DoFInfo<dim> & /*dinfo2*/,
+ MeshWorker::IntegrationInfo<dim> & /*info1*/, MeshWorker::IntegrationInfo<dim> & /*info2*/) const
{
// const unsigned int deg = info1.fe_values(0).get_fe().tensor_degree();
-// Laplace::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
-// dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
-// info1.fe_values(0), info2.fe_values(0),
-// Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
+// Laplace::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
+// dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
+// info1.fe_values(0), info2.fe_values(0),
+// Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
}
template <int dim>
void assemble_system ();
void assemble_multigrid (const bool &use_mw);
void solve ();
- void refine_grid (const std::string& reftype);
+ void refine_grid (const std::string &reftype);
void output_results (const unsigned int cycle) const;
Triangulation<dim> triangulation;
// if (p.square() < 0.5*0.5)
// return 20;
// else
- return 1;
+ return 1;
}
template <int dim>
-void LaplaceProblem<dim>::assemble_multigrid (const bool& use_mw)
+void LaplaceProblem<dim>::assemble_multigrid (const bool &use_mw)
{
- if(use_mw == true)
- {
- mg_matrices = 0.;
+ if (use_mw == true)
+ {
+ mg_matrices = 0.;
- MappingQ1<dim> mapping;
- MeshWorker::IntegrationInfoBox<dim> info_box;
- UpdateFlags update_flags = update_values | update_gradients | update_hessians;
- info_box.add_update_flags_all(update_flags);
- info_box.initialize(fe, mapping);
+ MappingQ1<dim> mapping;
+ MeshWorker::IntegrationInfoBox<dim> info_box;
+ UpdateFlags update_flags = update_values | update_gradients | update_hessians;
+ info_box.add_update_flags_all(update_flags);
+ info_box.initialize(fe, mapping);
- MeshWorker::DoFInfo<dim> dof_info(mg_dof_handler);
+ MeshWorker::DoFInfo<dim> dof_info(mg_dof_handler);
- MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > assembler;
- assembler.initialize(mg_constrained_dofs);
- assembler.initialize(mg_matrices);
- assembler.initialize_interfaces(mg_interface_in, mg_interface_out);
+ MeshWorker::Assembler::MGMatrixSimple<SparseMatrix<double> > assembler;
+ assembler.initialize(mg_constrained_dofs);
+ assembler.initialize(mg_matrices);
+ assembler.initialize_interfaces(mg_interface_in, mg_interface_out);
- MeshWorker::integration_loop<dim, dim> (
+ MeshWorker::integration_loop<dim, dim> (
mg_dof_handler.begin_mg(), mg_dof_handler.end_mg(),
dof_info, info_box, matrix_integrator, assembler);
- const unsigned int nlevels = triangulation.n_levels();
- for (unsigned int level=0;level<nlevels;++level)
- {
- for(unsigned int i=0; i<mg_dof_handler.n_dofs(level); ++i)
- if(mg_matrices[level].diag_element(i)==0)
- mg_matrices[level].set(i,i,1.);
+ const unsigned int nlevels = triangulation.n_levels();
+ for (unsigned int level=0; level<nlevels; ++level)
+ {
+ for (unsigned int i=0; i<mg_dof_handler.n_dofs(level); ++i)
+ if (mg_matrices[level].diag_element(i)==0)
+ mg_matrices[level].set(i,i,1.);
+ }
}
- }
else
- {
- QGauss<dim> quadrature_formula(1+degree);
+ {
+ QGauss<dim> quadrature_formula(1+degree);
- FEValues<dim> fe_values (fe, quadrature_formula,
- update_values | update_gradients |
- update_quadrature_points | update_JxW_values);
+ FEValues<dim> fe_values (fe, quadrature_formula,
+ update_values | update_gradients |
+ update_quadrature_points | update_JxW_values);
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- const unsigned int n_q_points = quadrature_formula.size();
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ const unsigned int n_q_points = quadrature_formula.size();
- FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
+ std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);
- const Coefficient<dim> coefficient;
- std::vector<double> coefficient_values (n_q_points);
+ const Coefficient<dim> coefficient;
+ std::vector<double> coefficient_values (n_q_points);
- std::vector<std::vector<bool> > interface_dofs
- = mg_constrained_dofs.get_refinement_edge_indices ();
- std::vector<std::vector<bool> > boundary_interface_dofs
- = mg_constrained_dofs.get_refinement_edge_boundary_indices ();
+ std::vector<std::vector<bool> > interface_dofs
+ = mg_constrained_dofs.get_refinement_edge_indices ();
+ std::vector<std::vector<bool> > boundary_interface_dofs
+ = mg_constrained_dofs.get_refinement_edge_boundary_indices ();
- std::vector<ConstraintMatrix> boundary_constraints (triangulation.n_levels());
- std::vector<ConstraintMatrix> boundary_interface_constraints (triangulation.n_levels());
- for (unsigned int level=0; level<triangulation.n_levels(); ++level)
- {
- boundary_constraints[level].add_lines (interface_dofs[level]);
- boundary_constraints[level].add_lines (mg_constrained_dofs.get_boundary_indices()[level]);
- boundary_constraints[level].close ();
+ std::vector<ConstraintMatrix> boundary_constraints (triangulation.n_levels());
+ std::vector<ConstraintMatrix> boundary_interface_constraints (triangulation.n_levels());
+ for (unsigned int level=0; level<triangulation.n_levels(); ++level)
+ {
+ boundary_constraints[level].add_lines (interface_dofs[level]);
+ boundary_constraints[level].add_lines (mg_constrained_dofs.get_boundary_indices()[level]);
+ boundary_constraints[level].close ();
- boundary_interface_constraints[level]
- .add_lines (boundary_interface_dofs[level]);
- boundary_interface_constraints[level].close ();
- }
+ boundary_interface_constraints[level]
+ .add_lines (boundary_interface_dofs[level]);
+ boundary_interface_constraints[level].close ();
+ }
- typename DoFHandler<dim>::level_cell_iterator cell = mg_dof_handler.begin_mg(),
- endc = mg_dof_handler.end_mg();
+ typename DoFHandler<dim>::level_cell_iterator cell = mg_dof_handler.begin_mg(),
+ endc = mg_dof_handler.end_mg();
- for (; cell!=endc; ++cell)
- {
- cell_matrix = 0;
- fe_values.reinit (cell);
+ for (; cell!=endc; ++cell)
+ {
+ cell_matrix = 0;
+ fe_values.reinit (cell);
- coefficient.value_list (fe_values.get_quadrature_points(),
- coefficient_values);
+ coefficient.value_list (fe_values.get_quadrature_points(),
+ coefficient_values);
- for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- cell_matrix(i,j) += (coefficient_values[q_point] *
- fe_values.shape_grad(i,q_point) *
- fe_values.shape_grad(j,q_point) *
- fe_values.JxW(q_point));
-
- cell->get_mg_dof_indices (local_dof_indices);
-
- boundary_constraints[cell->level()]
- .distribute_local_to_global (cell_matrix,
- local_dof_indices,
- mg_matrices[cell->level()]);
-
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- if ( !(interface_dofs[cell->level()][local_dof_indices[i]]==true &&
- interface_dofs[cell->level()][local_dof_indices[j]]==false))
- cell_matrix(i,j) = 0;
-
- boundary_interface_constraints[cell->level()]
- .distribute_local_to_global (cell_matrix,
- local_dof_indices,
- mg_interface_in[cell->level()]);
+ for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ cell_matrix(i,j) += (coefficient_values[q_point] *
+ fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point));
+
+ cell->get_mg_dof_indices (local_dof_indices);
+
+ boundary_constraints[cell->level()]
+ .distribute_local_to_global (cell_matrix,
+ local_dof_indices,
+ mg_matrices[cell->level()]);
+
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ if ( !(interface_dofs[cell->level()][local_dof_indices[i]]==true &&
+ interface_dofs[cell->level()][local_dof_indices[j]]==false))
+ cell_matrix(i,j) = 0;
+
+ boundary_interface_constraints[cell->level()]
+ .distribute_local_to_global (cell_matrix,
+ local_dof_indices,
+ mg_interface_in[cell->level()]);
+ }
}
- }
}
template <int dim>
-void LaplaceProblem<dim>::refine_grid (const std::string& reftype)
+void LaplaceProblem<dim>::refine_grid (const std::string &reftype)
{
bool cell_refined = false;
if (reftype == "center" || !cell_refined)
{
for (typename Triangulation<dim>::active_cell_iterator
- cell = triangulation.begin_active();
- cell != triangulation.end(); ++cell)
- for (unsigned int vertex=0;
- vertex < GeometryInfo<dim>::vertices_per_cell;
- ++vertex)
- {
- {
- const Point<dim> p = cell->vertex(vertex);
- const Point<dim> origin = (dim == 2 ?
- Point<dim>(0,0) :
- Point<dim>(0,0,0));
- const double dist = p.distance(origin);
- if(dist<0.25/numbers::PI)
- {
- cell->set_refine_flag ();
- cell_refined = true;
- break;
- }
- }
- }
+ cell = triangulation.begin_active();
+ cell != triangulation.end(); ++cell)
+ for (unsigned int vertex=0;
+ vertex < GeometryInfo<dim>::vertices_per_cell;
+ ++vertex)
+ {
+ {
+ const Point<dim> p = cell->vertex(vertex);
+ const Point<dim> origin = (dim == 2 ?
+ Point<dim>(0,0) :
+ Point<dim>(0,0,0));
+ const double dist = p.distance(origin);
+ if (dist<0.25/numbers::PI)
+ {
+ cell->set_refine_flag ();
+ cell_refined = true;
+ break;
+ }
+ }
+ }
}
if (reftype=="global" || !cell_refined)
triangulation.refine_global(1);
}
typename DoFHandler<dim>::cell_iterator cell = mg_dof_handler.begin(),
- endc = mg_dof_handler.end();
+ endc = mg_dof_handler.end();
for (; cell!=endc; ++cell)
{
const FiniteElement<dim> &fe;
DoFHandler<dim> dof_handler;
MGConstrainedDoFs mg_constraints;
-
+
SparsityPattern sparsity;
SparseMatrix<double> matrix;
Vector<double> solution;
types::global_dof_index n_dofs = dof_handler.n_dofs();
solution.reinit(n_dofs);
right_hand_side.reinit(n_dofs);
-
+
mg_constraints.clear();
mg_constraints.initialize(dof_handler);
-
+
DynamicSparsityPattern dsp(n_dofs);
DoFTools::make_flux_sparsity_pattern(dof_handler, dsp);
sparsity.copy_from(dsp);
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
- Assembly::Copy::Data ());
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
+ Assembly::Copy::Data ());
test_matrix.add(-1, reference_matrix);
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value * scale_mat *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value * scale_mat *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
- Assembly::Copy::Data (),
- MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
+ Assembly::Copy::Data (),
+ MultithreadInfo::n_threads(),
+ 1);
}
test_rhs_2 = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
- Assembly::Copy::Data (true),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
+ Assembly::Copy::Data (true),
+ 2*MultithreadInfo::n_threads(),
+ 1);
}
template <int dim>
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
- Assembly::Copy::Data ());
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
+ Assembly::Copy::Data ());
test_matrix.add(-1, reference_matrix);
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value * scale_mat *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value * scale_mat *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
- Assembly::Copy::Data (1),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
+ Assembly::Copy::Data (1),
+ 2*MultithreadInfo::n_threads(),
+ 1);
for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
if (constraints.is_constrained(i))
{
test_rhs_2 = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
- Assembly::Copy::Data (2),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
+ Assembly::Copy::Data (2),
+ 2*MultithreadInfo::n_threads(),
+ 1);
for (unsigned int i=0; i<dof_handler.n_dofs(); ++i)
if (constraints.is_constrained(i))
{
public:
MyFunction(const double k);
- virtual double value(const dealii::Point<dim> & point,
+ virtual double value(const dealii::Point<dim> &point,
const unsigned int component = 0 ) const;
double get_k() const;
template<int dim>
MyFunction<dim>::MyFunction(const double k)
-:
-dealii::Function<dim>(1),
-k(k)
+ :
+ dealii::Function<dim>(1),
+ k(k)
{
}
template<int dim>
-double MyFunction<dim>::value(const dealii::Point<dim> & point,
+double MyFunction<dim>::value(const dealii::Point<dim> &point,
const unsigned int ) const
{
const double x = point[0]-1.0;
public:
NeumanBC(const double c);
- virtual double value(const dealii::Point<dim> & point,
+ virtual double value(const dealii::Point<dim> &point,
const unsigned int component = 0 ) const;
double get_c() const;
template<int dim>
NeumanBC<dim>::NeumanBC(const double c)
-:
-dealii::Function<dim>(1),
-c(c)
+ :
+ dealii::Function<dim>(1),
+ c(c)
{
}
template<int dim>
-double NeumanBC<dim>::value(const dealii::Point<dim> & point,
+double NeumanBC<dim>::value(const dealii::Point<dim> &point,
const unsigned int ) const
{
return c;
p_degree.push_back(p1);
p_degree.push_back(p2);
- for (unsigned int i=0;i<p_degree.size();i++)
+ for (unsigned int i=0; i<p_degree.size(); i++)
{
const unsigned int &p = p_degree[i];
fe_collection.push_back(dealii::FE_Q<dim>(p));
/*colorize*/ false);
typename dealii::hp::DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
- for (;cell != endc; cell++)
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
+ for (; cell != endc; cell++)
if (cell->center()[0] > 1.0)
{
cell->set_active_fe_index(1);
p_degree.push_back(p2);
p_degree.push_back(p3);
- for (unsigned int i=0;i<p_degree.size();i++)
+ for (unsigned int i=0; i<p_degree.size(); i++)
{
const unsigned int &p = p_degree[i];
fe_collection.push_back(dealii::FE_Q<dim>(p));
}
typename dealii::hp::DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
- for (;cell != endc; cell++)
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
+ for (; cell != endc; cell++)
if (cell->center()[0] > 1.0) // right
{
cell->set_active_fe_index(0);
const double expected_squared_1 = h*A*std::pow(func.get_k(),2)/2.0/std::max(p3,p1);
const double expected_squared_2 = h*A*std::pow(func.get_k(),2)/2.0/std::max(p2,p1);
const double expected_squared_3 = (dim==2) ?
- expected_squared_1 + expected_squared_2:
+ expected_squared_1 + expected_squared_2:
2*expected_squared_1 + 2*expected_squared_2;
std::vector<double> expected_error(error.size(),0.0);
public:
MySecondFunction();
- virtual double value(const dealii::Point<dim> & point,
+ virtual double value(const dealii::Point<dim> &point,
const unsigned int component = 0 ) const;
};
template<int dim>
MySecondFunction<dim>::MySecondFunction()
-:
-dealii::Function<dim>(1)
+ :
+ dealii::Function<dim>(1)
{
}
template<int dim>
-double MySecondFunction<dim>::value(const dealii::Point<dim> & point,
- const unsigned int ) const
+double MySecondFunction<dim>::value(const dealii::Point<dim> &point,
+ const unsigned int ) const
{
double f = 0.0;
const double &x = point[0];
dealii::hp::QCollection<dim-1> face_quadrature_formula;
dealii::ConstraintMatrix constraints;
for (unsigned int p = 1; p <=3; p++)
- {
- fe_collection.push_back(dealii::FE_Q<dim>(p));
- quadrature_formula.push_back(dealii::QGauss<dim>(p+1));
- face_quadrature_formula.push_back(dealii::QGauss<dim-1>(p+1));
- }
+ {
+ fe_collection.push_back(dealii::FE_Q<dim>(p));
+ quadrature_formula.push_back(dealii::QGauss<dim>(p+1));
+ face_quadrature_formula.push_back(dealii::QGauss<dim-1>(p+1));
+ }
dealii::GridGenerator::hyper_cube (triangulation,0.0,1.0); // reference cell
// refine
dof_handler.distribute_dofs (fe_collection);
typename dealii::hp::DoFHandler<dim>::active_cell_iterator
- cell = dof_handler.begin_active(),
- endc = dof_handler.end();
- for (;cell != endc; cell++)
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
+ for (; cell != endc; cell++)
{
bool in_top_left = true;
for (unsigned int d=0; d< dim; d++)
cell = dof_handler.begin_active();
- for (;cell != endc; cell++)
+ for (; cell != endc; cell++)
{
if (cell->center()[0] < 0.25)
{
{
typename Triangulation<dim>::active_cell_iterator
- cell = triangulation.begin_active(),
- endc = triangulation.end();
+ cell = triangulation.begin_active(),
+ endc = triangulation.end();
for (; cell!=endc; ++cell)
{
- if (cell->is_locally_owned())
- {
- for (unsigned int face=0;
- face<GeometryInfo<dim>::faces_per_cell;
- ++face)
- {
- if (cell->face(face)->at_boundary())
- {
- if ( (std::fabs(cell->face(face)->center()(0)) < 0.1)
- && (std::fabs(cell->face(face)->center()(dim-1)) < 1e-12) )
- {
- cell->face(face)->set_boundary_id (1);
- }
-
- if ( (std::fabs(cell->face(face)->center()(0)) < 1e-12)
- && (std::fabs(cell->face(face)->center()(dim-1)) < 0.1) )
- {
- cell->face(face)->set_boundary_id (1);
- }
-
- if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 0.1)
- && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 1e-12) )
- {
- cell->face(face)->set_boundary_id (2);
- }
-
- if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 1e-12)
- && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 0.1) )
- {
- cell->face(face)->set_boundary_id (2);
- }
-
- // no normal flux boundary
-
- if ( (std::fabs(cell->face(face)->center()(0)) >= 0.1 && std::fabs(cell->face(face)->center()(0)) <= 1.0)
- && (std::fabs(cell->face(face)->center()(dim-1)) < 1e-12) )
- {
- cell->face(face)->set_boundary_id (3);
- }
-
- if ( (std::fabs(cell->face(face)->center()(0)) >= 0.0 && std::fabs(cell->face(face)->center()(0)) <= 0.9)
- && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 1e-12) )
- {
- cell->face(face)->set_boundary_id (5);
- }
-
- if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 1e-12)
- && (std::fabs(cell->face(face)->center()(dim-1)) >= 0.0 && std::fabs(cell->face(face)->center()(dim-1)) <= 0.9) )
- {
- cell->face(face)->set_boundary_id (4);
- }
-
- if ( (std::fabs(cell->face(face)->center()(0)) < 1e-12)
- && (std::fabs(cell->face(face)->center()(dim-1)) >= 0.1 && std::fabs(cell->face(face)->center()(dim-1)) <= 1.0) )
- {
- cell->face(face)->set_boundary_id (6);
- }
- }
- }
- }
+ if (cell->is_locally_owned())
+ {
+ for (unsigned int face=0;
+ face<GeometryInfo<dim>::faces_per_cell;
+ ++face)
+ {
+ if (cell->face(face)->at_boundary())
+ {
+ if ( (std::fabs(cell->face(face)->center()(0)) < 0.1)
+ && (std::fabs(cell->face(face)->center()(dim-1)) < 1e-12) )
+ {
+ cell->face(face)->set_boundary_id (1);
+ }
+
+ if ( (std::fabs(cell->face(face)->center()(0)) < 1e-12)
+ && (std::fabs(cell->face(face)->center()(dim-1)) < 0.1) )
+ {
+ cell->face(face)->set_boundary_id (1);
+ }
+
+ if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 0.1)
+ && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 1e-12) )
+ {
+ cell->face(face)->set_boundary_id (2);
+ }
+
+ if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 1e-12)
+ && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 0.1) )
+ {
+ cell->face(face)->set_boundary_id (2);
+ }
+
+ // no normal flux boundary
+
+ if ( (std::fabs(cell->face(face)->center()(0)) >= 0.1 && std::fabs(cell->face(face)->center()(0)) <= 1.0)
+ && (std::fabs(cell->face(face)->center()(dim-1)) < 1e-12) )
+ {
+ cell->face(face)->set_boundary_id (3);
+ }
+
+ if ( (std::fabs(cell->face(face)->center()(0)) >= 0.0 && std::fabs(cell->face(face)->center()(0)) <= 0.9)
+ && (std::fabs(1.0-cell->face(face)->center()(dim-1)) < 1e-12) )
+ {
+ cell->face(face)->set_boundary_id (5);
+ }
+
+ if ( (std::fabs(1.0-cell->face(face)->center()(0)) < 1e-12)
+ && (std::fabs(cell->face(face)->center()(dim-1)) >= 0.0 && std::fabs(cell->face(face)->center()(dim-1)) <= 0.9) )
+ {
+ cell->face(face)->set_boundary_id (4);
+ }
+
+ if ( (std::fabs(cell->face(face)->center()(0)) < 1e-12)
+ && (std::fabs(cell->face(face)->center()(dim-1)) >= 0.1 && std::fabs(cell->face(face)->center()(dim-1)) <= 1.0) )
+ {
+ cell->face(face)->set_boundary_id (6);
+ }
+ }
+ }
+ }
}
}
-
+
FESystem<dim> fe(FE_Q<dim>(1), dim);
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs (fe);
std::set<unsigned char> no_normal_flux_boundaries;
no_normal_flux_boundaries.insert (6);
VectorTools::compute_no_normal_flux_constraints
- (dof_handler, 0,
- no_normal_flux_boundaries,
- constraints);
+ (dof_handler, 0,
+ no_normal_flux_boundaries,
+ constraints);
constraints.print(deallog.get_file_stream());
no_normal_flux_boundaries.insert (5); // z=1
VectorTools::compute_no_normal_flux_constraints
- (dof_handler, 0,
- no_normal_flux_boundaries,
- constraints);
+ (dof_handler, 0,
+ no_normal_flux_boundaries,
+ constraints);
constraints.print(deallog.get_file_stream());
FE_Q<dim> fe(1);\r
DoFHandler<dim> dof_handler(triangulation);\r
dof_handler.distribute_dofs(fe);\r
- \r
+\r
ConstraintMatrix constraints;\r
std::set<types::boundary_id> no_normal_flux_boundaries;\r
no_normal_flux_boundaries.insert (1);\r
deal_II_exceptions::disable_abort_on_exception();\r
try\r
{\r
- \r
- VectorTools::compute_no_normal_flux_constraints (dof_handler,\r
- 0,\r
- no_normal_flux_boundaries,\r
- constraints);\r
+\r
+ VectorTools::compute_no_normal_flux_constraints (dof_handler,\r
+ 0,\r
+ no_normal_flux_boundaries,\r
+ constraints);\r
}\r
catch (ExceptionBase &e)\r
{\r
{
hp::DoFHandler<dim> dof(tr);
for (typename hp::DoFHandler<dim>::active_cell_iterator
- cell = dof.begin_active(); cell != dof.end(); ++cell)
+ cell = dof.begin_active(); cell != dof.end(); ++cell)
cell->set_active_fe_index (cell->index() % 2);
dof.distribute_dofs(fe);
-// check the creation of inhomogeneous normal-flux boundary conditions
-// for a finite element that consists of only a single set of vector
+// check the creation of inhomogeneous normal-flux boundary conditions
+// for a finite element that consists of only a single set of vector
// components (i.e. it has dim components)
#include "../tests.h"
{
DoFHandler<dim> dof(tr);
dof.distribute_dofs(fe);
-
+
ConstantFunction<dim> constant_function(1.,dim);
typename FunctionMap<dim>::type function_map;
for (unsigned int j=0; j<GeometryInfo<dim>::faces_per_cell; ++j)
function_map[j] = &constant_function;
-
+
for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
{
deallog << "FE=" << fe.get_name()
ConstraintMatrix cm;
VectorTools::compute_nonzero_normal_flux_constraints
- (dof, 0, boundary_ids, function_map, cm);
+ (dof, 0, boundary_ids, function_map, cm);
cm.print (deallog.get_file_stream ());
}
//Get the location of all boundary dofs
std::vector<types::global_dof_index> face_dofs;
const std::vector<Point<dim-1> > &
- unit_support_points = fe.get_unit_face_support_points();
+ unit_support_points = fe.get_unit_face_support_points();
Quadrature<dim-1> quadrature(unit_support_points);
FEFaceValues<dim, dim> fe_face_values(fe, quadrature, update_q_points);
typename DoFHandler<dim>::active_cell_iterator
for (unsigned int face_no=0; face_no < GeometryInfo<dim>::faces_per_cell;
++face_no)
if (cell->face(face_no)->at_boundary())
- {
- typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
- face_dofs.resize (fe.dofs_per_face);
- face->get_dof_indices (face_dofs);
-
- fe_face_values.reinit(cell, face_no);
- for (unsigned int i=0; i<face_dofs.size(); ++i)
{
- std::cout << face_dofs[i] << "\t"
- << fe_face_values.quadrature_point(i) << "\t"
- << fe.face_system_to_component_index(i).first
- << std::endl;
+ typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
+ face_dofs.resize (fe.dofs_per_face);
+ face->get_dof_indices (face_dofs);
+
+ fe_face_values.reinit(cell, face_no);
+ for (unsigned int i=0; i<face_dofs.size(); ++i)
+ {
+ std::cout << face_dofs[i] << "\t"
+ << fe_face_values.quadrature_point(i) << "\t"
+ << fe.face_system_to_component_index(i).first
+ << std::endl;
+ }
}
- }
-
+
}
// boundary value functions
std::vector<const FiniteElement<dim>*> fe_list;
std::vector<MySquareFunction<dim>*> function_list;
-
+
// FE1: a system of a quadratic and a linear element
fe_list.push_back (new FESystem<dim> (FE_Q<dim>(2), 1, FE_Q<dim>(1), 1));
function_list.push_back (new MySquareFunction<dim>(2));
test_boundary_values (fe, constraints_fes);\r
}\r
\r
- if(constraints_fes.n_constraints() == constraints_fe.n_constraints())\r
- {\r
- const IndexSet& lines = constraints_fes.get_local_lines ();\r
-\r
- for(unsigned i = 0; i < lines.n_elements(); ++i)\r
+ if (constraints_fes.n_constraints() == constraints_fe.n_constraints())\r
{\r
- if(!constraints_fe.is_constrained(lines.nth_index_in_set(i)))\r
- {\r
- deallog << "Failed" << std::endl;\r
- return;\r
- }\r
-\r
- const std::vector<std::pair<types::global_dof_index,double> >& c1\r
- = *constraints_fes.get_constraint_entries(lines.nth_index_in_set(i));\r
- const std::vector<std::pair<types::global_dof_index,double> >& c2\r
- = *constraints_fe.get_constraint_entries(lines.nth_index_in_set(i));\r
-\r
- for(size_t j = 0; j < c1.size(); ++j)\r
- if((c1[j].first != c2[j].first) || (fabs(c1[j].second - c2[j].second) > 1e-14))\r
+ const IndexSet &lines = constraints_fes.get_local_lines ();\r
+\r
+ for (unsigned i = 0; i < lines.n_elements(); ++i)\r
{\r
- deallog << "Failed" << std::endl;\r
- return;\r
+ if (!constraints_fe.is_constrained(lines.nth_index_in_set(i)))\r
+ {\r
+ deallog << "Failed" << std::endl;\r
+ return;\r
+ }\r
+\r
+ const std::vector<std::pair<types::global_dof_index,double> > &c1\r
+ = *constraints_fes.get_constraint_entries(lines.nth_index_in_set(i));\r
+ const std::vector<std::pair<types::global_dof_index,double> > &c2\r
+ = *constraints_fe.get_constraint_entries(lines.nth_index_in_set(i));\r
+\r
+ for (size_t j = 0; j < c1.size(); ++j)\r
+ if ((c1[j].first != c2[j].first) || (fabs(c1[j].second - c2[j].second) > 1e-14))\r
+ {\r
+ deallog << "Failed" << std::endl;\r
+ return;\r
+ }\r
}\r
}\r
- }\r
else\r
- {\r
- deallog << "Failed" << std::endl;\r
- return;\r
- }\r
+ {\r
+ deallog << "Failed" << std::endl;\r
+ return;\r
+ }\r
\r
deallog << "OK" << std::endl;\r
}\r
// check the creation of tangential flux boundary conditions for a finite
// element that consists of only a single set of vector components
-// (i.e. it has dim components). Similar as the normal-flux test in
+// (i.e. it has dim components). Similar as the normal-flux test in
// normal_flux_inhom_01.cc
#include "../tests.h"
ConstraintMatrix cm;
VectorTools::compute_nonzero_tangential_flux_constraints
- (dof, 0, boundary_ids, function_map, cm);
+ (dof, 0, boundary_ids, function_map, cm);
cm.print (deallog.get_file_stream ());
}
- //Get the location of all boundary dofs
- std::vector<types::global_dof_index> face_dofs;
- const std::vector<Point<dim-1> > &
- unit_support_points = fe.get_unit_face_support_points();
- Quadrature<dim-1> quadrature(unit_support_points);
- FEFaceValues<dim, dim> fe_face_values(fe, quadrature, update_q_points);
- typename DoFHandler<dim>::active_cell_iterator
- cell = dof.begin_active(),
- endc = dof.end();
- for (; cell!=endc; ++cell)
- for (unsigned int face_no=0; face_no < GeometryInfo<dim>::faces_per_cell;
- ++face_no)
- if (cell->face(face_no)->at_boundary())
+ //Get the location of all boundary dofs
+ std::vector<types::global_dof_index> face_dofs;
+ const std::vector<Point<dim-1> > &
+ unit_support_points = fe.get_unit_face_support_points();
+ Quadrature<dim-1> quadrature(unit_support_points);
+ FEFaceValues<dim, dim> fe_face_values(fe, quadrature, update_q_points);
+ typename DoFHandler<dim>::active_cell_iterator
+ cell = dof.begin_active(),
+ endc = dof.end();
+ for (; cell!=endc; ++cell)
+ for (unsigned int face_no=0; face_no < GeometryInfo<dim>::faces_per_cell;
+ ++face_no)
+ if (cell->face(face_no)->at_boundary())
{
typename DoFHandler<dim>::face_iterator face = cell->face(face_no);
face_dofs.resize (fe.dofs_per_face);
face->get_dof_indices (face_dofs);
-
+
fe_face_values.reinit(cell, face_no);
for (unsigned int i=0; i<face_dofs.size(); ++i)
- {
- std::cout << face_dofs[i] << "\t"
- << fe_face_values.quadrature_point(i) << "\t"
- << fe.face_system_to_component_index(i).first
- << std::endl;
- }
+ {
+ std::cout << face_dofs[i] << "\t"
+ << fe_face_values.quadrature_point(i) << "\t"
+ << fe.face_system_to_component_index(i).first
+ << std::endl;
+ }
}
}
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
-
+
// Create a bspline passign through the points
std::vector<Point<3> > pts;
pts.push_back(Point<3>(0,0,0));
TopoDS_Edge edge = interpolation_curve(pts);
ArclengthProjectionLineManifold<1,3> manifold(edge);
-
+
Triangulation<1,3> tria;
GridGenerator::hyper_cube(tria);
tria.begin_active()->set_all_manifold_ids(1);
tria.set_manifold(1, manifold);
-
+
tria.refine_global(4);
GridOut gridout;
gridout.write_msh(tria, logfile);
return 0;
}
-
+
vertices.push_back(Point<3>(0,1,0));
vertices.push_back(Point<3>(0,0,0));
TopoDS_Edge edge = interpolation_curve(vertices, Point<3>(), true);
-
+
// Create a boundary projector.
ArclengthProjectionLineManifold<2,3> boundary_line(edge);
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
//
//-----------------------------------------------------------
-// Test the class DirectionalProjectionBoundary
+// Test the class DirectionalProjectionBoundary
#include "../tests.h"
#include <fstream>
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
pts2.push_back(Point<3>(0,1,0));
pts2.push_back(Point<3>(.5,1,1));
pts2.push_back(Point<3>(1,1,0));
-
+
TopoDS_Edge edge1 = interpolation_curve(pts1);
TopoDS_Edge edge2 = interpolation_curve(pts2);
-
+
TopoDS_Face face = BRepFill::Face (edge1, edge2);
DirectionalProjectionBoundary<2,3> manifold(face, Point<3>(0,0,1));
-
+
Triangulation<2,3> tria;
GridGenerator::hyper_cube(tria);
tria.refine_global(2);
GridOut gridout;
gridout.write_msh(tria, logfile);
-
+
return 0;
-}
+}
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
- // The circle passing through the
- // vertices of the unit square
+ // The circle passing through the
+ // vertices of the unit square
gp_Dir z_axis(0.,0.,1.);
gp_Pnt center(.5,.5,0.);
gp_Ax2 axis(center, z_axis);
Standard_Real radius(std::sqrt(2.)/2.);
-
+
Handle(Geom_Curve) circle = GC_MakeCircle(axis, radius);
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(circle);
-
-
- // Create a boundary projector.
+
+
+ // Create a boundary projector.
NormalProjectionBoundary<2,3> boundary_line(edge);
-
- // This one is for checking: This
- // is what deal.II would do for a
- // circle.
+
+ // This one is for checking: This
+ // is what deal.II would do for a
+ // circle.
HyperBallBoundary<2,3> boundary_line_deal (Point<3>(.5,.5,0),
- std::sqrt(2.)/2.);
-
-
-
- // The unit square.
+ std::sqrt(2.)/2.);
+
+
+
+ // The unit square.
Triangulation<2,3> tria;
GridGenerator::hyper_cube(tria);
- // Set the exterior boundary
+ // Set the exterior boundary
tria.set_boundary(0, boundary_line);
- // This is here to ignore the
- // points created in the interior
- // of the face.
+ // This is here to ignore the
+ // points created in the interior
+ // of the face.
tria.begin()->set_material_id(1);
- // We refine twice, and expect the
- // outer points to end up on the
- // circle.
+ // We refine twice, and expect the
+ // outer points to end up on the
+ // circle.
tria.refine_global(2);
- // You can open the generated file
- // with paraview.
+ // You can open the generated file
+ // with paraview.
GridOut gridout;
gridout.write_ucd (tria, logfile);
-
+
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
- // A unit circle
+ // A unit circle
gp_Dir z_axis(0.,0.,1.);
gp_Pnt center(0.,0.,0.);
gp_Ax2 axis(center, z_axis);
Standard_Real radius(1.);
-
+
Handle(Geom_Curve) circle = GC_MakeCircle(axis, radius);
TopoDS_Edge edge = BRepBuilderAPI_MakeEdge(circle);
-
-
- // Now get a few points and project
- // them on the circle
+
+
+ // Now get a few points and project
+ // them on the circle
std::vector<Point<3> > points;
-
+
points.push_back(Point<3>(3,0,0));
points.push_back(Point<3>(0,3,0));
- // This one is tricky... the point
- // is not on the xy plane. If we
- // put it on the axis (x=0, y=0),
- // there should not exist a
- // projection. Any value for z
- // should give the same result.
+ // This one is tricky... the point
+ // is not on the xy plane. If we
+ // put it on the axis (x=0, y=0),
+ // there should not exist a
+ // projection. Any value for z
+ // should give the same result.
points.push_back(Point<3>(.1,0,3));
- points.push_back(Point<3>(.1,0,4));
-
+ points.push_back(Point<3>(.1,0,4));
+
double u, v;
TopoDS_Shape sh;
- for(unsigned int i=0; i<points.size(); ++i)
+ for (unsigned int i=0; i<points.size(); ++i)
{
- std_cxx11::tuple<Point<3>, TopoDS_Shape, double, double> ref =
- project_point_and_pull_back(edge, points[i]);
-
+ std_cxx11::tuple<Point<3>, TopoDS_Shape, double, double> ref =
+ project_point_and_pull_back(edge, points[i]);
+
Point<3> pp = std_cxx11::get<0>(ref);
sh = std_cxx11::get<1>(ref);
u = std_cxx11::get<2>(ref);
v = std_cxx11::get<3>(ref);
-
+
deallog << "Origin: " << points[i]
- << ", on unit circle: " << pp
- << ", with local coordinates (u, v): (" << u
- << ", " << v << ")" << std::endl;
+ << ", on unit circle: " << pp
+ << ", with local coordinates (u, v): (" << u
+ << ", " << v << ")" << std::endl;
}
return 0;
}
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
//
//-----------------------------------------------------------
-// Read the file side.iges, and
+// Read the file side.iges, and
// create a single-cell Triangulation
#include "../tests.h"
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
-
+
TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/wigley.iges", 0.001);
std::vector<TopoDS_Face> faces;
std::vector<TopoDS_Edge> edges;
std::vector<TopoDS_Vertex> vertices;
-
+
extract_geometrical_shapes(sh, faces, edges, vertices);
Triangulation<2,3> tria;
// You can open the generated file with gmsh
GridOut gridout;
gridout.write_msh (tria, logfile);
-
+
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
-
+
TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/wigley.iges", 0.001);
std::vector<TopoDS_Face> faces;
std::vector<TopoDS_Edge> edges;
std::vector<TopoDS_Vertex> vertices;
-
+
extract_geometrical_shapes(sh, faces, edges, vertices);
// Create a boundary projector on the first face.
NormalProjectionBoundary<2,3> boundary(faces[0]);
-
+
// Create a Triangulation with a single cell
Triangulation<2,3> tria;
create_triangulation(faces[0], tria);
// You can open the generated file with gmsh
GridOut gridout;
gridout.write_msh (tria, logfile);
-
+
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
//
//-----------------------------------------------------------
-// Create a BSpline surface, and test axis projection.
+// Create a BSpline surface, and test axis projection.
#include "../tests.h"
#include <fstream>
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
-
+
// Create a bspline passign through the points
std::vector<Point<3> > pts;
pts.push_back(Point<3>(0,0,0));
pts.push_back(Point<3>(1,0,0));
TopoDS_Edge edge1 = interpolation_curve(pts);
- for(unsigned int i=0; i<pts.size(); ++i)
+ for (unsigned int i=0; i<pts.size(); ++i)
pts[i] += Point<3>(0,0,1);
TopoDS_Edge edge2 = interpolation_curve(pts);
DirectionalProjectionBoundary<1,3> manifold(face, Point<3>(0,1,0));
-
+
Triangulation<1,3> tria;
GridGenerator::hyper_cube(tria);
tria.begin_active()->set_all_manifold_ids(1);
tria.set_manifold(1, manifold);
-
+
tria.refine_global(4);
GridOut gridout;
gridout.write_msh(tria, logfile);
return 0;
-}
+}
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
// Create a bspline passing through the points
std::vector<Point<3> > pts;
std::ofstream out("output");
std::string line;
unsigned int counter = 5;
- while(counter--) std::getline(in, line);
- while(std::getline(in, line))
+ while (counter--) std::getline(in, line);
+ while (std::getline(in, line))
out << line << std::endl;
in.close();
out.close();
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
-
+
TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/goteborg.iges");
std::vector<TopoDS_Face> faces;
std::vector<TopoDS_Edge> edges;
std::vector<TopoDS_Vertex> vertices;
extract_geometrical_shapes(sh, faces, edges, vertices);
-
+
std_cxx11::tuple<unsigned int, unsigned int, unsigned int>
- n = count_elements(sh);
+ n = count_elements(sh);
unsigned int nf=std_cxx11::get<0>(n);
unsigned int ne=std_cxx11::get<1>(n);
unsigned int nv=std_cxx11::get<2>(n);
deallog << "Shape contains " << std_cxx11::get<0>(n) << " faces, "
- << std_cxx11::get<1>(n) << " edges, and "
- << std_cxx11::get<2>(n) << " vertices." << std::endl;
-
- if(nf != faces.size())
+ << std_cxx11::get<1>(n) << " edges, and "
+ << std_cxx11::get<2>(n) << " vertices." << std::endl;
+
+ if (nf != faces.size())
deallog << "Error!" << std::endl;
- if(ne != edges.size())
+ if (ne != edges.size())
deallog << "Error!" << std::endl;
- if(nv != vertices.size())
+ if (nv != vertices.size())
deallog << "Error!" << std::endl;
-
+
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
-
+
TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/goteborg.iges");
std::vector<TopoDS_Compound> compounds;
std::vector<TopoDS_CompSolid> compsolids;
std::vector<TopoDS_Shell> shells;
std::vector<TopoDS_Wire> wires;
extract_compound_shapes(sh, compounds, compsolids, solids, shells, wires);
-
+
deallog << "Shape contains " << compounds.size() << " compounds, "
- << compsolids.size() << " compound solids, "
- << solids.size() << " solids, "
- << shells.size() << " shells, "
- << wires.size() << " wires." << std::endl;
+ << compsolids.size() << " compound solids, "
+ << solids.size() << " solids, "
+ << shells.size() << " shells, "
+ << wires.size() << " wires." << std::endl;
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/wigley.iges");
write_IGES(sh, "tmp.iges");
std::ofstream out("output");
std::string line;
unsigned int counter = 5;
- while(counter--) std::getline(in,line);
- while(std::getline(in,line))
+ while (counter--) std::getline(in,line);
+ while (std::getline(in,line))
out << line << std::endl;
in.close();
out.close();
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
deallog.attach(logfile);
vertices.push_back(Point<3>(1,1,0));
vertices.push_back(Point<3>(0,1,0));
TopoDS_Shape shape = interpolation_curve(vertices, Point<3>(), true);
-
+
// Create a boundary projector.
NormalProjectionBoundary<2,3> boundary_line(shape);
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
gp_Pnt center(.5,.5,.5);
Standard_Real radius(Point<3>().distance(point(center)));
-
+
TopoDS_Face face = BRepPrimAPI_MakeSphere(center, radius);
-
- // Create a boundary projector.
+
+ // Create a boundary projector.
NormalProjectionBoundary<3,3> sphere(face);
-
-
- // The unit cube.
+
+
+ // The unit cube.
Triangulation<3,3> tria;
GridGenerator::hyper_cube(tria);
- // Set the exterior boundary
+ // Set the exterior boundary
tria.set_manifold(1, sphere);
- // This is here to ignore the
- // points created in the interior
- // of the face.
+ // This is here to ignore the
+ // points created in the interior
+ // of the face.
tria.begin()->set_all_manifold_ids(1);
tria.begin()->set_manifold_id(0);
// You can open the generated file with gmsh
GridOut gridout;
gridout.write_msh (tria, logfile);
-
+
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
//
//-----------------------------------------------------------
-// Create a BSpline surface, and test axis projection.
+// Create a BSpline surface, and test axis projection.
#include "../tests.h"
#include <fstream>
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
-
+
// Create a bspline passing through the points
std::vector<Point<3> > pts;
pts.push_back(Point<3>(0,0,0));
pts.push_back(Point<3>(1,0,0));
TopoDS_Edge edge1 = interpolation_curve(pts);
- for(unsigned int i=0; i<pts.size(); ++i)
+ for (unsigned int i=0; i<pts.size(); ++i)
pts[i] += Point<3>(0,0,1);
TopoDS_Edge edge2 = interpolation_curve(pts);
NormalToMeshProjectionBoundary<1,3> manifold(face);
-
+
Triangulation<1,3> tria;
GridGenerator::hyper_cube(tria);
tria.begin_active()->set_all_manifold_ids(1);
tria.set_manifold(1, manifold);
-
+
tria.refine_global(4);
GridOut gridout;
gridout.write_msh(tria, logfile);
return 0;
-}
+}
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
//
//-----------------------------------------------------------
-// Create a BSpline surface, and test axis projection.
+// Create a BSpline surface, and test axis projection.
#include "../tests.h"
#include <fstream>
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
-
+
// Create a bspline passing through the points
std::vector<Point<3> > pts;
pts.push_back(Point<3>(0,0,0));
pts.push_back(Point<3>(0,0,-1));
TopoDS_Edge edge1 = interpolation_curve(pts);
- for(unsigned int i=0; i<pts.size(); ++i)
+ for (unsigned int i=0; i<pts.size(); ++i)
pts[i] += Point<3>(0,1,0);
TopoDS_Edge edge2 = interpolation_curve(pts);
NormalToMeshProjectionBoundary<2,3> manifold(face);
-
+
Triangulation<2,3> tria;
GridGenerator::hyper_cube(tria);
tria.begin_active()->set_all_manifold_ids(1);
tria.set_manifold(1, manifold);
-
+
tria.refine_global(2);
GridOut gridout;
gridout.write_msh(tria, logfile);
return 0;
-}
+}
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
Standard_Real radius(Point<3>().distance(point(center)));
TopoDS_Face face = BRepPrimAPI_MakeSphere(center, radius);
-
+
// Intersect the sphere with the plane z = 0
TopoDS_Shape intersect = intersect_plane(face, 0, 0, 1, 0);
// This shape should be the standard circle. Only one edge should be
// in intersect: our edge.
TopExp_Explorer exp(intersect, TopAbs_EDGE);
TopoDS_Edge edge = TopoDS::Edge(exp.Current());
-
+
ArclengthProjectionLineManifold<2,3> boundary_line(edge);
// The unit square.
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
initlog();
-
+
TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/wigley.iges", 0.001);
std::vector<TopoDS_Face> faces;
std::vector<TopoDS_Edge> edges;
std::vector<TopoDS_Vertex> vertices;
-
+
extract_geometrical_shapes(sh, faces, edges, vertices);
// Create a boundary projector on the first face.
NormalProjectionBoundary<2,3> boundary(faces[0]);
-
+
// Create a Triangulation with a single cell
Triangulation<2,3> tria;
create_triangulation(faces[0], tria);
tria.begin()->set_all_manifold_ids(1);
deallog << "Ncells: " << tria.n_active_cells() << std::endl
- << "Cell[0] center: " << tria.begin()->center() << std::endl
- << "Projected center: " << tria.begin()->center(true) << std::endl;
+ << "Cell[0] center: " << tria.begin()->center() << std::endl
+ << "Projected center: " << tria.begin()->center(true) << std::endl;
+
-
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
initlog();
-
+
TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/wigley.iges", 0.001);
std::vector<TopoDS_Face> faces;
std::vector<TopoDS_Edge> edges;
std::vector<TopoDS_Vertex> vertices;
-
+
extract_geometrical_shapes(sh, faces, edges, vertices);
// Create a boundary projector on the first face.
DirectionalProjectionBoundary<2,3> boundary(faces[0], Point<3>(0.,1.,0.));
-
+
// Create a Triangulation with a single cell
Triangulation<2,3> tria;
create_triangulation(faces[0], tria);
tria.begin()->set_all_manifold_ids(1);
deallog << "Ncells: " << tria.n_active_cells() << std::endl
- << "Cell[0] center: " << tria.begin()->center() << std::endl
- << "Projected center: " << tria.begin()->center(true) << std::endl;
+ << "Cell[0] center: " << tria.begin()->center() << std::endl
+ << "Projected center: " << tria.begin()->center(true) << std::endl;
+
-
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
initlog();
-
+
TopoDS_Shape sh = read_IGES(SOURCE_DIR "/iges_files/wigley.iges", 0.001);
std::vector<TopoDS_Face> faces;
std::vector<TopoDS_Edge> edges;
std::vector<TopoDS_Vertex> vertices;
-
+
extract_geometrical_shapes(sh, faces, edges, vertices);
// Create a boundary projector on the first face.
NormalToMeshProjectionBoundary<2,3> boundary(faces[0]);
-
+
// Create a Triangulation with a single cell
Triangulation<2,3> tria;
create_triangulation(faces[0], tria);
tria.begin()->set_all_manifold_ids(1);
deallog << "Ncells: " << tria.n_active_cells() << std::endl
- << "Cell[0] center: " << tria.begin()->center() << std::endl
- << "Projected center: " << tria.begin()->center(true) << std::endl;
+ << "Cell[0] center: " << tria.begin()->center() << std::endl
+ << "Projected center: " << tria.begin()->center(true) << std::endl;
+
-
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
// Create a bspline passing through the points
std::vector<Point<3> > pts;
std::string line;
unsigned int counter = 0;
- while(std::getline(in,line))
- {
- counter++;
- if ( (counter == 4) ||
- (counter == 5) ||
- (counter == 6) ||
- (counter == 18) ||
- (counter == 19) )
- {
- }
- else
- out << line << std::endl;
- }
+ while (std::getline(in,line))
+ {
+ counter++;
+ if ( (counter == 4) ||
+ (counter == 5) ||
+ (counter == 6) ||
+ (counter == 18) ||
+ (counter == 19) )
+ {
+ }
+ else
+ out << line << std::endl;
+ }
in.close();
out.close();
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
-
+
TopoDS_Shape sh = read_STEP(SOURCE_DIR "/step_files/goteborg.step");
std::vector<TopoDS_Face> faces;
std::vector<TopoDS_Edge> edges;
std::vector<TopoDS_Vertex> vertices;
extract_geometrical_shapes(sh, faces, edges, vertices);
-
+
std_cxx11::tuple<unsigned int, unsigned int, unsigned int>
- n = count_elements(sh);
+ n = count_elements(sh);
unsigned int nf=std_cxx11::get<0>(n);
unsigned int ne=std_cxx11::get<1>(n);
unsigned int nv=std_cxx11::get<2>(n);
deallog << "Shape contains " << std_cxx11::get<0>(n) << " faces, "
- << std_cxx11::get<1>(n) << " edges, and "
- << std_cxx11::get<2>(n) << " vertices." << std::endl;
-
- if(nf != faces.size())
+ << std_cxx11::get<1>(n) << " edges, and "
+ << std_cxx11::get<2>(n) << " vertices." << std::endl;
+
+ if (nf != faces.size())
deallog << "Error!" << std::endl;
- if(ne != edges.size())
+ if (ne != edges.size())
deallog << "Error!" << std::endl;
- if(nv != vertices.size())
+ if (nv != vertices.size())
deallog << "Error!" << std::endl;
-
+
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
std::ofstream logfile("output");
deallog.attach(logfile);
deallog.depth_console(0);
-
+
TopoDS_Shape sh = read_STEP(SOURCE_DIR "/step_files/goteborg.step");
std::vector<TopoDS_Compound> compounds;
std::vector<TopoDS_CompSolid> compsolids;
std::vector<TopoDS_Shell> shells;
std::vector<TopoDS_Wire> wires;
extract_compound_shapes(sh, compounds, compsolids, solids, shells, wires);
-
+
deallog << "Shape contains " << compounds.size() << " compounds, "
- << compsolids.size() << " compound solids, "
- << solids.size() << " solids, "
- << shells.size() << " shells, "
- << wires.size() << " wires." << std::endl;
+ << compsolids.size() << " compound solids, "
+ << solids.size() << " solids, "
+ << shells.size() << " shells, "
+ << wires.size() << " wires." << std::endl;
return 0;
}
-
+
//-----------------------------------------------------------
//
-// Copyright (C) 2014 - 2015 by the deal.II authors
+// Copyright (C) 2014 - 2015 by the deal.II authors
//
// This file is subject to LGPL and may not be distributed
// without copyright and license information. Please refer
using namespace OpenCASCADE;
-int main ()
+int main ()
{
TopoDS_Shape sh = read_STEP(SOURCE_DIR "/step_files/wigley.step");
write_STEP(sh, "tmp.step");
std::string line;
unsigned int counter = 0;
- while(std::getline(in,line))
- {
- counter++;
- if ( (counter == 4) ||
- (counter == 5) ||
- (counter == 6) ||
- (counter == 18) ||
- (counter == 19) )
- {
- }
- else
- out << line << std::endl;
- }
-
-
+ while (std::getline(in,line))
+ {
+ counter++;
+ if ( (counter == 4) ||
+ (counter == 5) ||
+ (counter == 6) ||
+ (counter == 18) ||
+ (counter == 19) )
+ {
+ }
+ else
+ out << line << std::endl;
+ }
+
+
in.close();
out.close();
return 0;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
{
bits_set = 0;
mask = 0x00;
-
+
#if defined(__linux__)
cpu_set_t my_set;
CPU_ZERO(&my_set);
printf("sched_getaffinity() failed, return value: %d\n", ret);
return false;
}
- for (int i=0;i<CPU_SETSIZE;++i)
+ for (int i=0; i<CPU_SETSIZE; ++i)
bits_set += CPU_ISSET(i,&my_set);
- mask = *(int*)(&my_set);
+ mask = *(int *)(&my_set);
#else
// sadly we don't have an implementation
// for mac/windows
{
int max_threads_env = -1;
try
- {
- max_threads_env = dealii::Utilities::string_to_int(std::string(penv));
- }
+ {
+ max_threads_env = dealii::Utilities::string_to_int(std::string(penv));
+ }
catch (...)
- {
- return -1;
- }
+ {
+ return -1;
+ }
return max_threads_env;
}
unsigned int tbbprocs = dealii::MultithreadInfo::n_threads();
int env = get_num_thread_env();
printf("aff_ncpus=%d, mask=%08X, nprocs=%d, tbb_threads=%d, DEAL_II_NUM_THREADS=%d\n",
- bits_set, mask, nprocs, tbbprocs, env );
+ bits_set, mask, nprocs, tbbprocs, env );
if (bits_set !=0 && bits_set!=nprocs)
{
if (nprocs != tbbprocs)
{
printf("Warning: for some reason TBB only wants to use %d out of %d CPUs.\n",
- tbbprocs, nprocs);
+ tbbprocs, nprocs);
return 3;
}
-
+
return 0;
}
int main(int argc, char *argv[] )
{
- MPI_Init( &argc, &argv );
+ MPI_Init( &argc, &argv );
int myrank, nproc;
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
MPI_Comm_size(MPI_COMM_WORLD, &nproc);
std::cout << " Hi from " << myrank << "/" << nproc << std::endl;
-
+
if (nproc != 2)
{
std::cerr << "ERROR: process does not see nproc=2!" << std::endl;
return -1;
}
-
+
MPI_Barrier(MPI_COMM_WORLD);
int err;
int value = myrank;
-
+
if (myrank==1)
err = MPI_Send(&value, 1, MPI_INT, 0, 1, MPI_COMM_WORLD);
else if (myrank==0)
value = 1;
int output = 0;
-
+
MPI_Allreduce(&value, &output, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
if (output != nproc)
{
std::cerr << "ERROR: MPI_Allreduce doesn't seem to work!" << std::endl;
return -1;
}
-
+
// we need this, otherwise gcc will not link against deal.II
dealii::Triangulation<2> test;
public:\r
LaplaceProblem ();\r
void run ();\r
- \r
+\r
private:\r
void setup_system ();\r
void assemble_system ();\r
void solve ();\r
- \r
+\r
Triangulation<2> triangulation;\r
FE_Q<2> fe;\r
DoFHandler<2> dof_handler;\r
- \r
+\r
PETScWrappers::SparseMatrix A;\r
- PETScWrappers::Vector b, x; \r
+ PETScWrappers::Vector b, x;\r
ConstraintMatrix constraints;\r
\r
TableHandler output_table;\r
constraints.clear ();\r
DoFTools::make_zero_boundary_constraints (dof_handler, constraints);\r
constraints.close ();\r
- \r
+\r
A.reinit (dof_handler.n_dofs(), dof_handler.n_dofs(),\r
- dof_handler.max_couplings_between_dofs());\r
+ dof_handler.max_couplings_between_dofs());\r
b.reinit (dof_handler.n_dofs());\r
x.reinit (dof_handler.n_dofs());\r
\r
void LaplaceProblem::assemble_system ()\r
{\r
QGauss<2> quadrature_formula(2);\r
- \r
+\r
FEValues<2> fe_values (fe, quadrature_formula,\r
- update_values | \r
- update_gradients |\r
- update_quadrature_points | \r
- update_JxW_values);\r
- \r
+ update_values |\r
+ update_gradients |\r
+ update_quadrature_points |\r
+ update_JxW_values);\r
+\r
const unsigned int dofs_per_cell = fe.dofs_per_cell;\r
const unsigned int n_q_points = quadrature_formula.size();\r
- \r
+\r
FullMatrix<double> cell_A (dofs_per_cell, dofs_per_cell);\r
Vector<double> cell_b (dofs_per_cell);\r
- \r
+\r
std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);\r
- \r
+\r
DoFHandler<2>::active_cell_iterator\r
- cell = dof_handler.begin_active (),\r
- endc = dof_handler.end ();\r
- \r
+ cell = dof_handler.begin_active (),\r
+ endc = dof_handler.end ();\r
+\r
for (; cell!=endc; ++cell)\r
{\r
fe_values.reinit (cell);\r
cell_A = 0;\r
cell_b = 0;\r
- \r
+\r
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)\r
- for (unsigned int i=0; i<dofs_per_cell; ++i)\r
- {\r
- for (unsigned int j=0; j<dofs_per_cell; ++j)\r
- {\r
- cell_A (i, j)\r
- += \r
- fe_values.shape_grad (i, q_point) *\r
- fe_values.shape_grad (j, q_point)\r
- * \r
- fe_values.JxW (q_point);\r
- }\r
-\r
- cell_b (i)\r
- += \r
- fe_values.shape_value (i, q_point)\r
- * \r
- fe_values.JxW (q_point);\r
- }\r
- \r
+ for (unsigned int i=0; i<dofs_per_cell; ++i)\r
+ {\r
+ for (unsigned int j=0; j<dofs_per_cell; ++j)\r
+ {\r
+ cell_A (i, j)\r
+ +=\r
+ fe_values.shape_grad (i, q_point) *\r
+ fe_values.shape_grad (j, q_point)\r
+ *\r
+ fe_values.JxW (q_point);\r
+ }\r
+\r
+ cell_b (i)\r
+ +=\r
+ fe_values.shape_value (i, q_point)\r
+ *\r
+ fe_values.JxW (q_point);\r
+ }\r
+\r
cell->get_dof_indices (local_dof_indices);\r
- \r
+\r
constraints.distribute_local_to_global (cell_A, local_dof_indices, A);\r
constraints.distribute_local_to_global (cell_b, local_dof_indices, b);\r
}\r
- \r
+\r
A.compress (VectorOperation::add);\r
b.compress (VectorOperation::add);\r
}\r
deallog.depth_console (0);\r
LaplaceProblem problem;\r
problem.run ();\r
- deallog << "OK" << std::endl;\r
+ deallog << "OK" << std::endl;\r
}\r
}\r
\r
public:\r
LaplaceEigenspectrumProblem ();\r
void run ();\r
- \r
+\r
private:\r
void setup_system ();\r
void assemble_system ();\r
void solve ();\r
- \r
+\r
Triangulation<2> triangulation;\r
FE_Q<2> fe;\r
DoFHandler<2> dof_handler;\r
- \r
+\r
PETScWrappers::SparseMatrix A, B;\r
std::vector<PETScWrappers::Vector> x;\r
- std::vector<double> lambda; \r
+ std::vector<double> lambda;\r
ConstraintMatrix constraints;\r
\r
TableHandler output_table;\r
void LaplaceEigenspectrumProblem::setup_system ()\r
{\r
dof_handler.distribute_dofs (fe);\r
- \r
+\r
constraints.clear ();\r
DoFTools::make_zero_boundary_constraints (dof_handler, constraints);\r
constraints.close ();\r
- \r
+\r
A.reinit (dof_handler.n_dofs(), dof_handler.n_dofs(),\r
- dof_handler.max_couplings_between_dofs());\r
+ dof_handler.max_couplings_between_dofs());\r
B.reinit (dof_handler.n_dofs(), dof_handler.n_dofs(),\r
- dof_handler.max_couplings_between_dofs());\r
- \r
+ dof_handler.max_couplings_between_dofs());\r
+\r
x.resize (1);\r
x[0].reinit (dof_handler.n_dofs ());\r
lambda.resize (1);\r
void LaplaceEigenspectrumProblem::assemble_system ()\r
{\r
QGauss<2> quadrature_formula(2);\r
- \r
+\r
FEValues<2> fe_values (fe, quadrature_formula,\r
- update_values | \r
- update_gradients |\r
- update_quadrature_points | \r
- update_JxW_values);\r
- \r
+ update_values |\r
+ update_gradients |\r
+ update_quadrature_points |\r
+ update_JxW_values);\r
+\r
const unsigned int dofs_per_cell = fe.dofs_per_cell;\r
const unsigned int n_q_points = quadrature_formula.size();\r
- \r
+\r
FullMatrix<double> cell_A (dofs_per_cell, dofs_per_cell);\r
FullMatrix<double> cell_B (dofs_per_cell, dofs_per_cell);\r
- \r
+\r
std::vector<types::global_dof_index> local_dof_indices (dofs_per_cell);\r
- \r
+\r
typename DoFHandler<2>::active_cell_iterator\r
- cell = dof_handler.begin_active (),\r
- endc = dof_handler.end ();\r
- \r
+ cell = dof_handler.begin_active (),\r
+ endc = dof_handler.end ();\r
+\r
for (; cell!=endc; ++cell)\r
{\r
fe_values.reinit (cell);\r
cell_A = 0;\r
cell_B = 0;\r
- \r
+\r
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)\r
- for (unsigned int i=0; i<dofs_per_cell; ++i)\r
- for (unsigned int j=0; j<dofs_per_cell; ++j)\r
- {\r
- cell_A (i, j)\r
- += \r
- fe_values.shape_grad (i, q_point) *\r
- fe_values.shape_grad (j, q_point)\r
- * \r
- fe_values.JxW (q_point);\r
- \r
- cell_B (i, j)\r
- += \r
- fe_values.shape_value (i, q_point) *\r
- fe_values.shape_value (j, q_point)\r
- * \r
- fe_values.JxW (q_point);\r
- }\r
- \r
+ for (unsigned int i=0; i<dofs_per_cell; ++i)\r
+ for (unsigned int j=0; j<dofs_per_cell; ++j)\r
+ {\r
+ cell_A (i, j)\r
+ +=\r
+ fe_values.shape_grad (i, q_point) *\r
+ fe_values.shape_grad (j, q_point)\r
+ *\r
+ fe_values.JxW (q_point);\r
+\r
+ cell_B (i, j)\r
+ +=\r
+ fe_values.shape_value (i, q_point) *\r
+ fe_values.shape_value (j, q_point)\r
+ *\r
+ fe_values.JxW (q_point);\r
+ }\r
+\r
cell->get_dof_indices (local_dof_indices);\r
- \r
+\r
constraints.distribute_local_to_global (cell_A, local_dof_indices, A);\r
constraints.distribute_local_to_global (cell_B, local_dof_indices, B);\r
}\r
- \r
+\r
A.compress (VectorOperation::add);\r
B.compress (VectorOperation::add);\r
}\r
TableHandler output_table;
- double last_error;
+ double last_error;
};
};
AssertThrow (last_error<1e-3, ExcMessage("solution is not converging"));
-
-
-
+
+
+
output_table.set_precision("|u|_1", 6);
output_table.set_precision("error", 6);
output_table.write_text (std::cout);
struct copy_data
{
- int value;
+ int value;
};
void assemble(const std::vector<int>::iterator &it,
- scratch_data &scratch,
- copy_data &data)
+ scratch_data &scratch,
+ copy_data &data)
{
data.value = (*it);
}
-void copy(int & value, const copy_data &data)
+void copy(int &value, const copy_data &data)
{
value += data.value;
}
{
const int maxi = 10000;
std::vector<int> v(maxi);
- for (unsigned int i=0;i<v.size();++i)
+ for (unsigned int i=0; i<v.size(); ++i)
v[i] = i+1;
int result = 0;
WorkStream::run(v.begin(),
- v.end(),
- &assemble,
- std_cxx11::bind(©,
- std_cxx11::ref(result),
- std_cxx11::_1),
- scratch_data(), copy_data());
+ v.end(),
+ &assemble,
+ std_cxx11::bind(©,
+ std_cxx11::ref(result),
+ std_cxx11::_1),
+ scratch_data(), copy_data());
std::cout << "result: " << result << std::endl;
if (result != maxi*(maxi+1)/2)
if (c1->vertex_index(v) != c2->vertex_index(v))
return false;
}
-
+
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
{
if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
return false;
- if (c1->face(f)->manifold_id() != c2->face(f)->manifold_id())
- return false;
+ if (c1->face(f)->manifold_id() != c2->face(f)->manifold_id())
+ return false;
if (c1->face(f)->at_boundary())
{
if (c1->user_flag_set() != c2->user_flag_set())
return false;
- if (c1->manifold_id() != c2->manifold_id())
- return false;
+ if (c1->manifold_id() != c2->manifold_id())
+ return false;
- if (c1->active() && c2->active())
- if (c1->active_cell_index() != c2->active_cell_index())
- return false;
+ if (c1->active() && c2->active())
+ if (c1->active_cell_index() != c2->active_cell_index())
+ return false;
- if (c1->level()>0)
- if (c1->parent_index() != c2->parent_index())
- return false;
+ if (c1->level()>0)
+ if (c1->parent_index() != c2->parent_index())
+ return false;
}
// also check the order of raw iterators as they contain
c1 = t1.begin();
for (; c1 != t1.end(); ++c1)
for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
- if (c1->at_boundary(f)) {
- c1->face(f)->set_boundary_id (42);
- // c1->face(f)->set_manifold_id (43);
- }
+ if (c1->at_boundary(f))
+ {
+ c1->face(f)->set_boundary_id (42);
+ // c1->face(f)->set_manifold_id (43);
+ }
}
{
if (c1->face(f)->at_boundary() != c2->face(f)->at_boundary())
return false;
-
- if (c1->face(f)->manifold_id() != c2->face(f)->manifold_id())
- return false;
+
+ if (c1->face(f)->manifold_id() != c2->face(f)->manifold_id())
+ return false;
if (c1->face(f)->at_boundary())
{
if (c1->user_flag_set() != c2->user_flag_set())
return false;
-
- if (c1->manifold_id() != c2->manifold_id())
- return false;
- if (c1->active() && c2->active())
- if (c1->active_cell_index() != c2->active_cell_index())
- return false;
+ if (c1->manifold_id() != c2->manifold_id())
+ return false;
+
+ if (c1->active() && c2->active())
+ if (c1->active_cell_index() != c2->active_cell_index())
+ return false;
- if (c1->level()>0)
- if (c1->parent_index() != c2->parent_index())
- return false;
+ if (c1->level()>0)
+ if (c1->parent_index() != c2->parent_index())
+ return false;
}
// also check the order of raw iterators as they contain
for (typename Triangulation<dim>::active_cell_iterator
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell)
- {
- if (flags[index])
- cell->set_refine_flag();
- ++index;
- }
+ {
+ if (flags[index])
+ cell->set_refine_flag();
+ ++index;
+ }
Assert (index <= triangulation.n_active_cells(), ExcInternalError());
for (typename Triangulation<dim>::active_cell_iterator
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell)
- {
- if (!flags[index])
- cell->set_coarsen_flag();
- ++index;
- }
+ {
+ if (!flags[index])
+ cell->set_coarsen_flag();
+ ++index;
+ }
triangulation.execute_coarsening_and_refinement ();
dof_handler.distribute_dofs (fe);
deallog
- << "n_dofs: " << dof_handler.n_dofs() << std::endl
- << "n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() << std::endl;
+ << "n_dofs: " << dof_handler.n_dofs() << std::endl
+ << "n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() << std::endl;
deallog << "n_locally_owned_dofs_per_processor: ";
std::vector<types::global_dof_index> v = dof_handler.n_locally_owned_dofs_per_processor();
unsigned int sum = 0;
- for (unsigned int i=0;i<v.size();++i)
+ for (unsigned int i=0; i<v.size(); ++i)
{
deallog << v[i] << " ";
sum += v[i];
IndexSet all (N);
for (unsigned int i=0;
- i<dof_handler.locally_owned_dofs_per_processor().size(); ++i)
+ i<dof_handler.locally_owned_dofs_per_processor().size(); ++i)
{
IndexSet intersect = all & dof_handler.locally_owned_dofs_per_processor()[i];
Assert(intersect.n_elements()==0, ExcInternalError());
for (typename Triangulation<dim>::active_cell_iterator
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell)
- {
- if (flags[index])
- cell->set_refine_flag();
- ++index;
- }
+ {
+ if (flags[index])
+ cell->set_refine_flag();
+ ++index;
+ }
Assert (index <= triangulation.n_active_cells(), ExcInternalError());
for (typename Triangulation<dim>::active_cell_iterator
cell = triangulation.begin_active();
cell != triangulation.end(); ++cell)
- {
- if (!flags[index])
- cell->set_coarsen_flag();
- ++index;
- }
+ {
+ if (!flags[index])
+ cell->set_coarsen_flag();
+ ++index;
+ }
triangulation.execute_coarsening_and_refinement ();
dof_handler.distribute_dofs (fe);
- DoFRenumbering::component_wise(dof_handler);
+ DoFRenumbering::component_wise(dof_handler);
deallog
- << "n_dofs: " << dof_handler.n_dofs() << std::endl
- << "n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() << std::endl;
+ << "n_dofs: " << dof_handler.n_dofs() << std::endl
+ << "n_locally_owned_dofs: " << dof_handler.n_locally_owned_dofs() << std::endl;
deallog << "n_locally_owned_dofs_per_processor: ";
std::vector<types::global_dof_index> v = dof_handler.n_locally_owned_dofs_per_processor();
unsigned int sum = 0;
- for (unsigned int i=0;i<v.size();++i)
+ for (unsigned int i=0; i<v.size(); ++i)
{
deallog << v[i] << " ";
sum += v[i];
IndexSet all (N);
for (unsigned int i=0;
- i<dof_handler.locally_owned_dofs_per_processor().size(); ++i)
+ i<dof_handler.locally_owned_dofs_per_processor().size(); ++i)
{
IndexSet intersect = all & dof_handler.locally_owned_dofs_per_processor()[i];
Assert(intersect.n_elements()==0, ExcInternalError());
template <int dim, int spacedim>
void write_mesh (const parallel::shared::Triangulation<dim,spacedim> &tria,
- const char *filename_)
+ const char *filename_)
{
- DataOut<dim> data_out;
- data_out.attach_triangulation (tria);
- Vector<float> subdomain (tria.n_active_cells());
- for (unsigned int i=0; i<subdomain.size(); ++i)
- subdomain(i) = tria.locally_owned_subdomain();
- data_out.add_data_vector (subdomain, "subdomain");
-
- data_out.build_patches ();
- const std::string filename = (filename_ +
- Utilities::int_to_string
- (tria.locally_owned_subdomain(), 4));
- {
- std::ofstream output ((filename + ".vtu").c_str());
- data_out.write_vtu (output);
- }
+ DataOut<dim> data_out;
+ data_out.attach_triangulation (tria);
+ Vector<float> subdomain (tria.n_active_cells());
+ for (unsigned int i=0; i<subdomain.size(); ++i)
+ subdomain(i) = tria.locally_owned_subdomain();
+ data_out.add_data_vector (subdomain, "subdomain");
+
+ data_out.build_patches ();
+ const std::string filename = (filename_ +
+ Utilities::int_to_string
+ (tria.locally_owned_subdomain(), 4));
+ {
+ std::ofstream output ((filename + ".vtu").c_str());
+ data_out.write_vtu (output);
+ }
}
tr.execute_coarsening_and_refinement ();
deallog
- << " locally_owned_subdomain(): " << tr.locally_owned_subdomain() << "\n"
- << " n_active_cells: " << tr.n_active_cells() << "\n"
- << " n_levels: " << tr.n_levels() << "\n"
- << " n_global_levels: " << tr.n_global_levels() << "\n"
- //<< " n_locally_owned_active_cells: " << tr.n_locally_owned_active_cells() << "\n"
- //<< " n_global_active_cells: " << tr.n_global_active_cells() << "\n"
- << std::endl;
+ << " locally_owned_subdomain(): " << tr.locally_owned_subdomain() << "\n"
+ << " n_active_cells: " << tr.n_active_cells() << "\n"
+ << " n_levels: " << tr.n_levels() << "\n"
+ << " n_global_levels: " << tr.n_global_levels() << "\n"
+ //<< " n_locally_owned_active_cells: " << tr.n_locally_owned_active_cells() << "\n"
+ //<< " n_global_active_cells: " << tr.n_global_active_cells() << "\n"
+ << std::endl;
/*deallog << "n_locally_owned_active_cells_per_processor: ";
std::vector<unsigned int> v = tr.n_locally_owned_active_cells_per_processor();
m.copy_from(m2);
m.add(-1., m2);
-
+
deallog << std::endl << "Frobenius norm: " << m.frobenius_norm() << std::endl;
deallog << "OK" << std::endl;
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
- Assembly::Copy::Data (),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe_collection, quadrature_collection),
+ Assembly::Copy::Data (),
+ 2*MultithreadInfo::n_threads(),
+ 1);
test_matrix.compress(VectorOperation::add);
test_rhs.compress(VectorOperation::add);
CellFilter begin(IteratorFilters::LocallyOwnedCell(),dof_handler.begin_active());
CellFilter end(IteratorFilters::LocallyOwnedCell(),dof_handler.end());
graph = GraphColoring::make_graph_coloring(begin,end,
- static_cast<std_cxx11::function<std::vector<types::global_dof_index>
- (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
- (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
+ static_cast<std_cxx11::function<std::vector<types::global_dof_index>
+ (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
+ (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
IndexSet locally_owned = dof_handler.locally_owned_dofs();
{
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe, quadrature),
- Assembly::Copy::Data (false),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe, quadrature),
+ Assembly::Copy::Data (false),
+ 2*MultithreadInfo::n_threads(),
+ 1);
test_matrix.compress(VectorOperation::add);
test_rhs.compress(VectorOperation::add);
CellFilter begin(IteratorFilters::LocallyOwnedCell(),dof_handler.begin_active());
CellFilter end(IteratorFilters::LocallyOwnedCell(),dof_handler.end());
graph = GraphColoring::make_graph_coloring(begin,end,
- static_cast<std_cxx11::function<std::vector<types::global_dof_index>
- (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
- (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
+ static_cast<std_cxx11::function<std::vector<types::global_dof_index>
+ (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
+ (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
IndexSet locally_owned = dof_handler.locally_owned_dofs();
{
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe, quadrature),
- Assembly::Copy::Data (false),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe, quadrature),
+ Assembly::Copy::Data (false),
+ 2*MultithreadInfo::n_threads(),
+ 1);
test_matrix.compress(VectorOperation::add);
test_rhs.compress(VectorOperation::add);
test_matrix.compress(VectorOperation::add);
CellFilter begin(IteratorFilters::LocallyOwnedCell(),dof_handler.begin_active());
CellFilter end(IteratorFilters::LocallyOwnedCell(),dof_handler.end());
graph = GraphColoring::make_graph_coloring(begin,end,
- static_cast<std_cxx11::function<std::vector<types::global_dof_index>
- (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
- (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
+ static_cast<std_cxx11::function<std::vector<types::global_dof_index>
+ (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
+ (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
TrilinosWrappers::BlockSparsityPattern csp(2,2);
std::vector<IndexSet> locally_owned(2), relevant_set(2);
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe, quadrature),
- Assembly::Copy::Data (false),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe, quadrature),
+ Assembly::Copy::Data (false),
+ 2*MultithreadInfo::n_threads(),
+ 1);
test_matrix.compress(VectorOperation::add);
test_rhs.compress(VectorOperation::add);
CellFilter begin(IteratorFilters::LocallyOwnedCell(),dof_handler.begin_active());
CellFilter end(IteratorFilters::LocallyOwnedCell(),dof_handler.end());
graph = GraphColoring::make_graph_coloring(begin,end,
- static_cast<std_cxx11::function<std::vector<types::global_dof_index>
- (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
- (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
+ static_cast<std_cxx11::function<std::vector<types::global_dof_index>
+ (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
+ (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
IndexSet locally_owned = dof_handler.locally_owned_dofs();
{
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe, quadrature),
- Assembly::Copy::Data (false),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe, quadrature),
+ Assembly::Copy::Data (false),
+ 2*MultithreadInfo::n_threads(),
+ 1);
test_matrix.compress(VectorOperation::add);
test_rhs.compress(VectorOperation::add);
CellFilter begin(IteratorFilters::LocallyOwnedCell(),dof_handler.begin_active());
CellFilter end(IteratorFilters::LocallyOwnedCell(),dof_handler.end());
graph = GraphColoring::make_graph_coloring(begin,end,
- static_cast<std_cxx11::function<std::vector<types::global_dof_index>
- (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
- (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
+ static_cast<std_cxx11::function<std::vector<types::global_dof_index>
+ (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
+ (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
TrilinosWrappers::BlockSparsityPattern csp(2,2);
std::vector<IndexSet> locally_owned(2), relevant_set(2);
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe, quadrature),
- Assembly::Copy::Data (false),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe, quadrature),
+ Assembly::Copy::Data (false),
+ 2*MultithreadInfo::n_threads(),
+ 1);
test_matrix.compress(VectorOperation::add);
test_rhs.compress(VectorOperation::add);
CellFilter begin(IteratorFilters::LocallyOwnedCell(),dof_handler.begin_active());
CellFilter end(IteratorFilters::LocallyOwnedCell(),dof_handler.end());
graph = GraphColoring::make_graph_coloring(begin,end,
- static_cast<std_cxx11::function<std::vector<types::global_dof_index>
- (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
- (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
+ static_cast<std_cxx11::function<std::vector<types::global_dof_index>
+ (FilteredIterator<typename DoFHandler<dim>::active_cell_iterator> const &)> >
+ (std_cxx11::bind(&LaplaceProblem<dim>::get_conflict_indices, this,std_cxx11::_1)));
IndexSet locally_owned = dof_handler.locally_owned_dofs();
{
fe_values.shape_grad(j,q_point) *
fe_values.JxW(q_point));
- data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
- rhs_value *
- fe_values.JxW(q_point));
+ data.local_rhs(i) += (fe_values.shape_value(i,q_point) *
+ rhs_value *
+ fe_values.JxW(q_point));
}
}
test_rhs = 0;
WorkStream::
- run (graph,
- std_cxx11::bind (&LaplaceProblem<dim>::
- local_assemble,
- this,
- std_cxx11::_1,
- std_cxx11::_2,
- std_cxx11::_3),
- std_cxx11::bind (&LaplaceProblem<dim>::
- copy_local_to_global,
- this,
- std_cxx11::_1),
- Assembly::Scratch::Data<dim>(fe, quadrature),
- Assembly::Copy::Data (false),
- 2*MultithreadInfo::n_threads(),
- 1);
+ run (graph,
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ local_assemble,
+ this,
+ std_cxx11::_1,
+ std_cxx11::_2,
+ std_cxx11::_3),
+ std_cxx11::bind (&LaplaceProblem<dim>::
+ copy_local_to_global,
+ this,
+ std_cxx11::_1),
+ Assembly::Scratch::Data<dim>(fe, quadrature),
+ Assembly::Copy::Data (false),
+ 2*MultithreadInfo::n_threads(),
+ 1);
test_matrix.compress(VectorOperation::add);
test_matrix.compress(VectorOperation::add);
test_rhs.compress(VectorOperation::add);
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
{
const unsigned int deg = info.fe_values(0).get_fe().degree;
LocalIntegrators::Laplace
- ::nitsche_matrix(dinfo.matrix(0,false).matrix, info.fe_values(0),
- LocalIntegrators::Laplace::
- compute_penalty(dinfo, dinfo, deg, deg));
+ ::nitsche_matrix(dinfo.matrix(0,false).matrix, info.fe_values(0),
+ LocalIntegrators::Laplace::
+ compute_penalty(dinfo, dinfo, deg, deg));
}
template <int dim>
{
const unsigned int deg = info1.fe_values(0).get_fe().degree;
LocalIntegrators::Laplace
- ::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
- dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
- info1.fe_values(0), info2.fe_values(0),
- LocalIntegrators::Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
+ ::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
+ dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
+ info1.fe_values(0), info2.fe_values(0),
+ LocalIntegrators::Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
}
dof_handler.end(),
dof_info, info_box,
integrator, assembler);
-
+
system_matrix.compress(VectorOperation::add);
for (unsigned int i=0; i<system_rhs.size(); ++i)
{
const unsigned int deg = info.fe_values(0).get_fe().degree;
LocalIntegrators::Laplace
- ::nitsche_matrix(dinfo.matrix(0,false).matrix, info.fe_values(0),
- LocalIntegrators::Laplace::
- compute_penalty(dinfo, dinfo, deg, deg));
+ ::nitsche_matrix(dinfo.matrix(0,false).matrix, info.fe_values(0),
+ LocalIntegrators::Laplace::
+ compute_penalty(dinfo, dinfo, deg, deg));
}
template <int dim>
{
const unsigned int deg = info1.fe_values(0).get_fe().degree;
LocalIntegrators::Laplace
- ::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
- dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
- info1.fe_values(0), info2.fe_values(0),
- LocalIntegrators::Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
+ ::ip_matrix(dinfo1.matrix(0,false).matrix, dinfo1.matrix(0,true).matrix,
+ dinfo2.matrix(0,true).matrix, dinfo2.matrix(0,false).matrix,
+ info1.fe_values(0), info2.fe_values(0),
+ LocalIntegrators::Laplace::compute_penalty(dinfo1, dinfo2, deg, deg));
}
dof_handler.end(),
dof_info, info_box,
integrator, assembler);
-
+
system_matrix.compress(VectorOperation::add);
for (unsigned int i=0; i<system_rhs.size(); ++i)
check_solver_within_range(
solver.solve (system_matrix, solution, system_rhs,
- preconditioner),
+ preconditioner),
solver_control.last_step(), 18, 32);
}
deallog.pop();
preconditioner.initialize(system_matrix);
check_solver_within_range(
solver.solve (system_matrix, solution, system_rhs,
- preconditioner),
+ preconditioner),
solver_control.last_step(), 31, 33);
}
deallog.pop();
preconditioner.initialize(preconditioner_matrix);
check_solver_within_range(
solver.solve (system_matrix, solution, system_rhs,
- preconditioner),
+ preconditioner),
solver_control.last_step(), 24, 38);
}
deallog.pop();
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
template<class SOLVER, class MATRIX, class VECTOR, class PRECONDITION>
void
check_solve( SOLVER &solver,
- const SolverControl &solver_control,
- const MATRIX &A,
+ const SolverControl &solver_control,
+ const MATRIX &A,
VECTOR &u, VECTOR &f, const PRECONDITION &P)
{
deallog << "Solver type: " << typeid(solver).name() << std::endl;
fe (FE_Q<dim>(degree+1), dim,
FE_Q<dim>(degree) , 1),
dof_handler (triangulation)
-{}
+ {}
new_constraints.close();
{
TrilinosWrappers::BlockSparsityPattern bsp
- (owned_partitioning, owned_partitioning,
- relevant_partitioning, mpi_communicator);
+ (owned_partitioning, owned_partitioning,
+ relevant_partitioning, mpi_communicator);
DoFTools::make_sparsity_pattern (dof_handler, bsp,
- new_constraints,
- false, Utilities::MPI::this_mpi_process(mpi_communicator));
+ new_constraints,
+ false, Utilities::MPI::this_mpi_process(mpi_communicator));
bsp.compress();
}
template <int dim>
class Ref : public Function<dim>
{
- public:
- Ref()
- :Function<dim>(dim)
- {}
-
- double value (const Point<dim> &p, const unsigned int c) const
- {
- if (c==0)
- return p[0]+p[1]+((dim==3)?p[2]:0.0);
- if (c==1)
- return p[0]*p[0]+p[1]*p[1];
- if (c==2)
- return p[2]+p[0]*p[1];
- }
+public:
+ Ref()
+ :Function<dim>(dim)
+ {}
+
+ double value (const Point<dim> &p, const unsigned int c) const
+ {
+ if (c==0)
+ return p[0]+p[1]+((dim==3)?p[2]:0.0);
+ if (c==1)
+ return p[0]*p[0]+p[1]*p[1];
+ if (c==2)
+ return p[2]+p[0]*p[1];
+ }
};
Vector<double> solution (dofh.n_dofs ());
VectorTools::interpolate(dofh, Ref<dim>(), solution);
-
+
Vector<double> cellwise_errors (tria.n_active_cells());
VectorTools::integrate_difference (dofh,
- solution,
- ZeroFunction<dim>(dim),
- cellwise_errors,
- QGauss<dim>(5),
- norm);
-
+ solution,
+ ZeroFunction<dim>(dim),
+ cellwise_errors,
+ QGauss<dim>(5),
+ norm);
+
const double error = cellwise_errors.l2_norm();
const double difference = std::abs(error-value);
deallog << "computed: " << error
- << " expected: " << value
- << " difference: " << difference
- << std::endl;
+ << " expected: " << value
+ << " difference: " << difference
+ << std::endl;
Assert(difference<1e-10, ExcMessage("Error in integrate_difference"));
}