-
Notifications
You must be signed in to change notification settings - Fork 2
/
magsegments.h
68 lines (44 loc) · 1.66 KB
/
magsegments.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
//
// @(#)magsegments.h 1.1 misha-15feb10
//
// Copyright (c) 2006 Geometrics, Inc.
//
// Created: 15feb106 by [email protected]
// Version: 15feb106 by [email protected]
//
#ifndef MAGSEGMENTS_H
#define MAGSEGMENTS_H
#include "magpipe.h"
// for CMagSnake: - sequence of pipe segments. X, Y, Z at each segment
#define X_SEG_POS(N) (3*(N))
#define Y_SEG_POS(N) (3*(N) + 1)
#define Z_SEG_POS(N) (3*(N) + 2)
class CMagSegments : public CMagObject {
protected:
CMagPipe * m_pSegment; // use to compute field
int m_nSegments; // number of segments
int m_nCurrentSegment;
double * m_pLinearDeriv;
void LoadSegment(int n);
public:
CMagSegments(int is_induced=0, int n_seg=2);
~CMagSegments();
int GetNSegments() { return m_nSegments; }
int GetNodes(double *pos, int size);
// 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 n_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 n_pos, int *n_params, int * start);
virtual int GetTotalLinearParams();
virtual void DumpParameters(FILE * dat);
virtual int CanComputeField() { return 1; }
};
#endif