This repository was archived by the owner on Jan 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvelocity_model.h
More file actions
43 lines (33 loc) · 1.75 KB
/
velocity_model.h
File metadata and controls
43 lines (33 loc) · 1.75 KB
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
#ifndef _VELOCITY_MODEL_H_
#define _VELOCITY_MODEL_H_
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
typedef struct velocity_model
{
size_t nx; /* Number of X cells / columns */
size_t nz; /* Number of Z cells / lines */
double dx; /* Size of X grid cell */
double dz; /* Size of Z grid cell */
double v_min; /* minimum velocity */
double v_max; /* maximum velocity */
double *vel; /* Velocity model flatenned array */
} velocity_model;
velocity_model * velocity_model__create(size_t nx, size_t nz, double dx, double dz);
void velocity_model__destroy(velocity_model *model);
velocity_model * velocity_model__read_from_file( const char filename[], size_t nx, size_t nz, double dx, double dz);
size_t velocity_model__write_to_file(const char filename[], velocity_model *model);
velocity_model *velocity_model__create_submodel(velocity_model *model, size_t nxa, size_t nza, size_t nxb, size_t nzb);
velocity_model *velocity_model__create_submodel_from_file(
const char filename[],
size_t nx,
size_t nz,
double dx,
double dz,
size_t nxa,
size_t nza,
size_t nxb,
size_t nzb);
void velocity_model__constant_velocity(velocity_model *model, double velocity);
void velocity_model__cartesian_velocity(velocity_model *model);
#endif