Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Eoin Clerkin
cbmroot_geometry
Commits
aa29e66d
Commit
aa29e66d
authored
Mar 09, 2021
by
Eoin Clerkin
Browse files
Turns off test when the element mass or mass is of length zero.
This is to stop vaccumm medium from tripping failure.
parent
86b36448
Changes
1
Hide whitespace changes
Inline
Side-by-side
static_check.awk
View file @
aa29e66d
...
...
@@ -33,7 +33,6 @@ FS="[\t ]*"; # Spaces and tags as field seperators in media.geo
for
(
i
=
1
;
i
<=
NF
;
i
++
)
datum
[
i
]
=
$i
;
# Loading in a line from media.geo fle to make it easy to work with.
RELATIVE_SUM
=
0
;
content_by
=
"weight"
;
# The relative content is by number of each atom or by relative weight of each atom.
...
...
@@ -76,10 +75,14 @@ for (i = 1; i<=NF; i++)datum[i]=$i; # Loading in a line from media.geo fle to ma
# datum[2 + 2*datum[2] + 1] is the overall density of the material
# datum[3 + 2*datum[2] + i] is the subsequent relative amount of each compoment.
ERROR
=
abs
(
(
datum
[
2
+
i
]
-
ELEMENT_MASS
[
strtonum
(
datum
[
2
+
i
+
datum
[
2
]])]
)
/
datum
[
2
+
i
])
#
printf "PAUSE: %s %s %s",
datum[2+i]
,
ELEMENT_MASS[strtonum(datum[2+i+datum[2]])]
, ERROR;
printf
"1 MASS ENTERED %s \n"
,
datum
[
2
+
i
];
printf
"2 ELEMENT MASS %s \n"
,
ELEMENT_MASS
[
strtonum
(
datum
[
2
+
i
+
datum
[
2
]])];
if
(
length
(
datum
[
2
+
i
])
!=
0
&&
length
(
ELEMENT_MASS
[
strtonum
(
datum
[
2
+
i
+
datum
[
2
]])])
!=
0
){
ERROR
=
abs
(
(
datum
[
2
+
i
]
-
ELEMENT_MASS
[
strtonum
(
datum
[
2
+
i
+
datum
[
2
]])]
)
/
datum
[
2
+
i
])
};
if
(
datum
[
2
]
>
1
){
# Checks relatavant for more than one component.
if
(
content_by
~
"number"
){
# When the elements are per their relative number.
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment