From: Matthias Maier Date: Wed, 6 Jul 2016 20:25:15 +0000 (-0500) Subject: remove obsolete scripts X-Git-Tag: v8.5.0-rc1~879^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe64426157af8eb858b32d2c61d4b8bd887f832a;p=dealii.git remove obsolete scripts voted obsolete by minority decision (3 developers ;-) ) --- diff --git a/contrib/utilities/embedding.cc b/contrib/utilities/embedding.cc deleted file mode 100644 index b1998eefa7..0000000000 --- a/contrib/utilities/embedding.cc +++ /dev/null @@ -1,227 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2001 - 2013 by the deal.II authors -// -// This file is part of the deal.II library. -// -// The deal.II library is free software; you can use it, redistribute -// it, and/or modify it under the terms of the GNU Lesser General -// Public License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// The full text of the license can be found in the file LICENSE at -// the top level of the deal.II distribution. -// -// --------------------------------------------------------------------- - -// Author: Guido Kanschat - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Enter name of the finite element family here. - */ - -#define ELNAME "FE_DGP" -#define PUSH(k) FE_DGP q ## k (k);\ - elements.push_back (ElPair(&q ## k, "dgp" # k)) - - - -template -void compute_embedding (unsigned int degree, - Triangulation& tr_coarse, - Triangulation& tr_fine, - const FiniteElement& fe_coarse, - const FiniteElement& fe_fine, - const char* name) -{ - deallog.push(name); - - DoFHandler dof_coarse(tr_coarse); - dof_coarse.distribute_dofs(fe_coarse); - DoFHandler dof_fine(tr_fine); - dof_fine.distribute_dofs(fe_fine); - - FullMatrix A(dof_fine.n_dofs()); - Vector f(dof_fine.n_dofs()); - Vector u(dof_fine.n_dofs()); - vector > > - result(2< >(fe_coarse.dofs_per_cell, - vector(fe_fine.dofs_per_cell, 0.))); - - DoFHandler::active_cell_iterator coarse_cell - = dof_coarse.begin_active(); - vector indices(fe_fine.dofs_per_cell); - - MappingCartesian mapping; - QGauss q_fine(degree+1); - - FEValues fine (mapping, fe_fine, q_fine, - update_q_points - | update_JxW_values - | update_values); - - - DoFHandler::active_cell_iterator c; - - for (unsigned int coarse_no=0;coarse_noget_dof_indices(indices); - fine.reinit(c); - // Build mass matrix and RHS - - Quadrature q_coarse (fine.get_quadrature_points(), - fine.get_JxW_values()); - FEValues coarse (mapping, fe_coarse, q_coarse, - update_values); - coarse.reinit(coarse_cell); - - for (unsigned int k=0;k P(A.n()); - P.invert(A); - SolverControl control (100, 1.e-24, true, false); - PrimitiveVectorMemory > mem; - SolverRichardson > solver(control, mem); - solver.solve(A,u,f,P); - - unsigned int cell_i=0; - for (c = dof_fine.begin_active(); - c != dof_fine.end(); - ++c, ++cell_i) - { - c->get_dof_indices(indices); - for (unsigned int i=0;i 1.e-16) - ? (27.*u(indices[i])) : 0.; - } - } - - for (unsigned int cell=0;cell -void loop () -{ - char prefix[3]; - sprintf(prefix, "%dd", dim); - deallog.push(prefix); - - cout << "namespace " << ELNAME << "_" << dim << "d\n{"; - - Triangulation tr_coarse; - Triangulation tr_fine; - GridGenerator::hyper_cube (tr_coarse, 0, 1); - GridGenerator::hyper_cube (tr_fine, 0, 1); - tr_fine.refine_global(1); - - typedef pair*, const char*> ElPair ; - vector elements(0); - - /* - * List element degrees for - * computation here. - */ - PUSH(0); - PUSH(1); - PUSH(2); - PUSH(3); - PUSH(4); - PUSH(5); - PUSH(6); - - char* name = new char[100]; - - // Embed all lower spaces into - // higher or just the same degree - // on different grids. - bool same_degree_only = true; - - unsigned int n = elements.size(); - for (unsigned int i=0;i (); - loop<2> (); - loop<3> (); -} diff --git a/contrib/utilities/gridio.cc b/contrib/utilities/gridio.cc deleted file mode 100644 index 5940b74593..0000000000 --- a/contrib/utilities/gridio.cc +++ /dev/null @@ -1,80 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2001 - 2013 by the deal.II authors -// -// This file is part of the deal.II library. -// -// The deal.II library is free software; you can use it, redistribute -// it, and/or modify it under the terms of the GNU Lesser General -// Public License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// The full text of the license can be found in the file LICENSE at -// the top level of the deal.II distribution. -// -// --------------------------------------------------------------------- - -// Author: Guido Kanschat - -// A little program reading a grid *.inp and writing it to *.eps. -// Some more functionality should be added some time. - -#include -#include -#include - -#include -#include -#include - -#include - -using namespace std; - -template -void convert(const char* infile, - const char* outfile, - GridOut::OutputFormat oformat) -{ - Triangulation tr; - GridIn gin; - gin.attach_triangulation(tr); - gin.read(infile); - - GridOut gout; - GridOutFlags::DX dx_flags(true, true, true, false, true); - gout.set_flags(dx_flags); - - ofstream out(outfile); - gout.write(tr, out, oformat); -} - - -int main(int argc, char** argv) -{ - if (argc<4) - { - cerr << "Usage: " << argv[0] - << " dim infile outfile" << endl; - exit(1); - } - - const unsigned int d = atoi(argv[1]); - - std::string outstring(argv[3]); - GridOut::OutputFormat oformat = GridOut::eps; - - const unsigned int dotpos = outstring.find_last_of('.'); - if (dotpos < outstring.length()) - { - std::string ext = outstring.substr(dotpos+1); - if (ext == "inp") - ext = "ucd"; - - oformat = GridOut::parse_output_format(ext); - } - - if (d == 2) - convert<2>(argv[2], argv[3], oformat); - else if (d == 3) - convert<3>(argv[2], argv[3], oformat); -} diff --git a/contrib/utilities/interpolation.cc b/contrib/utilities/interpolation.cc deleted file mode 100644 index db25977c54..0000000000 --- a/contrib/utilities/interpolation.cc +++ /dev/null @@ -1,344 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2003 - 2013 by the deal.II authors -// -// This file is part of the deal.II library. -// -// The deal.II library is free software; you can use it, redistribute -// it, and/or modify it under the terms of the GNU Lesser General -// Public License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// The full text of the license can be found in the file LICENSE at -// the top level of the deal.II distribution. -// -// --------------------------------------------------------------------- - -// Author: Guido Kanschat - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -template -inline bool in_cube (const Point& p) -{ - if ((p(0) < -1e-10) || (p(0) > 1.000000001)) - return false; - if ((dim>1) && ((p(1) < -1e-10) || (p(1) > 1.000000001))) - return false; - if ((dim>2) && ((p(2) < -1e-10) || (p(2) > 1.000000001))) - return false; - return true; -} - -template -inline void -move_points (vector >& v, unsigned int i) -{ - Point p; - switch (dim) - { - case 1: - if (i) p(0) = -1.; - break; - case 2: - if ((i==1) || (i==2)) - p(0) = -1.; - if ((i==2) || (i==3)) - p(1) = -1.; - break; - case 3: - if ((i==1) || (i==2) || (i==5) || (i==6)) - p(0) = -1.; - if ((i==4) || (i==5) || (i==6) || (i==7)) - p(1) = -1.; - if ((i==2) || (i==3) || (i==6) || (i==7)) - p(2) = -1.; - break; - default: - Assert(false, ExcNotImplemented()); - } - for (unsigned int j=0;j -void compute_interpolation (Triangulation& tr_coarse, - Triangulation& tr_fine, - const FiniteElement& fe_coarse, - const FiniteElement& fe_fine, - const char* name) -{ - DoFHandler dof_coarse(tr_coarse); - dof_coarse.distribute_dofs(fe_coarse); - DoFHandler dof_fine(tr_fine); - dof_fine.distribute_dofs(fe_fine); - - vector > > - result(2< >(fe_coarse.dofs_per_cell, - vector(fe_fine.dofs_per_cell, 0.))); - - vector indices(fe_fine.dofs_per_cell); - - MappingQ1 mapping; - - vector > points; - fe_coarse.get_unit_support_points (points); - vector > q_points(points.size()); - vector dummy_weights(points.size(), 0.); - - // Coarse level cell of fine grid - DoFHandler::cell_iterator father = dof_fine.begin (0); - - for (unsigned int child_no = 0; child_no < GeometryInfo::children_per_cell; - ++child_no) - { - DoFHandler::active_cell_iterator c = father->child(child_no); - - c->get_dof_indices(indices); - // Evaluate at support points - // of father cell. - for (unsigned int i=0;i q_fine (q_points, dummy_weights); - - FEValues fine (mapping, fe_fine, q_fine, - update_values); - fine.reinit(c); - // Build mass matrix and RHS - - for (unsigned int k=0;k -void compute_projection (Triangulation& tr_coarse, - Triangulation& tr_fine, - const FiniteElement& fe_coarse, - const FiniteElement& fe_fine, - const char* name) -{ - DoFHandler dof_coarse(tr_coarse); - dof_coarse.distribute_dofs(fe_coarse); - DoFHandler dof_fine(tr_fine); - dof_fine.distribute_dofs(fe_fine); - DoFHandler::cell_iterator cell_coarse = dof_coarse.begin_active(); - - vector > > - result(2< >(fe_coarse.dofs_per_cell, - vector(fe_fine.dofs_per_cell, 0.))); - - vector indices(fe_fine.dofs_per_cell); - - MappingQ1 mapping; - QGauss quadrature (9); - FullMatrix mass (fe_coarse.dofs_per_cell); - - FEValues coarse (mapping, fe_coarse, quadrature, - update_values - | update_JxW_values); - coarse.reinit (cell_coarse); - - // Build coarse level mass matrix - for (unsigned int k=0;k inverse (fe_coarse.dofs_per_cell); - inverse.invert(mass); - Vector rhs (fe_coarse.dofs_per_cell); - Vector u (fe_coarse.dofs_per_cell); - - // Coarse level cell of fine grid - DoFHandler::cell_iterator father = dof_fine.begin (0); - - FEValues fine (mapping, fe_fine, quadrature, - update_values - | update_JxW_values - | update_q_points); - - // loop over all fine shape functions - for (unsigned int n=0;n::active_cell_iterator c = father->child(0); - - c->get_dof_indices(indices); - - fine.reinit(c); - - // Build a quadrature formula - // for the coarse cell - Quadrature q_coarse (fine.get_quadrature_points(), - fine.get_JxW_values()); - FEValues coarse (mapping, fe_coarse, q_coarse, - update_values); - coarse.reinit(cell_coarse); - // Build RHS - - for (unsigned int k=0;k q ## k(k);\ - elements.push_back (ElPair(&q ## k, "dgq" # k)) -#define PUSH_DGQ(k) FE_DGQ dgq ## k(k);\ - dgelements.push_back (ElPair(&dgq ## k, "dgq" # k)) - -template -void loop () -{ - Triangulation tr_coarse; - Triangulation tr_fine; - GridGenerator::hyper_cube (tr_coarse, 0, 1); - GridGenerator::hyper_cube (tr_fine, 0, 1); - tr_fine.refine_global(1); - - typedef pair*, const char*> ElPair ; - vector elements(0); - vector dgelements(0); - - PUSH_Q(1); - PUSH_Q(2); - PUSH_Q(3); - PUSH_Q(4); - PUSH_DGQ(0); - PUSH_DGQ(1); - PUSH_DGQ(2); - PUSH_DGQ(3); - PUSH_DGQ(4); - PUSH_DGQ(5); - PUSH_DGQ(6); - PUSH_DGQ(7); - - char* name = new char[100]; - - unsigned int n = elements.size(); - for (unsigned int i=0;i (); - loop<2> (); - loop<3> (); -} diff --git a/contrib/utilities/lagrange_basis b/contrib/utilities/lagrange_basis deleted file mode 100644 index 0d1de98a65..0000000000 --- a/contrib/utilities/lagrange_basis +++ /dev/null @@ -1,80 +0,0 @@ -## --------------------------------------------------------------------- -## -## Copyright (C) 2001 - 2013 by the deal.II authors -## -## This file is part of the deal.II library. -## -## The deal.II library is free software; you can use it, redistribute -## it, and/or modify it under the terms of the GNU Lesser General -## Public License as published by the Free Software Foundation; either -## version 2.1 of the License, or (at your option) any later version. -## The full text of the license can be found in the file LICENSE at -## the top level of the deal.II distribution. -## -## --------------------------------------------------------------------- - -# -# Author: Ralf Hartmann, 2001 -# - -# -# Maple script to compute the coefficients of the LagrangeEquidistant -# basis functions of degree p. These are used as shape functions for -# Qp elements. For higher p just change variable p in line 10. -# Call -# perl -p -e 's/ *t0 = (.*);\n/ $1/g;' lagrange_txt -# to get a c-code ready to be copied into the source codes. -# - - p := 10: - - n_functions := p+1: - - # first compute the support points - support_points := array(0..n_functions-1): - for i from 0 to n_functions-1 do - support_points[i] := i/(n_functions-1): - od; - - poly := array(0..n_functions-1): - - for i from 0 to n_functions-1 do - # note that the interp function wants vectors indexed from - # one and not from zero. - values := array(1..n_functions): - for j from 1 to n_functions do - values[j] := 0: - od: - values[i+1] := 1: - - shifted_support_points := array (1..n_functions): - for j from 1 to n_functions do - shifted_support_points[j] := support_points[j-1]: - od: - - poly[i] := interp (shifted_support_points, values, x): - od: - - readlib(C): - writeto(lagrange_output): - printf(` case %d:\n {\n static const double x%d[%d]=\n {`, p,p,(p+1)*(p+1)): - a := array(0..n_functions-1, 0..n_functions-1): - b := array(0..n_functions-1): - # a[i,j] is the jth coefficient of the ith base function. - for i from 0 to n_functions-1 do - for j from 0 to n_functions-1 do - b[j] := coeff(poly[i], x, j): - od: - C(b[0]): - for j from 1 to n_functions-1 do - printf(`,`): - C(b[j]): - od: - if (i