lib/App/SeismicUnixGui/sunix/model/elamodel.pm untested

filter: Statementstmt 0.0% 0 / 97 Branchbran 0.0% 0 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 17 Podpod 0.0% 0 / 13 totaltotal 0.0% 0 / 145 CC 10 SCAR 15.6
CC
10
Cov
0%
fill
6.0
kedge
6.0
maxangle
6.0
CRAP 4.8
1 package App::SeismicUnixGui::sunix::model::elamodel;
2  
3 =head2 SYNOPSIS
4  
5 PERL PROGRAM NAME:
6  
7 AUTHOR: Juan Lorenzo (Perl module only)
8  
9 DATE:
10  
11 DESCRIPTION:
12  
13 Version:
14  
15 =head2 USE
16  
17 =head3 NOTES
18  
19 =head4 Examples
20  
21 =head2 SYNOPSIS
22  
23 =head3 SEISMIC UNIX NOTES
24 ELAMODEL - make piecewise homogeneous anisotropic model
25  
26  
27  
28 elamodel >modelfile fill= [optional parameters]
29  
30  
31  
32 Input Parameters:
33  
34 xmin=0.0 minimum horizontal coordinate (x)
35  
36 xmax=1.0 maximum horizontal coordinate (x)
37  
38 zmin=0.0 minimum vertical coordinate (z)
39  
40 zmax=1.0 maximum vertical coordinate (z)
41  
42 xedge= x coordinates of an edge
43  
44 zedge= z coordinates of an edge
45  
46 kedge= array of indices used to identify edges
47  
48 fill= iso x,z,v_p,v_s,rho
49  
50 tiso x,z,v_p,v_s,epsilon,delta,gamma,phi,rho
51  
52 ani x,z,a1111,a3333,a1133,a1313,a1113,a3313
53  
54 a1212,a2323,a1223,rho
55  
56 maxangle=5.0 maximum angle (deg) between adjacent edge segments
57  
58  
59  
60 Notes:
61  
62 More than set of xedge and zedge parameters may be
63  
64 specified, but the numbers of these parameters must be equal.
65  
66  
67  
68 Within each set, vertices will be connected by fixed edges.
69  
70  
71  
72 Edge indices in the k array are used to identify edges
73  
74 specified by the x and z parameters. The first k index
75  
76 corresponds to the first set of x and z parameters, the
77  
78 second k index corresponds to the second set, and so on.
79  
80  
81  
82 After all vertices have been inserted into the model, the fill
83  
84 parameters is used to fill closed regions bounded by fixed edges.
85  
86 Three input modes are available:
87  
88 Isotropic blocks: x,z,v_p,v_s,rho
89  
90 Transversely iso: x,z,v_p,v_s,epsilon,delta,gamma,phi,rho
91  
92 General 2D aniso: x,z,a1111,a3333,a1133,a1313,a1113,a3313
93  
94 a1212,a2323,a1223,rho
95  
96 Hereby:
97  
98 x,z coordinates of one point in a bounded region
99  
100 v_p,v_s P, S-wave velocity along symmetry axis
101  
102 epsilon, delta, gammma Thomsen's parameters
103  
104 rho density
105  
106 phi angle of symmetry axes with vertical
107  
108 aijkl density normalized stiffness coefficients
109  
110  
111  
112 Each block can be defined by different input modes. The number of
113  
114 input parameters defines the input type. Incorrect number of input
115  
116 parameters result in an Error-message
117  
118  
119  
120  
121  
122  
123  
124  
125  
126 Author: Dave Hale, Colorado School of Mines, 02/12/91
127  
128 modified : Andreas Rueger, Colorado School of Mines, 01/18/94
129  
130 built anisotropic models
131  
132  
133  
134  
135  
136 =head2 User's notes (Juan Lorenzo)
137 untested
138  
139 =cut
140  
141  
142 =head2 CHANGES and their DATES
143  
144 =cut
145  
146 use Moose;
147 our $VERSION = '0.0.1';
148  
149  
150 =head2 Import packages
151  
152 =cut
153  
154 use aliased 'App::SeismicUnixGui::misc::L_SU_global_constants';
155  
156 use App::SeismicUnixGui::misc::SeismicUnix qw($in $out $on $go $to $suffix_ascii $off $suffix_su $suffix_bin);
157 use aliased 'App::SeismicUnixGui::configs::big_streams::Project_config';
158  
159  
160 =head2 instantiation of packages
161  
162 =cut
163  
164 my $get = L_SU_global_constants->new();
165 my $Project = Project_config->new();
166 my $DATA_SEISMIC_SU = $Project->DATA_SEISMIC_SU();
167 my $DATA_SEISMIC_BIN = $Project->DATA_SEISMIC_BIN();
168 my $DATA_SEISMIC_TXT = $Project->DATA_SEISMIC_TXT();
169  
170 my $var = $get->var();
171 my $on = $var->{_on};
172 my $off = $var->{_off};
173 my $true = $var->{_true};
174 my $false = $var->{_false};
175 my $empty_string = $var->{_empty_string};
176  
177 =head2 Encapsulated
178 hash of private variables
179  
180 =cut
181  
182 my $elamodel = {
183 _fill => '',
184 _kedge => '',
185 _maxangle => '',
186 _xedge => '',
187 _xmax => '',
188 _xmin => '',
189 _zedge => '',
190 _zmax => '',
191 _zmin => '',
192 _Step => '',
193 _note => '',
194  
195 };
196  
197 =head2 sub Step
198  
199 collects switches and assembles bash instructions
200 by adding the program name
201  
202 =cut
203  
204 sub Step {
205  
206 $elamodel->{_Step} = 'elamodel'.$elamodel->{_Step};
207 return ( $elamodel->{_Step} );
208  
209 }
210  
211  
212 =head2 sub note
213  
214 collects switches and assembles bash instructions
215 by adding the program name
216  
217 =cut
218  
219 sub note {
220  
221 $elamodel->{_note} = 'elamodel'.$elamodel->{_note};
222 return ( $elamodel->{_note} );
223  
224 }
225  
226  
227  
228 =head2 sub clear
229  
230 =cut
231  
232 sub clear {
233  
234 $elamodel->{_fill} = '';
235 $elamodel->{_kedge} = '';
236 $elamodel->{_maxangle} = '';
237 $elamodel->{_xedge} = '';
238 $elamodel->{_xmax} = '';
239 $elamodel->{_xmin} = '';
240 $elamodel->{_zedge} = '';
241 $elamodel->{_zmax} = '';
242 $elamodel->{_zmin} = '';
243 $elamodel->{_Step} = '';
244 $elamodel->{_note} = '';
245 }
246  
247  
248 =head2 sub fill
249  
250  
251 =cut
252  
253 sub fill {
254  
255 my ( $self,$fill ) = @_;
256 if ( $fill ne $empty_string ) {
257  
258 $elamodel->{_fill} = $fill;
259 $elamodel->{_note} = $elamodel->{_note}.' fill='.$elamodel->{_fill};
260 $elamodel->{_Step} = $elamodel->{_Step}.' fill='.$elamodel->{_fill};
261  
262 } else {
263 print("elamodel, fill, missing fill,\n");
264 }
265 }
266  
267  
268 =head2 sub kedge
269  
270  
271 =cut
272  
273 sub kedge {
274  
275 my ( $self,$kedge ) = @_;
276 if ( $kedge ne $empty_string ) {
277  
278 $elamodel->{_kedge} = $kedge;
279 $elamodel->{_note} = $elamodel->{_note}.' kedge='.$elamodel->{_kedge};
280 $elamodel->{_Step} = $elamodel->{_Step}.' kedge='.$elamodel->{_kedge};
281  
282 } else {
283 print("elamodel, kedge, missing kedge,\n");
284 }
285 }
286  
287  
288 =head2 sub maxangle
289  
290  
291 =cut
292  
293 sub maxangle {
294  
295 my ( $self,$maxangle ) = @_;
296 if ( $maxangle ne $empty_string ) {
297  
298 $elamodel->{_maxangle} = $maxangle;
299 $elamodel->{_note} = $elamodel->{_note}.' maxangle='.$elamodel->{_maxangle};
300 $elamodel->{_Step} = $elamodel->{_Step}.' maxangle='.$elamodel->{_maxangle};
301  
302 } else {
303 print("elamodel, maxangle, missing maxangle,\n");
304 }
305 }
306  
307  
308 =head2 sub xedge
309  
310  
311 =cut
312  
313 sub xedge {
314  
315 my ( $self,$xedge ) = @_;
316 if ( $xedge ne $empty_string ) {
317  
318 $elamodel->{_xedge} = $xedge;
319 $elamodel->{_note} = $elamodel->{_note}.' xedge='.$elamodel->{_xedge};
320 $elamodel->{_Step} = $elamodel->{_Step}.' xedge='.$elamodel->{_xedge};
321  
322 } else {
323 print("elamodel, xedge, missing xedge,\n");
324 }
325 }
326  
327  
328 =head2 sub xmax
329  
330  
331 =cut
332  
333 sub xmax {
334  
335 my ( $self,$xmax ) = @_;
336 if ( $xmax ne $empty_string ) {
337  
338 $elamodel->{_xmax} = $xmax;
339 $elamodel->{_note} = $elamodel->{_note}.' xmax='.$elamodel->{_xmax};
340 $elamodel->{_Step} = $elamodel->{_Step}.' xmax='.$elamodel->{_xmax};
341  
342 } else {
343 print("elamodel, xmax, missing xmax,\n");
344 }
345 }
346  
347  
348 =head2 sub xmin
349  
350  
351 =cut
352  
353 sub xmin {
354  
355 my ( $self,$xmin ) = @_;
356 if ( $xmin ne $empty_string ) {
357  
358 $elamodel->{_xmin} = $xmin;
359 $elamodel->{_note} = $elamodel->{_note}.' xmin='.$elamodel->{_xmin};
360 $elamodel->{_Step} = $elamodel->{_Step}.' xmin='.$elamodel->{_xmin};
361  
362 } else {
363 print("elamodel, xmin, missing xmin,\n");
364 }
365 }
366  
367  
368 =head2 sub zedge
369  
370  
371 =cut
372  
373 sub zedge {
374  
375 my ( $self,$zedge ) = @_;
376 if ( $zedge ne $empty_string ) {
377  
378 $elamodel->{_zedge} = $zedge;
379 $elamodel->{_note} = $elamodel->{_note}.' zedge='.$elamodel->{_zedge};
380 $elamodel->{_Step} = $elamodel->{_Step}.' zedge='.$elamodel->{_zedge};
381  
382 } else {
383 print("elamodel, zedge, missing zedge,\n");
384 }
385 }
386  
387  
388 =head2 sub zmax
389  
390  
391 =cut
392  
393 sub zmax {
394  
395 my ( $self,$zmax ) = @_;
396 if ( $zmax ne $empty_string ) {
397  
398 $elamodel->{_zmax} = $zmax;
399 $elamodel->{_note} = $elamodel->{_note}.' zmax='.$elamodel->{_zmax};
400 $elamodel->{_Step} = $elamodel->{_Step}.' zmax='.$elamodel->{_zmax};
401  
402 } else {
403 print("elamodel, zmax, missing zmax,\n");
404 }
405 }
406  
407  
408 =head2 sub zmin
409  
410  
411 =cut
412  
413 sub zmin {
414  
415 my ( $self,$zmin ) = @_;
416 if ( $zmin ne $empty_string ) {
417  
418 $elamodel->{_zmin} = $zmin;
419 $elamodel->{_note} = $elamodel->{_note}.' zmin='.$elamodel->{_zmin};
420 $elamodel->{_Step} = $elamodel->{_Step}.' zmin='.$elamodel->{_zmin};
421  
422 } else {
423 print("elamodel, zmin, missing zmin,\n");
424 }
425 }
426  
427  
428 =head2 sub get_max_index
429  
430 max index = number of input variables -1
431
432 =cut
433
434 sub get_max_index {
435 my ($self) = @_;
436 my $max_index = 8;
437  
438 return($max_index);
439 }
440
441
442 1;