VM2D
1.12
Vortex methods for 2D flows simulation
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
v3D.cpp
Go to the documentation of this file.
1
/*--------------------------------*- VMlib -*----------------*---------------*\
2
| ## ## ## ## ## ## ## | | Version 1.12 |
3
| ## ## ### ### ## ## | VMlib: VM2D/VM3D Library | 2024/01/14 |
4
| ## ## ## # ## ## ## #### | Open Source Code *----------------*
5
| #### ## ## ## ## ## ## | https://www.github.com/vortexmethods/VM2D |
6
| ## ## ## #### ### #### | https://www.github.com/vortexmethods/VM3D |
7
| |
8
| Copyright (C) 2017-2024 Ilia Marchevsky |
9
*-----------------------------------------------------------------------------*
10
| File name: v3D.cpp |
11
| Info: Source code of VMlib |
12
| |
13
| This file is part of VMlib. |
14
| VMLib is free software: you can redistribute it and/or modify it |
15
| under the terms of the GNU General Public License as published by |
16
| the Free Software Foundation, either version 3 of the License, or |
17
| (at your option) any later version. |
18
| |
19
| VMlib is distributed in the hope that it will be useful, but WITHOUT |
20
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
21
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
22
| for more details. |
23
| |
24
| You should have received a copy of the GNU General Public License |
25
| along with VMlib. If not, see <http://www.gnu.org/licenses/>. |
26
\*---------------------------------------------------------------------------*/
27
28
37
#include "
v3D.h
"
38
39
using namespace
VMlib
;
40
41
//MPI_Datatype v3D::mpiv3D;
42
43
44
//Конструктор и приведение типа из numvector<double, 3>
45
v3D::v3D
(
const
numvector<double, 3>
& _r)
46
{
47
data
[0] = _r[0];
48
data
[1] = _r[1];
49
data
[2] = _r[2];
50
}
//v3D(...)
51
52
53
//Конструктор копирования
54
v3D::v3D
(
const
v3D
& _r)
55
{
56
data
[0] = _r[0];
57
data
[1] = _r[1];
58
data
[2] = _r[2];
59
}
//v3D(...)
60
61
62
//Конструктор инициализации списком
63
v3D::v3D
(
const
std::initializer_list<double>& z)
64
{
65
for
(
size_t
i = 0; i < 3; ++i)
66
data
[i] = *(z.begin() + i);
67
}
//v3D(...)
68
69
70
//Поворот вектора на произвольный угол против часовой стрелки (по умолчанию 90 градусов)
71
v3D
v3D::rotated
(
const
double
angle,
const
v3D
& axis)
const
72
{
75
76
v3D
res = *
this
;
77
//double cosa = cos(angle);
78
//double sina = sin(angle);
79
//
80
//res[0] = r[0] * cosa - r[1] * sina;
81
//res[1] = r[0] * sina + r[1] * cosa;
82
return
res;
83
}
//rotated(...)
84
85
86
// Cоздание MPI-описателя типа
87
//void v3D::CreateMpiType()
88
//{
89
// int len[1] = { 3 };
90
// MPI_Aint pos[1] = { 0 };
91
// MPI_Datatype typ[1] = { MPI_DOUBLE };
92
//
93
// MPI_Type_create_struct(1, len, pos, typ, &mpiv3D);
94
// MPI_Type_commit(&mpiv3D);
95
//
96
//}//CreateMpiType()
VMlib::numvector< double, 3 >
VMlib::numvector< double, 3 >::data
double data[n]
Definition:
numvector.h:98
v3D.h
Заголовочный файл с описанием класса v3D.
VMlib::v3D
Класс, опеделяющий двумерный вектор
Definition:
v3D.h:55
VMlib::v3D::v3D
v3D()
Пустой конструктор
Definition:
v3D.h:65
VMlib::v3D::rotated
v3D rotated(const double angle, const v3D &axis) const
Поворот вектора на произвольный угол против часовой стрелки (по умолчанию 90 градусов) ...
Definition:
v3D.cpp:71
VMlib
Definition:
Mechanics2D.h:47
VMlib
v3D
v3D.cpp
Generated by
1.8.11