From bb78159642efa26fff13dc63f9b716cec8c6a5d6 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Mon, 27 Apr 2009 17:12:05 +0000 Subject: [PATCH] Added mapping_q1_eulerian support git-svn-id: https://svn.dealii.org/trunk@18755 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/codim_one/mapping_q1_eulerian.cc | 90 ++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 tests/codim_one/mapping_q1_eulerian.cc diff --git a/tests/codim_one/mapping_q1_eulerian.cc b/tests/codim_one/mapping_q1_eulerian.cc new file mode 100644 index 0000000000..96219dc8be --- /dev/null +++ b/tests/codim_one/mapping_q1_eulerian.cc @@ -0,0 +1,90 @@ + +//---------------------------- template.cc --------------------------- +// $Id: testsuite.html 13373 2006-07-13 13:12:08Z kanschat $ +// Version: $Name$ +// +// Copyright (C) 2005, 2009 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------- template.cc --------------------------- + + +// computes points in real space starting from some quadrature points on the unit element + +#include "../tests.h" +#include +#include + +// all include files you need here + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +std::ofstream logfile("mapping_q1_eulerian/output"); + +template +void test(std::string filename) { + Triangulation tria; + DoFHandler shift_dh(tria); + FE_Q base_fe(1); + FESystem fe(base_fe, spacedim); + + GridIn gi; + gi.attach_triangulation (tria); + std::ifstream in (filename.c_str()); + gi.read_ucd (in); + + shift_dh.distribute_dofs(fe); + + Vector shift(shift_dh.n_dofs()); + + GridOut grid_out; + grid_out.set_flags (GridOutFlags::Ucd(true)); + grid_out.write_ucd (tria, logfile); + + QTrapez quad; + MappingQ1Eulerian,spacedim> mapping(shift, shift_dh); + + typename Triangulation::active_cell_iterator cell=tria.begin_active(), + endc=tria.end() ; + Point real; + Point unit; + for(;cell!=endc;++cell) + { + deallog< " << real << std::endl; + } + } + +} + +int main () +{ + deallog.attach(logfile); + deallog.depth_console(0); + + test<1,2>("grids/circle_1.inp"); + test<2,3>("grids/square.inp"); + test<2,3>("grids/sphere_1.inp"); + + return 0; +} + -- 2.39.5