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
IFOS3D
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
GPIAG-Software
IFOS3D
Commits
bf0e913c
Commit
bf0e913c
authored
Apr 12, 2016
by
Simone Butzer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes steplength calculation for L-BFGS
test steplength set to 0.5 aand 1.0
parent
86ced852
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
15 deletions
+17
-15
par/in_and_out/ifos3d.inp
par/in_and_out/ifos3d.inp
+1
-1
src/fd.h
src/fd.h
+1
-1
src/ifos3d.c
src/ifos3d.c
+3
-7
src/steplength.c
src/steplength.c
+12
-6
No files found.
par/in_and_out/ifos3d.inp
View file @
bf0e913c
...
@@ -40,7 +40,7 @@ point_source_(explosive=1;force_in_x=2;in_y=3;in_z=4;custom=5)_(QUELLTYP) = 4
...
@@ -40,7 +40,7 @@ point_source_(explosive=1;force_in_x=2;in_y=3;in_z=4;custom=5)_(QUELLTYP) = 4
force_angle_between_x_y_(in_degree)_(ALPHA) = 45.0
force_angle_between_x_y_(in_degree)_(ALPHA) = 45.0
force_angle_between_x_z_(in_degree)_(BETA) = 45.0
force_angle_between_x_z_(in_degree)_(BETA) = 45.0
# Plane wave (PW) excitation,if PLANE_WAVE_DEPTH>0, SRCREC is treated as 0
# Plane wave (PW) excitation,if PLANE_WAVE_DEPTH>0, SRCREC is treated as 0
depth_of_PW_excitation_(no<=0)_(in_meter)_(PLANE_WAVE_DEPTH) = 0.0
direct.com/
depth_of_PW_excitation_(no<=0)_(in_meter)_(PLANE_WAVE_DEPTH) = 0.0
dip_of_PW_from_vertical_(in_degrees)_(PHI) =0.0
dip_of_PW_from_vertical_(in_degrees)_(PHI) =0.0
duration_of_source-signal_PW_(in_seconds)_(TS) = 0.0033
duration_of_source-signal_PW_(in_seconds)_(TS) = 0.0033
# External signal input instead of QUELLART
# External signal input instead of QUELLART
...
...
src/fd.h
View file @
bf0e913c
...
@@ -367,7 +367,7 @@ void zero_invers(int NX, int NY, int NZ, float **** Ffvx, float **** Ffvy, float
...
@@ -367,7 +367,7 @@ void zero_invers(int NX, int NY, int NZ, float **** Ffvx, float **** Ffvy, float
void
precon_grad
(
int
nx
,
int
ny
,
int
nz
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
,
int
nsrc
,
float
**
srcpos
,
int
ntr_glob
,
int
**
recpos
,
float
finv
,
int
iteration
,
int
cdf
);
void
precon_grad
(
int
nx
,
int
ny
,
int
nz
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
,
int
nsrc
,
float
**
srcpos
,
int
ntr_glob
,
int
**
recpos
,
float
finv
,
int
iteration
,
int
cdf
);
void
outgrad
(
int
nx
,
int
ny
,
int
nz
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
,
float
finv
,
int
iteration
,
char
outfile
[
STRING_SIZE
]);
void
outgrad
(
int
nx
,
int
ny
,
int
nz
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
,
float
finv
,
int
iteration
,
char
outfile
[
STRING_SIZE
]);
void
outmod
(
int
nx
,
int
ny
,
int
nz
,
float
***
rho
,
float
***
pi
,
float
***
u
,
int
iteration
);
void
outmod
(
int
nx
,
int
ny
,
int
nz
,
float
***
rho
,
float
***
pi
,
float
***
u
,
int
iteration
);
void
steplength
(
float
*
L2
,
float
*
step
,
int
iteration
);
void
steplength
(
float
*
L2
,
float
*
step
,
int
iteration
,
int
it_group
);
void
zero_grad
(
int
NX
,
int
NY
,
int
NZ
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
);
void
zero_grad
(
int
NX
,
int
NY
,
int
NZ
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
);
void
cpmodel
(
int
nx
,
int
ny
,
int
nz
,
float
***
rho
,
float
***
pi
,
float
***
u
,
float
***
testrho
,
float
***
testpi
,
float
***
testu
);
void
cpmodel
(
int
nx
,
int
ny
,
int
nz
,
float
***
rho
,
float
***
pi
,
float
***
u
,
float
***
testrho
,
float
***
testpi
,
float
***
testu
);
void
conjugate
(
int
nx
,
int
ny
,
int
nz
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
,
float
***
gradprior1
,
float
***
gradprior2
,
float
***
gradprior3
,
float
***
gradprior4
,
float
***
gradprior5
,
float
***
gradprior6
,
float
*
beta
,
int
iteration
,
int
cdf
);
void
conjugate
(
int
nx
,
int
ny
,
int
nz
,
float
***
grad1
,
float
***
grad2
,
float
***
grad3
,
float
***
gradprior1
,
float
***
gradprior2
,
float
***
gradprior3
,
float
***
gradprior4
,
float
***
gradprior5
,
float
***
gradprior6
,
float
*
beta
,
int
iteration
,
int
cdf
);
...
...
src/ifos3d.c
View file @
bf0e913c
...
@@ -1003,13 +1003,9 @@ CPML_coeff(K_x,alpha_prime_x,a_x,b_x,K_x_half,alpha_prime_x_half,a_x_half,b_x_ha
...
@@ -1003,13 +1003,9 @@ CPML_coeff(K_x,alpha_prime_x,a_x,b_x,K_x_half,alpha_prime_x_half,a_x_half,b_x_ha
fprintf
(
FP
,
"
\n
STEPLENGTH CALCULATION ITERATION %d
\n
"
,
iteration
);
fprintf
(
FP
,
"
\n
STEPLENGTH CALCULATION ITERATION %d
\n
"
,
iteration
);
if
(
LBFGS
||!
LBFGS
){
if
(
LBFGS
||!
LBFGS
){
for
(
steptest
=
1
;
steptest
<=
2
;
steptest
++
){
for
(
steptest
=
1
;
steptest
<=
2
;
steptest
++
){
if
(
cdf
==
1
)
step
[
4
]
=
0
.
02
;
if
(
cdf
==
1
)
step
[
4
]
=
TESTSTEP
;
/*if(cdf==1)step[4]=1-(groupnum-1)/4;*/
step
[
steptest
]
=
0
.
0
;
step
[
steptest
]
=
step
[
4
]
*
steptest
;
step
[
steptest
]
=
0
.
0
;
step
[
steptest
]
=
step
[
4
]
*
steptest
;
/*if(iteration>10)step[steptest]=0.015*steptest;
if(iteration>20)step[steptest]=0.01*steptest;
if(iteration>30) step[steptest]=0.005*steptest;
if(iteration>50) step[steptest]=0.003*steptest;*/
fprintf
(
FP
,
"step[%d]=%e"
,
steptest
,
step
[
steptest
]);
fprintf
(
FP
,
"step[%d]=%e"
,
steptest
,
step
[
steptest
]);
if
(
MYID
==
0
)
fprintf
(
FI
,
"
\n
steptest %d: steplength=%e
\n
"
,
steptest
,
step
[
steptest
]);
if
(
MYID
==
0
)
fprintf
(
FI
,
"
\n
steptest %d: steplength=%e
\n
"
,
steptest
,
step
[
steptest
]);
...
@@ -1109,7 +1105,7 @@ CPML_coeff(K_x,alpha_prime_x,a_x,b_x,K_x_half,alpha_prime_x_half,a_x_half,b_x_ha
...
@@ -1109,7 +1105,7 @@ CPML_coeff(K_x,alpha_prime_x,a_x,b_x,K_x_half,alpha_prime_x_half,a_x_half,b_x_ha
if
(
MYID
==
0
)
fprintf
(
FP
,
"
\n\n\n
Steplength Parabel
\n
"
);
if
(
MYID
==
0
)
fprintf
(
FP
,
"
\n\n\n
Steplength Parabel
\n
"
);
MPI_Barrier
(
MPI_COMM_WORLD
);
MPI_Barrier
(
MPI_COMM_WORLD
);
steplength
(
misfit
,
step
,
iteration
);
/*find optimal steplength*/
steplength
(
misfit
,
step
,
iteration
,
it_group
);
/*find optimal steplength*/
}
}
if
(
MYID
==
0
)
fprintf
(
FP
,
"
\n
Modelupdate
\n
"
);
if
(
MYID
==
0
)
fprintf
(
FP
,
"
\n
Modelupdate
\n
"
);
...
...
src/steplength.c
View file @
bf0e913c
...
@@ -23,17 +23,18 @@
...
@@ -23,17 +23,18 @@
-------------------------------------------------------------*/
-------------------------------------------------------------*/
#include "fd.h"
#include "fd.h"
void
steplength
(
float
*
L2
,
float
*
step
,
int
iteration
){
void
steplength
(
float
*
L2
,
float
*
step
,
int
iteration
,
int
it_group
){
extern
FILE
*
FP
;
extern
FILE
*
FP
;
extern
FILE
*
FI
;
extern
FILE
*
FI
;
extern
int
MYID
;
extern
int
MYID
,
LBFGS
;
extern
float
TESTSTEP
;
extern
float
TESTSTEP
;
float
a
=
0
.
0
,
b
=
0
.
0
,
c
=
0
.
0
;
float
a
=
0
.
0
,
b
=
0
.
0
,
c
=
0
.
0
;
float
teststep
=
0
.
0
;
float
teststep
=
0
.
0
;
teststep
=
TESTSTEP
;
teststep
=
TESTSTEP
;
if
(
MYID
==
0
)
fprintf
(
FP
,
"Start estimation of optimal steplength
\n
"
);
if
(
MYID
==
0
)
fprintf
(
FP
,
"Start estimation of optimal steplength
\n
"
);
/*calculation of the steplength parabola*/
/*calculation of the steplength parabola*/
...
@@ -61,9 +62,14 @@ void steplength(float *L2, float *step, int iteration){
...
@@ -61,9 +62,14 @@ void steplength(float *L2, float *step, int iteration){
if
(
MYID
==
0
)
fprintf
(
FP
,
"steplength larger stepmax, set to stepmax"
);
if
(
MYID
==
0
)
fprintf
(
FP
,
"steplength larger stepmax, set to stepmax"
);
}
}
if
(
LBFGS
&&
it_group
>
1
&&
step
[
3
]
>
1
.
0
){
step
[
3
]
=
1
.
0
;
if
(
MYID
==
0
)
fprintf
(
FP
,
"steplength larger 1.0, set to 1.0"
);
}
if
(
step
[
3
]
<=
0
){
if
(
step
[
3
]
<=
0
){
step
[
3
]
=
0
.
1
*
step
[
1
];
step
[
3
]
=
0
.
1
*
step
[
1
];
if
(
MYID
==
0
)
fprintf
(
FP
,
"steplength smaller 0, set to
step[2]"
);
if
(
MYID
==
0
)
fprintf
(
FP
,
"steplength smaller 0, set to
%e"
,
step
[
3
]
);
}
}
if
(
step
[
3
]
<
0
.
1
*
step
[
1
]){
step
[
3
]
=
0
.
1
*
step
[
1
];
if
(
step
[
3
]
<
0
.
1
*
step
[
1
]){
step
[
3
]
=
0
.
1
*
step
[
1
];
...
@@ -79,7 +85,7 @@ void steplength(float *L2, float *step, int iteration){
...
@@ -79,7 +85,7 @@ void steplength(float *L2, float *step, int iteration){
if
(
step
[
4
]
<
0
.
2
*
teststep
)
step
[
4
]
=
0
.
2
*
teststep
;
if
(
step
[
4
]
<
0
.
2
*
teststep
)
step
[
4
]
=
0
.
2
*
teststep
;
if
(
step
[
4
]
>
teststep
)
step
[
4
]
=
teststep
;
if
(
step
[
4
]
>
teststep
)
step
[
4
]
=
teststep
;
if
(
LBFGS
&&
it_group
>
1
)
step
[
4
]
=
0
.
5
;
if
(
MYID
==
0
)
fprintf
(
FI
,
"new test-steplength4: %e
\n
"
,
step
[
4
]);
if
(
MYID
==
0
)
fprintf
(
FI
,
"new test-steplength4: %e
\n
"
,
step
[
4
]);
}
}
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