-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_wendland.cpp
50 lines (42 loc) · 1.43 KB
/
test_wendland.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (C) 2021 Matthias Kirchhart and Paul Wilhelm
*
* This file is part of vlasovius.
*
* vlasovius is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3, or (at your option) any later
* version.
*
* vlasovius is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* vlasovius; see the file COPYING. If not see http://www.gnu.org/licenses.
*/
#include <fstream>
#include <iostream>
#include <armadillo>
#include <vlasovius/misc/stopwatch.h>
#include <vlasovius/kernels/wendland.h>
int main( int argc, char* argv[] )
{
using vlasovius::misc::stopwatch;
size_t N = 3000;
constexpr size_t dim = 2, k = 4;
vlasovius::kernels::wendland<dim,k> W;
arma::vec x( N+1 ), v(N+1);
for ( size_t i = 0; i <= N; ++i )
x(i) = -1.5 + (3.0/N)*i;
v = x;
stopwatch clock;
v = W( std::move(v) );
double elapsed = clock.elapsed();
std::cout << "Time for evaluating: " << elapsed << ".\n";
std::ofstream file( "test_wendland.txt" );
for ( size_t i = 0; i <= N; ++i )
file << x(i) << " " << v(i) << " " << W.integral(x(i)) << std::endl;
return 0;
}