Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
common
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Alexander Lapshin
common
Commits
7270c794
Commit
7270c794
authored
Oct 01, 2020
by
Alexander Lapshin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
integrator options
parent
b34ad36c
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
41 deletions
+47
-41
PropInfoBase.cpp
utils/PropInfoBase.cpp
+8
-8
PropInfoBase.h
utils/PropInfoBase.h
+5
-3
Propagator.cpp
utils/Propagator.cpp
+10
-6
StateVector.h
utils/StateVector.h
+0
-4
integratorcfg.cpp
utils/integratorcfg.cpp
+14
-7
integratorcfg.h
utils/integratorcfg.h
+10
-13
No files found.
utils/PropInfoBase.cpp
View file @
7270c794
...
@@ -8,7 +8,7 @@ PropInfoBase::PropInfoBase(
...
@@ -8,7 +8,7 @@ PropInfoBase::PropInfoBase(
AtmModel
atmModel
,
AtmModel
atmModel
,
const
bool
sun
,
const
bool
sun
,
const
bool
moon
,
const
bool
moon
,
const
bool
prec_itrf
,
const
IntegratorCfg
&
icfg
,
const
int
type
)
const
int
type
)
:
:
m_atmModel
(
std
::
move
(
atmModel
)),
m_atmModel
(
std
::
move
(
atmModel
)),
...
@@ -17,7 +17,7 @@ PropInfoBase::PropInfoBase(
...
@@ -17,7 +17,7 @@ PropInfoBase::PropInfoBase(
m_sun
(
sun
),
m_sun
(
sun
),
m_moon
(
moon
),
m_moon
(
moon
),
m_type
(
type
),
m_type
(
type
),
m_
prec_itrf
(
prec_itrf
)
m_
integrator_cfg
(
icfg
)
{
{
}
}
...
@@ -44,9 +44,7 @@ bool PropInfoBase::Load(myXML::Contain* parent)
...
@@ -44,9 +44,7 @@ bool PropInfoBase::Load(myXML::Contain* parent)
LoadXML
(
con
,
"EarthModel"
,
m_earthModel
);
LoadXML
(
con
,
"EarthModel"
,
m_earthModel
);
LoadXML
(
con
,
"AtmModel"
,
m_atmModel
,
false
);
LoadXML
(
con
,
"AtmModel"
,
m_atmModel
,
false
);
LoadXML
(
con
,
"Id"
,
m_id
,
false
,
&
idloaded
);
LoadXML
(
con
,
"Id"
,
m_id
,
false
,
&
idloaded
);
m_integrator_cfg
.
Load
(
parent
);
m_prec_itrf
=
false
;
LoadXML
(
con
,
"prec_itrf"
,
m_prec_itrf
,
false
);
return
true
;
return
true
;
}
}
...
@@ -70,8 +68,7 @@ void PropInfoBase::load(const jsonval& parent)
...
@@ -70,8 +68,7 @@ void PropInfoBase::load(const jsonval& parent)
loadjson
(
parent
,
"earth"
,
m_earthModel
);
loadjson
(
parent
,
"earth"
,
m_earthModel
);
loadjson
(
parent
,
"atm"
,
m_atmModel
,
false
);
loadjson
(
parent
,
"atm"
,
m_atmModel
,
false
);
m_prec_itrf
=
false
;
m_integrator_cfg
.
load
(
parent
);
loadjson
(
parent
,
"prec_itrf"
,
m_prec_itrf
,
false
);
}
}
std
::
string
PropInfoBase
::
GetAsXML
()
const
std
::
string
PropInfoBase
::
GetAsXML
()
const
...
@@ -87,7 +84,10 @@ std::string PropInfoBase::GetAsXML() const
...
@@ -87,7 +84,10 @@ std::string PropInfoBase::GetAsXML() const
PutValue
(
outs
,
"Sun"
,
m_sun
);
PutValue
(
outs
,
"Sun"
,
m_sun
);
PutValue
(
outs
,
"Moon"
,
m_moon
);
PutValue
(
outs
,
"Moon"
,
m_moon
);
PutValue
(
outs
,
"LightModel"
,
m_lightModel
);
PutValue
(
outs
,
"LightModel"
,
m_lightModel
);
PutValue
(
outs
,
"prec_itrf"
,
m_prec_itrf
);
PutValue
(
outs
,
"integratorEps"
,
get_integrator_cfg
().
getEps
());
PutValue
(
outs
,
"integratorStepInit"
,
get_integrator_cfg
().
getStepInit
());
PutValue
(
outs
,
"integratorStepMin"
,
get_integrator_cfg
().
getStepMin
());
PutValue
(
outs
,
"prec_itrf"
,
get_integrator_cfg
().
getPrecItfr
());
outs
<<
"<EarthModel>"
;
outs
<<
"<EarthModel>"
;
PutValue
(
outs
,
"Model"
,
m_earthModel
.
GetModel
());
PutValue
(
outs
,
"Model"
,
m_earthModel
.
GetModel
());
...
...
utils/PropInfoBase.h
View file @
7270c794
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include "AtmModel.h"
#include "AtmModel.h"
#include "EarthModel.h"
#include "EarthModel.h"
#include "json_functions.h"
#include "json_functions.h"
#include "integratorcfg.h"
enum
proptypes
enum
proptypes
{
{
...
@@ -27,7 +28,7 @@ public:
...
@@ -27,7 +28,7 @@ public:
AtmModel
atmModel
,
AtmModel
atmModel
,
const
bool
sun
,
const
bool
sun
,
const
bool
moon
,
const
bool
moon
,
const
bool
prec_itrf
,
const
IntegratorCfg
&
icfg
,
const
int
type
);
const
int
type
);
bool
Load
(
myXML
::
Contain
*
parent
);
bool
Load
(
myXML
::
Contain
*
parent
);
...
@@ -35,12 +36,13 @@ public:
...
@@ -35,12 +36,13 @@ public:
bool
IsSun
()
const
{
return
m_sun
;
}
bool
IsSun
()
const
{
return
m_sun
;
}
bool
IsMoon
()
const
{
return
m_moon
;
}
bool
IsMoon
()
const
{
return
m_moon
;
}
int
GetType
()
const
{
return
m_type
;
}
int
GetType
()
const
{
return
m_type
;
}
bool
is_prec_itrf
()
const
{
return
m_prec_itrf
;
}
//
bool is_prec_itrf() const { return m_prec_itrf; }
const
AtmModel
&
GetAtmModel
()
const
{
return
m_atmModel
;
}
const
AtmModel
&
GetAtmModel
()
const
{
return
m_atmModel
;
}
const
EarthModel
&
GetEarthModel
()
const
{
return
m_earthModel
;
}
const
EarthModel
&
GetEarthModel
()
const
{
return
m_earthModel
;
}
std
::
string
GetLightModel
()
const
{
return
m_lightModel
;
}
std
::
string
GetLightModel
()
const
{
return
m_lightModel
;
}
std
::
string
GetAsXML
()
const
;
std
::
string
GetAsXML
()
const
;
void
ToXml
(
std
::
ostream
&
outs
)
const
;
void
ToXml
(
std
::
ostream
&
outs
)
const
;
const
IntegratorCfg
&
get_integrator_cfg
()
const
{
return
m_integrator_cfg
;
}
private
:
private
:
static
std
::
string
TypeConvert
(
int
value
)
;
static
std
::
string
TypeConvert
(
int
value
)
;
...
@@ -53,7 +55,7 @@ private:
...
@@ -53,7 +55,7 @@ private:
bool
m_moon
;
bool
m_moon
;
int
m_type
;
int
m_type
;
int
m_id
;
int
m_id
;
bool
m_prec_itrf
{
false
}
;
IntegratorCfg
m_integrator_cfg
;
};
};
typedef
std
::
map
<
int
,
PropInfoBase
>
PropInfoBases
;
typedef
std
::
map
<
int
,
PropInfoBase
>
PropInfoBases
;
...
...
utils/Propagator.cpp
View file @
7270c794
...
@@ -41,15 +41,22 @@ bool Propagator::Init(const PropInfoBase& propInfo, const SInitOrbit& initOrbit,
...
@@ -41,15 +41,22 @@ bool Propagator::Init(const PropInfoBase& propInfo, const SInitOrbit& initOrbit,
m_variates
=
variates
;
m_variates
=
variates
;
if
(
propInfo
.
GetType
()
==
ST_PROP
)
{
if
(
propInfo
.
GetType
()
==
ST_PROP
)
{
const
IntegratorCfg
&
icfg
=
initOrbit
.
GetIntegratorCfg
();
if
(
!
m_variates
)
{
if
(
!
m_variates
)
{
InitStPredictor
(
m_stPredictor
,
initOrbit
,
propInfo
);
InitStPredictor
(
m_stPredictor
,
initOrbit
,
propInfo
);
m_stPredictor
.
GetPredictor
()
->
SetAccuracy
(
icfg
.
getEps
(),
icfg
.
getStepInit
(),
icfg
.
getStepMin
(),
icfg
.
getPrecItfr
());
m_stPredictor
.
GetPredictor
()
->
SetAccuracy
(
propInfo
.
get_integrator_cfg
().
getEps
(),
propInfo
.
get_integrator_cfg
().
getStepInit
(),
propInfo
.
get_integrator_cfg
().
getStepMin
(),
propInfo
.
get_integrator_cfg
().
getPrecItfr
());
m_predictor
=
&
m_stPredictor
;
m_predictor
=
&
m_stPredictor
;
}
}
else
{
else
{
InitStvPredictor
(
m_stvPredictor
,
initOrbit
,
propInfo
);
InitStvPredictor
(
m_stvPredictor
,
initOrbit
,
propInfo
);
m_stvPredictor
.
GetPredictor
()
->
SetAccuracy
(
icfg
.
getEps
(),
icfg
.
getStepInit
(),
icfg
.
getStepMin
(),
icfg
.
getPrecItfr
());
m_stvPredictor
.
GetPredictor
()
->
SetAccuracy
(
propInfo
.
get_integrator_cfg
().
getEps
(),
propInfo
.
get_integrator_cfg
().
getStepInit
(),
propInfo
.
get_integrator_cfg
().
getStepMin
(),
propInfo
.
get_integrator_cfg
().
getPrecItfr
());
m_predictor
=
&
m_stvPredictor
;
m_predictor
=
&
m_stvPredictor
;
}
}
}
}
...
@@ -262,7 +269,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
...
@@ -262,7 +269,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
0
,
0
,
m_initOrbit
.
GetId
()
m_initOrbit
.
GetId
()
);
);
res
.
SetIntegratorCfg
(
m_initOrbit
.
GetIntegratorCfg
());
return
true
;
return
true
;
}
}
else
{
else
{
...
@@ -283,7 +289,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
...
@@ -283,7 +289,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
0
,
0
,
m_initOrbit
.
GetId
()
m_initOrbit
.
GetId
()
);
);
res
.
SetIntegratorCfg
(
m_initOrbit
.
GetIntegratorCfg
());
return
true
;
return
true
;
}
}
else
{
else
{
...
@@ -304,7 +309,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
...
@@ -304,7 +309,6 @@ bool Propagator::Propagate(const TimeJD& jd, SInitOrbit& res) const
0
,
0
,
m_initOrbit
.
GetId
()
m_initOrbit
.
GetId
()
);
);
res
.
SetIntegratorCfg
(
m_initOrbit
.
GetIntegratorCfg
());
return
true
;
return
true
;
}
}
else
{
else
{
...
...
utils/StateVector.h
View file @
7270c794
...
@@ -78,9 +78,6 @@ public:
...
@@ -78,9 +78,6 @@ public:
void
SetMotionModel
(
const
MotionModel
&
motionModel
);
void
SetMotionModel
(
const
MotionModel
&
motionModel
);
void
SetDate
(
const
TimeJD
&
date
);
void
SetDate
(
const
TimeJD
&
date
);
void
SetId
(
TOrbitId
id
)
{
m_id
=
id
;
}
void
SetId
(
TOrbitId
id
)
{
m_id
=
id
;
}
void
SetIntegratorCfg
(
const
IntegratorCfg
&
icfg
)
{
m_integratorCfg
=
icfg
;
}
const
IntegratorCfg
&
GetIntegratorCfg
()
const
{
return
m_integratorCfg
;
}
protected
:
protected
:
static
int
ParseSrcType
(
const
TOrbitId
&
id
);
static
int
ParseSrcType
(
const
TOrbitId
&
id
);
void
CreateFromKepler
(
const
KepData
&
kd
,
const
std
::
string
&
frame
);
void
CreateFromKepler
(
const
KepData
&
kd
,
const
std
::
string
&
frame
);
...
@@ -102,7 +99,6 @@ protected:
...
@@ -102,7 +99,6 @@ protected:
TOrbitId
m_id
;
TOrbitId
m_id
;
TOrbitId
m_baseid
;
TOrbitId
m_baseid
;
PropInfoBase
m_propInfo
;
PropInfoBase
m_propInfo
;
IntegratorCfg
m_integratorCfg
;
int
rev_
;
int
rev_
;
};
};
...
...
utils/integratorcfg.cpp
View file @
7270c794
#include "integratorcfg.h"
#include "integratorcfg.h"
#include "XMLFunctions.h"
void
IntegratorCfg
::
load
(
const
jsonval
&
parent
)
void
IntegratorCfg
::
load
(
const
jsonval
&
parent
)
{
{
m_eps
=
-
1
;
loadjson
(
parent
,
"eps"
,
m_eps
,
false
);
loadjson
(
parent
,
"eps"
,
m_eps
,
false
);
m_stepinit
=
-
1
;
loadjson
(
parent
,
"init_step"
,
m_stepinit
,
false
);
loadjson
(
parent
,
"init_step"
,
m_stepinit
,
false
);
m_stepmin
=
-
1
;
loadjson
(
parent
,
"min_step"
,
m_stepmin
,
false
);
loadjson
(
parent
,
"min_step"
,
m_stepmin
,
false
);
m_precItrf
=
false
;
loadjson
(
parent
,
"prec_itrf"
,
m_precItrf
,
false
);
loadjson
(
parent
,
"prec_itrf"
,
m_precItrf
,
false
);
}
}
bool
IntegratorCfg
::
Load
(
myXML
::
Contain
*
parent
)
{
std
::
map
<
std
::
string
,
myXML
::
Contain
*>
con
;
GetChildren
(
parent
,
con
);
LoadXML
(
con
,
"integratorEps"
,
m_eps
,
false
);
LoadXML
(
con
,
"integratorStepInit"
,
m_stepinit
,
false
);
LoadXML
(
con
,
"integratorStepMin"
,
m_stepmin
,
false
);
LoadXML
(
con
,
"prec_itrf"
,
m_precItrf
,
false
);
return
true
;
}
utils/integratorcfg.h
View file @
7270c794
#pragma once
#pragma once
#include "json_functions.h"
#include "json_functions.h"
#include <myXML_Document.hpp>
#define IEPS 1E-9
#define ISTEPINIT 10E-3
#define ISTEPMIN .1E-3
class
IntegratorCfg
class
IntegratorCfg
{
{
public
:
public
:
IntegratorCfg
()
:
IntegratorCfg
()
m_eps
(
IEPS
),
m_stepinit
(
ISTEPINIT
),
m_stepmin
(
ISTEPMIN
),
m_precItrf
(
false
)
{
{
}
}
...
@@ -20,13 +16,14 @@ public:
...
@@ -20,13 +16,14 @@ public:
}
}
void
load
(
const
jsonval
&
parent
);
void
load
(
const
jsonval
&
parent
);
double
getEps
()
const
{
return
m_eps
>
0
?
m_eps
:
IEPS
;
}
bool
Load
(
myXML
::
Contain
*
parent
);
double
getStepInit
()
const
{
return
m_stepinit
>
0
?
m_stepinit
:
ISTEPINIT
;
}
double
getEps
()
const
{
return
m_eps
;
}
double
getStepMin
()
const
{
return
m_stepmin
>
0
?
m_stepmin
:
ISTEPMIN
;
}
double
getStepInit
()
const
{
return
m_stepinit
;
}
double
getStepMin
()
const
{
return
m_stepmin
;
}
bool
getPrecItfr
()
const
{
return
m_precItrf
;
}
bool
getPrecItfr
()
const
{
return
m_precItrf
;
}
private
:
private
:
double
m_eps
;
double
m_eps
{
1E-9
}
;
double
m_stepinit
;
double
m_stepinit
{
10E-3
}
;
double
m_stepmin
;
double
m_stepmin
{
.1E-3
}
;
bool
m_precItrf
;
bool
m_precItrf
{
false
}
;
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment