-
Notifications
You must be signed in to change notification settings - Fork 2
/
monopole.h
94 lines (56 loc) · 2.21 KB
/
monopole.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//
// @(#)monopole.h 1.1 misha1-09oct108
//
// Copyright (c) 2008 of Mikhail Tchernychev
// All rights reserved.
//
// Created: 09oct108 by misha
// Version: 09oct108 by misha
//
#ifndef MONOPOLE_H
#define MONOPILE_H
#include "magobject.h"
class CMagMonopole : public CMagObject {
public:
CMagMonopole();
virtual ~CMagMonopole();
// how to compute magnetic field and its derivatives
// x_obs, y_obs, z_obs - position of the observation point
// A, B, C - Earth's magnetic field direction coefficients
virtual double ComputeField(FIELDTYPE type, double * add_params, double x_obs, double y_obs, double z_obs,
double x0, double y0, double z0,
double A, double B, double C,
int data_pos);
virtual int GetLinearDerivatives(FIELDTYPE type, double * add_params, double * deriv, int size,
double * pos_deriv,
double x_obs, double y_obs, double z_obs,
double x0, double y0, double z0,
double A, double B, double C,
int data_pos, int * n_params, int * start = NULL);
virtual int GetNonLinearDerivatives(FIELDTYPE type, double * add_params, double * deriv, int size,
double * pos_deriv,
double x_obs, double y_obs, double z_obs,
double x0, double y0, double z0,
double A, double B, double C,
int data_pos, int * n_params, int * start = NULL);
virtual void DumpParameters(FILE * dat);
virtual int CanComputeField() { return 1; }
// computational functions
double ComputeTotalField(double * add_params, double x_obs, double y_obs, double z_obs,
double x0, double y0, double z0,
double A, double B, double C);
int GetTotalFieldLinearDerivatives(double * add_params, double * deriv, int size,
double * pos_deriv,
double x_obs, double y_obs, double z_obs,
double x0, double y0, double z0,
double A, double B, double C,
int * n_params, int * start = NULL);
int GetTotalFieldNonLinearDerivatives(double * add_params, double * deriv, int size,
double * pos_deriv,
double x_obs, double y_obs, double z_obs,
double x0, double y0, double z0,
double A, double B, double C,
int * n_params, int * start);
void DumpToXMLStream(std::ostream & str);
};
#endif