Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ogs
OpenGeoSys Tools
ogs-utils
Commits
b1a06ca5
Commit
b1a06ca5
authored
5 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Script for moving the porosity specification from solid phase to medium scale.
parent
acf05265
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xml/movePorosityFromSolidPhaseToMedium.sh
+19
-0
19 additions, 0 deletions
xml/movePorosityFromSolidPhaseToMedium.sh
with
19 additions
and
0 deletions
xml/movePorosityFromSolidPhaseToMedium.sh
0 → 100755
+
19
−
0
View file @
b1a06ca5
#!/usr/bin/env bash
#set -x
number_of_medium_tags
=
`
xmlstarlet sel
-t
-v
"count(///*/medium)"
$1
`
number_of_medium_tags
=
$((
$number_of_medium_tags
-
1
))
xmlstarlet ed
--move
"//OpenGeoSysProject/media/medium[@id=0]/phases/phase/properties/property[name='porosity']"
"//OpenGeoSysProject/media/medium[@id=0]/properties"
$1
>
/tmp/t0.prj
for
i
in
`
seq
1
${
number_of_medium_tags
}
`
;
do
i_m_e
=
$((
$i
-
1
))
#echo "${i}, ${i_m_e}"
path
=
"//OpenGeoSysProject/media/medium[@id="
${
i
}
"]"
xmlstarlet ed
--move
"
$path
/phases/phase/properties/property[name='porosity']"
"
$path
/properties"
/tmp/t
$i_m_e
.prj
>
/tmp/t
${
i
}
.prj
done
#format the result file
xmlstarlet fo
-s
4 /tmp/t
${
number_of_medium_tags
}
.prj
>
${
1
}
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