Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenSource
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Willem Thorbecke
OpenSource
Commits
d8588e1f
Commit
d8588e1f
authored
5 years ago
by
Joeri Brackenhoff
Browse files
Options
Downloads
Patches
Plain Diff
zfpmar
parent
b9894c46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
fdelmodc/Makefile
+1
-0
1 addition, 0 deletions
fdelmodc/Makefile
fdelmodc/applyRupture.c
+96
-0
96 additions, 0 deletions
fdelmodc/applyRupture.c
fdelmodc/elastic4.c
+8
-1
8 additions, 1 deletion
fdelmodc/elastic4.c
marchenko3D/zfpmar.h
+65
-0
65 additions, 0 deletions
marchenko3D/zfpmar.h
with
170 additions
and
1 deletion
fdelmodc/Makefile
+
1
−
0
View file @
d8588e1f
...
...
@@ -34,6 +34,7 @@ SRCC = $(PRG).c \
getWaveletInfo.c
\
getModelInfo.c
\
applySource.c
\
applyRupture.c
\
getRecTimes.c
\
getBeamTimes.c
\
writeSnapTimes.c
\
...
...
This diff is collapsed.
Click to expand it.
fdelmodc/applyRupture.c
0 → 100644
+
96
−
0
View file @
d8588e1f
#include
<stdlib.h>
#include
<stdio.h>
#include
<math.h>
#include
<assert.h>
#include
"fdelmodc.h"
#define NINT(x) ((int)((x)>0.0?(x)+0.5:(x)-0.5))
float
stresscalc
(
float
Tu
,
float
Ts
,
float
D
,
float
dD
,
float
D0
,
float
V0
);
void
slipcalc
(
float
*
D
,
float
*
dD
,
float
*
vx
,
float
dx
,
int
izsrc
,
int
ixsrc1
,
int
ixsrc2
,
int
n1
);
void
applyRupture
(
modPar
mod
,
int
itime
,
float
*
vx
,
float
*
txz
,
int
verbose
)
{
float
*
D
,
*
dD
,
Tout
;
int
irup
;
static
float
zrup
,
xrup1
,
xrup2
,
dT
,
T0
,
Tu
,
Ts
,
D0
,
V0
,
dx
,
trup
;
static
int
izrup
,
ixrup1
,
ixrup2
,
itrup
,
nrup
,
n1
,
first
=
1
;
if
(
first
==
1
)
{
if
(
!
getparfloat
(
"zrup"
,
&
zrup
))
zrup
=
0
.
0
;
if
(
!
getparfloat
(
"xrup1"
,
&
xrup1
))
xrup1
=
0
.
0
;
if
(
!
getparfloat
(
"xrup2"
,
&
xrup2
))
xrup2
=
0
.
0
;
if
(
!
getparfloat
(
"trup"
,
&
trup
))
trup
=
0
.
0
;
if
(
!
getparfloat
(
"V0"
,
&
V0
))
V0
=
0
.
0
;
if
(
!
getparfloat
(
"D0"
,
&
D0
))
D0
=
0
.
0
;
if
(
!
getparfloat
(
"Tu"
,
&
Tu
))
Tu
=
0
.
0
;
if
(
!
getparfloat
(
"Ts"
,
&
Ts
))
Ts
=
0
.
0
;
if
(
!
getparfloat
(
"dT"
,
&
dT
))
dT
=
0
.
0
;
dx
=
mod
.
dx
;
n1
=
mod
.
naz
;
ixrup1
=
NINT
(
xrup1
/
dx
);
ixrup2
=
NINT
(
xrup2
/
dx
);
itrup
=
NINT
(
trup
/
mod
.
dt
);
nrup
=
ixrup2
-
ixrup1
;
first
=
0
;
}
if
(
itime
>
itrup
)
{
D
=
(
float
*
)
calloc
(
nrup
,
sizeof
(
float
));
dD
=
(
float
*
)
calloc
(
nrup
,
sizeof
(
float
));
slipcalc
(
D
,
dD
,
vx
,
dx
,
izrup
,
ixrup1
,
ixrup2
,
n1
);
for
(
irup
=
ixrup1
;
irup
<
ixrup2
;
irup
++
){
vmess
(
"D[%d]=%.3e"
,
D
[
irup
-
ixrup1
]);
if
(
fabs
(
dD
[
irup
-
ixrup1
])
>
0
.
001
)
{
Tout
=
stresscalc
(
Tu
,
Ts
,
D
[
irup
-
ixrup1
],
dD
[
irup
-
ixrup1
],
D0
,
V0
);
txz
[
irup
*
n1
+
izrup
-
1
]
+=
Tout
-
T0
;
txz
[
irup
*
n1
+
izrup
]
+=
Tout
-
T0
;
}
else
{
vx
[
irup
*
n1
+
izrup
]
=
0
.
0
;
}
}
free
(
D
);
free
(
dD
);
}
else
if
(
itime
==
itrup
)
{
for
(
irup
=
ixrup1
;
irup
<
ixrup2
;
irup
++
){
txz
[
irup
*
n1
+
izrup
-
1
]
+=
dT
;
txz
[
irup
*
n1
+
izrup
]
+=
dT
;
}
}
}
float
stresscalc
(
float
Tu
,
float
Ts
,
float
D
,
float
dD
,
float
D0
,
float
V0
)
{
float
T1
,
T2
,
Tout
;
T1
=
Tu
*
(
1
-
D
/
D0
);
T2
=
Ts
*
(
V0
/
(
V0
+
dD
));
if
(
fabs
(
T1
)
>
fabs
(
T2
))
Tout
=
T1
;
else
Tout
=
T2
;
return
Tout
;
}
void
slipcalc
(
float
*
D
,
float
*
dD
,
float
*
vx
,
float
dx
,
int
izsrc
,
int
ixsrc1
,
int
ixsrc2
,
int
n1
)
{
int
ix
;
for
(
ix
=
ixsrc1
;
ix
<
ixsrc2
;
ix
++
)
{
dD
[
ix
-
ixsrc1
]
=
vx
[
ix
*
n1
+
izsrc
+
1
]
-
vx
[
ix
*
n1
+
izsrc
-
1
];
}
for
(
ix
=
ixsrc1
+
1
;
ix
<
ixsrc2
;
ix
++
)
{
D
[
ix
-
ixsrc1
]
=
(
dx
/
2
.
0
)
*
(
dD
[
ix
-
ixsrc1
-
1
]
+
dD
[
ix
-
ixsrc1
]);
}
D
[
0
]
=
(
dx
/
2
.
0
)
*
dD
[
0
];
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
fdelmodc/elastic4.c
+
8
−
1
View file @
d8588e1f
...
...
@@ -17,6 +17,8 @@ int boundariesP(modPar mod, bndPar bnd, float *vx, float *vz, float *tzz, float
int
boundariesV
(
modPar
mod
,
bndPar
bnd
,
float
*
vx
,
float
*
vz
,
float
*
tzz
,
float
*
txx
,
float
*
txz
,
float
*
rox
,
float
*
roz
,
float
*
l2m
,
float
*
lam
,
float
*
mul
,
int
itime
,
int
verbose
);
void
applyRupture
(
modPar
mod
,
int
itime
,
float
*
vx
,
float
*
txz
,
int
verbose
);
int
elastic4
(
modPar
mod
,
srcPar
src
,
wavPar
wav
,
bndPar
bnd
,
int
itime
,
int
ixsrc
,
int
izsrc
,
float
**
src_nwav
,
float
*
vx
,
float
*
vz
,
float
*
tzz
,
float
*
txx
,
float
*
txz
,
float
*
rox
,
float
*
roz
,
float
*
l2m
,
float
*
lam
,
float
*
mul
,
int
verbose
)
...
...
@@ -103,7 +105,7 @@ float *vz, float *tzz, float *txx, float *txz, float *rox, float *roz, float
}
/* Add force source */
if
(
src
.
type
>
5
)
{
if
(
src
.
type
>
5
&&
src
.
type
!=
20
)
{
applySource
(
mod
,
src
,
wav
,
bnd
,
itime
,
ixsrc
,
izsrc
,
vx
,
vz
,
tzz
,
txx
,
txz
,
rox
,
roz
,
l2m
,
src_nwav
,
verbose
);
}
...
...
@@ -144,6 +146,11 @@ float *vz, float *tzz, float *txx, float *txz, float *rox, float *roz, float
if
(
src
.
type
<
6
)
{
applySource
(
mod
,
src
,
wav
,
bnd
,
itime
,
ixsrc
,
izsrc
,
vx
,
vz
,
tzz
,
txx
,
txz
,
rox
,
roz
,
l2m
,
src_nwav
,
verbose
);
}
/* Add rupture */
if
(
src
.
type
==
20
)
{
applyRupture
(
mod
,
itime
,
vx
,
txz
,
verbose
);
}
/* check if there are sources placed on the boundaries */
storeSourceOnSurface
(
mod
,
src
,
bnd
,
ixsrc
,
izsrc
,
vx
,
vz
,
tzz
,
txx
,
txz
,
verbose
);
...
...
This diff is collapsed.
Click to expand it.
marchenko3D/zfpmar.h
0 → 100644
+
65
−
0
View file @
d8588e1f
#ifndef ZFPMAR_H
#define ZFPMAR_H
#define MARBYTES 48
#define TOPBYTES 80
/* Size of the different types
long - 8 bytes
int - 4 bytes
char - 1 byte
float - 4 bytes
*/
/* TYPEDEFS */
typedef
struct
{
/* zfpmar - headers for the compression and decompression of data for marchenko */
long
nx
;
/* Number of samples in x-direction */
long
ny
;
/* Number of samples in y-direction */
int
sx
;
/* Source coordinate in x-direction */
int
sy
;
/* Source coordinate in y-direction */
int
sz
;
/* Source coordinate in z-direction */
int
gx
;
/* Receiver coordinate in x-direction */
long
gy
;
/* Receiver coordinate in y-direction */
long
compsize
;
/* Size of the compressed data */
}
zfpmar
;
typedef
struct
{
/* zfptop - headers for the compression and decompression of data for marchenko */
long
ndim
;
/* Number of dimension is between 1 and 4 */
long
nz
;
/* Number of samples in z-direction */
long
ns
;
/* Number of shots */
long
nt
;
/* Number of time samples */
float
dx
;
/* Sampling distance in x-direction */
float
dy
;
/* Sampling distance in x-direction */
float
dz
;
/* Sampling distance in x-direction */
float
scale
;
/* Scaling of the coordinates and the sampling */
double
tolerance
;
/* Set the tolerance of the zfp (de)compression */
float
fmin
;
/* Minimum frequency of the signal */
float
fmax
;
/* Maximum frequency of the singal */
float
fx
;
/* First location of receiver in x-direction */
float
fy
;
/* First location of receiver in y-direction */
float
fz
;
/* First location of receiver in y-direction */
}
zfptop
;
#endif
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment