From: Martin Kronbichler Date: Fri, 26 Jun 2009 06:00:55 +0000 (+0000) Subject: Add a test for the output of inhomogeneous constraints. X-Git-Tag: v8.0.0~7580 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec1ffbf9e7ebccbb743de4303617a38b9b0a9fed;p=dealii.git Add a test for the output of inhomogeneous constraints. git-svn-id: https://svn.dealii.org/trunk@18974 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/lac/Makefile b/tests/lac/Makefile index 4fd1b76b01..9f3bf3e058 100644 --- a/tests/lac/Makefile +++ b/tests/lac/Makefile @@ -32,6 +32,7 @@ tests_x = vector-vector vector_memory \ compressed_simple_sparsity_pattern_* \ compressed_set_sparsity_pattern_* \ constraints_zero* \ + constraints_inhomogeneous \ constraint_graph_zero \ sparse_matrices matrices \ block_sparsity_pattern_01 \ diff --git a/tests/lac/constraints_inhomogeneous.cc b/tests/lac/constraints_inhomogeneous.cc new file mode 100644 index 0000000000..815b2585db --- /dev/null +++ b/tests/lac/constraints_inhomogeneous.cc @@ -0,0 +1,68 @@ +//----------------------- constraints_inhomogeneous.cc ---------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 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. +// +//----------------------- constraints_inhomogeneous.cc ---------------------- + + +// test: set inhomogeneous constraints and indirectly apply those to other +// constrained nodes. + + +#include "../tests.h" +#include +#include + +#include + + +void test () +{ + + ConstraintMatrix cm; + + // an inhomogeneous constraint + cm.add_line (4); + cm.set_inhomogeneity (4, 3.14159); + + // a homogeneous constraint that is + // constrained to the inhomogeneous one + cm.add_line (1); + cm.add_entry (1, 2, 42.); + cm.add_entry (1, 4, 1.); + + // and a standard homogeneous constraint + cm.add_line (17); + cm.add_entry(17, 6, 2.); + cm.add_entry(17, 15, 3.); + + // a "singular" constraint + cm.add_line (3); + + // now close the constraint matrix + cm.close(); + + cm.print (deallog.get_file_stream()); +} + + +int main () +{ + std::ofstream logfile("constraints_inhomogeneous/output"); + logfile.precision(2); + + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test (); + + deallog << "OK" << std::endl; +} diff --git a/tests/lac/constraints_inhomogeneous/cmp/generic b/tests/lac/constraints_inhomogeneous/cmp/generic new file mode 100644 index 0000000000..eab77e690c --- /dev/null +++ b/tests/lac/constraints_inhomogeneous/cmp/generic @@ -0,0 +1,8 @@ + + 1 2: 42. + 1: 3.1 + 3 = 0 + 4 = 3.1 + 17 6: 2.0 + 17 15: 3.0 +DEAL::OK