#
# PARALUTION_INCLUDE_DIRS
# PARALUTION_LIBRARIES
-# PARALUTION_LINKER_FLAGS
#
SET_IF_EMPTY(PARALUTION_DIR "$ENV{PARALUTION_DIR}")
SET(PARALUTION_LIBRARIES
${PARALUTION_LIBRARY}
)
- SET(PARALUTION_LINKER_FLAGS
- ${PARALUTION_LINKER_FLAGS}
- )
MARK_AS_ADVANCED(PARALUTION_DIR)
ELSE()
template <typename Number>
- inline size_type Vector<Number>::size() const
+ inline std::size_t Vector<Number>::size() const
{
return static_cast<size_type>(local_vector.get_size());
}
{
Assert(size()==v.size(),ExcDimensionMismatch(size(),v.size()));
- local_vector.ScaleAdd(-1.,v.paralution_vector());
+ local_vector.ScaleAddScale(1.,v.paralution_vector(),-1.);
return *this;
}
template <typename Number>
inline void Vector<Number>::add(const Number s)
{
- Assert(Numbers::is_finite(s),ExcNumberNotFinite());
+ Assert(numbers::is_finite(s),ExcNumberNotFinite());
size_type size = local_vector.get_size();
for (size_type i=0; i<size; ++i)
template <typename Number>
inline Vector<Number>& Vector<Number>::operator*= (const Number factor)
{
- Assert(Numbers::is_finite(factor),ExcNumberNotFinite());
+ Assert(numbers::is_finite(factor),ExcNumberNotFinite());
local_vector.Scale(factor);
template <typename Number>
inline Vector<Number>& Vector<Number>::operator/= (const Number factor)
{
- Assert(Numbers::is_finite(factor),ExcNumberNotFinite());
+ Assert(numbers::is_finite(factor),ExcNumberNotFinite());
const Number inv_factor(1./factor);
- Assert(Numbers::is_finite(inv_factor),ExcNumberNotFinite());
+ Assert(numbers::is_finite(inv_factor),ExcNumberNotFinite());
local_vector.Scale(inv_factor);
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id: paralution_vector_01.cc 31349 2013-10-20 19:07:06Z maier $
+//
+// Copyright (C) 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.
+//
+// ---------------------------------------------------------------------
+
+
+// Test ParalutionWrappers::Vector constructor
+
+#include "../tests.h"
+#include <deal.II/lac/paralution_vector.h>
+#include "paralution.hpp"
+
+template <typename Number>
+void check()
+{
+ ParalutionWrappers::Vector<Number> vector_1;
+ ParalutionWrappers::Vector<Number> vector_2(100);
+
+ deallog << vector_1.size() <<std::endl;
+ deallog << vector_2.size() <<std::endl;
+}
+
+int main()
+{
+ paralution::init_paralution();
+
+ std::ofstream logfile("output");
+ deallog << std::fixed;
+ deallog << std::setprecision(0);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ check<int>();
+ check<float>();
+ check<double>();
+
+ paralution::stop_paralution();
+}
--- /dev/null
+
+DEAL::0
+DEAL::100
+DEAL::0
+DEAL::100
+DEAL::0
+DEAL::100
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id: paralution_vector_01.cc 31349 2013-10-20 19:07:06Z maier $
+//
+// Copyright (C) 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.
+//
+// ---------------------------------------------------------------------
+
+
+// Test copy constructor and access elements of ParalutionWrappers::Vector
+
+#include "../tests.h"
+#include <deal.II/lac/paralution_vector.h>
+#include "paralution.hpp"
+
+void check()
+{
+ ParalutionWrappers::Vector<double> vector(10);
+
+ for (unsigned int i=0; i<10; ++i)
+ vector[i] = i;
+
+ ParalutionWrappers::Vector<double> copy_vector(vector);
+
+ for (unsigned int i=0; i<10; ++i)
+ deallog << vector[i] << std::endl;
+
+ for (unsigned int i=0; i<10; ++i)
+ deallog << vector(i)-copy_vector(i) <<std::endl;
+}
+
+int main()
+{
+ paralution::init_paralution();
+
+ std::ofstream logfile("output");
+ deallog << std::fixed;
+ deallog << std::setprecision(0);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ check();
+
+ paralution::stop_paralution();
+}
--- /dev/null
+
+DEAL::0
+DEAL::1
+DEAL::2
+DEAL::3
+DEAL::4
+DEAL::5
+DEAL::6
+DEAL::7
+DEAL::8
+DEAL::9
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id: paralution_vector_03.cc 31349 2013-10-20 19:07:06Z maier $
+//
+// Copyright (C) 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.
+//
+// ---------------------------------------------------------------------
+
+
+// Test ParalutionWrappers::Vector iterator
+
+#include "../tests.h"
+#include <deal.II/lac/paralution_vector.h>
+#include "paralution.hpp"
+
+void check()
+{
+ ParalutionWrappers::Vector<double> vector(10);
+
+ ParalutionWrappers::Vector<double>::iterator it(vector.begin());
+ ParalutionWrappers::Vector<double>::iterator end_it(vector.end());
+
+ for (double i=0.; it!=end_it; ++it, i+=1.)
+ *it = i;
+
+ ParalutionWrappers::Vector<double>::iterator cit(vector.begin());
+ ParalutionWrappers::Vector<double>::iterator cend_it(vector.end());
+
+ for (; cit!=cend_it; ++cit)
+ deallog << *cit << std::endl;
+}
+
+int main()
+{
+ paralution::init_paralution();
+
+ std::ofstream logfile("output");
+ deallog << std::fixed;
+ deallog << std::setprecision(0);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ check();
+
+ paralution::stop_paralution();
+}
--- /dev/null
+
+DEAL::0.
+DEAL::1.
+DEAL::2.
+DEAL::3.
+DEAL::4.
+DEAL::5.
+DEAL::6.
+DEAL::7.
+DEAL::8.
+DEAL::9.
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id: paralution_vector_04.cc 31349 2013-10-20 19:07:06Z maier $
+//
+// Copyright (C) 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.
+//
+// ---------------------------------------------------------------------
+
+
+// Test reinit for ParalutionWrappers::Vector
+
+#include "../tests.h"
+#include <deal.II/lac/paralution_vector.h>
+#include "paralution.hpp"
+
+void check()
+{
+ ParalutionWrappers::Vector<double> vector(10);
+
+ for (unsigned int i=0; i<10; ++i)
+ vector[i] = i;
+
+ vector.reinit(5);
+
+ for (unsigned int i=0; i<5; ++i)
+ vector[i] = i;
+
+ for (unsigned int i=0; i<vector.size(); ++i)
+ deallog << vector[i] << std::endl;
+}
+
+int main()
+{
+ paralution::init_paralution();
+
+ std::ofstream logfile("output");
+ deallog << std::fixed;
+ deallog << std::setprecision(0);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ check();
+
+ paralution::stop_paralution();
+}
--- /dev/null
+
+DEAL::0
+DEAL::1
+DEAL::2
+DEAL::3
+DEAL::4
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id: paralution_vector_04.cc 31349 2013-10-20 19:07:06Z maier $
+//
+// Copyright (C) 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.
+//
+// ---------------------------------------------------------------------
+
+
+// Test for ParalutionWrappers::Vector operator*= operator/= operator+=
+// operator-=
+
+#include "../tests.h"
+#include <deal.II/lac/paralution_vector.h>
+#include "paralution.hpp"
+
+void check_1()
+{
+ ParalutionWrappers::Vector<double> vector(10);
+
+ for (unsigned int i=0; i<10; ++i)
+ vector[i] = i;
+
+ vector *= 10.;
+ vector /= 5.;
+
+ for (unsigned int i=0; i<10; ++i)
+ deallog << vector[i] << std::endl;
+}
+
+void check_2()
+{
+ ParalutionWrappers::Vector<double> vector_1(10);
+ ParalutionWrappers::Vector<double> vector_2(10);
+ ParalutionWrappers::Vector<double> vector_3(10);
+
+ for (unsigned int i=0; i<10; ++i)
+ {
+ vector_1[i] = i;
+ vector_2[i] = 10*i;
+ vector_3[i] = i;
+ }
+
+ vector_1 += vector_2;
+ vector_1 -= vector_3;
+
+ for (unsigned int i=0; i<10; ++i)
+ deallog << vector_1[i] << std::endl;
+}
+
+int main()
+{
+ paralution::init_paralution();
+
+ std::ofstream logfile("output");
+ deallog << std::fixed;
+ deallog << std::setprecision(0);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ check_1();
+ check_2();
+
+ paralution::stop_paralution();
+}
--- /dev/null
+
+DEAL::0
+DEAL::2
+DEAL::4
+DEAL::6
+DEAL::8
+DEAL::10
+DEAL::12
+DEAL::14
+DEAL::16
+DEAL::18
+DEAL::0
+DEAL::10
+DEAL::20
+DEAL::30
+DEAL::40
+DEAL::50
+DEAL::60
+DEAL::70
+DEAL::80
+DEAL::90
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id: paralution_vector_06.cc 31349 2013-10-20 19:07:06Z maier $
+//
+// Copyright (C) 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.
+//
+// ---------------------------------------------------------------------
+
+
+// Test add for ParalutionWrappers::Vector
+
+
+#include "../tests.h"
+#include <deal.II/lac/paralution_vector.h>
+#include "paralution.hpp"
+
+void check()
+{
+ ParalutionWrappers::Vector<double> vector(10);
+
+ for (unsigned int i=0; i<10; ++i)
+ vector[i] = i;
+
+ vector.add(5.);
+
+ for (unsigned int i=0; i<vector.size(); ++i)
+ deallog << vector[i] << std::endl;
+}
+
+int main()
+{
+ paralution::init_paralution();
+
+ std::ofstream logfile("output");
+ deallog << std::fixed;
+ deallog << std::setprecision(0);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ check();
+
+ paralution::stop_paralution();
+}
--- /dev/null
+
+DEAL::5
+DEAL::6
+DEAL::7
+DEAL::8
+DEAL::9
+DEAL::10
+DEAL::11
+DEAL::12
+DEAL::13
+DEAL::14