Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
alta
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alta
alta
Commits
04c2252b
Commit
04c2252b
authored
Aug 29, 2013
by
Laurent Belcour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating the data 2 moment procedure so that I can change the number of integration
samples
parent
8ceb67b5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
sources/softs/data2moments/main.cpp
sources/softs/data2moments/main.cpp
+10
-6
No files found.
sources/softs/data2moments/main.cpp
View file @
04c2252b
...
...
@@ -85,6 +85,11 @@ int main(int argc, char** argv)
const
int
nX
=
d
->
dimX
();
const
int
nY
=
d
->
dimY
();
// Normalisation factor for the integration
const
int
nb_theta_int
=
90
;
const
int
nb_phi_int
=
180
;
const
double
normalization
=
M_PI
*
M_PI
/
(
double
)(
nb_phi_int
*
nb_theta_int
);
double
in_angle
[
4
]
=
{
0.0
,
0.0
,
0.0
,
0.0
}
;
// Static data
...
...
@@ -105,12 +110,12 @@ int main(int argc, char** argv)
vec
m_yy
(
nY
);
m_0
=
vec
::
Zero
(
nY
);
// Integrate over the light hemisphere
for
(
int
theta_out
=
0
;
theta_out
<
90
;
theta_out
++
)
for
(
int
theta_out
=
0
;
theta_out
<
nb_theta_int
;
theta_out
++
)
{
in_angle
[
2
]
=
theta_out
*
0.5
*
M_PI
/
90.0
;
for
(
int
phi_out
=
0
;
phi_out
<
360
;
phi_out
++
)
in_angle
[
2
]
=
theta_out
*
0.5
*
M_PI
/
(
double
)
nb_theta_int
;
for
(
int
phi_out
=
0
;
phi_out
<
nb_phi_int
;
phi_out
++
)
{
in_angle
[
3
]
=
phi_out
*
2.0
*
M_PI
/
360.0
;
in_angle
[
3
]
=
phi_out
*
2.0
*
M_PI
/
nb_phi_int
;
vec
in
(
nX
),
cart
(
6
),
L
(
3
),
V
(
3
);
params
::
convert
(
in_angle
,
params
::
SPHERICAL_TL_PL_TV_PV
,
data_param
,
&
in
[
0
]);
...
...
@@ -130,8 +135,7 @@ int main(int argc, char** argv)
for
(
int
i
=
0
;
i
<
nY
;
++
i
)
{
const
double
normalization
=
360.0
*
90.0
;
double
val
=
x
[
i
]
*
cos
(
in_angle
[
2
])
/
normalization
;
double
val
=
x
[
i
]
/* cos(in_angle[2])*/
*
normalization
;
m_0
[
i
]
+=
val
;
m_x
[
i
]
+=
val
*
xy
[
0
];
...
...
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