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
14bc91ae
Commit
14bc91ae
authored
6 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Add mpl porosity to project file.
parent
6f4416e2
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/addMPLPorosity.sh
+32
-0
32 additions, 0 deletions
xml/addMPLPorosity.sh
with
32 additions
and
0 deletions
xml/addMPLPorosity.sh
0 → 100755
+
32
−
0
View file @
14bc91ae
#!/usr/bin/env bash
set
-x
porosity_parameter_name
=
`
xmlstarlet sel
-t
-m
"//*/porosity"
-v
"./porosity_parameter"
$1
`
echo
$porosity_parameter_name
porosity_type
=
`
xmlstarlet sel
-t
-m
"//*/parameter[name='
$porosity_parameter_name
']"
-v
"./type"
$1
`
echo
$porosity_type
porosity_entries
=
`
xmlstarlet sel
-t
-m
"//*/parameter[name='
$porosity_parameter_name
']"
-v
"./value|values"
$1
`
echo
$porosity_entries
### rename the solid phase for unique insertion
xmlstarlet ed
-r
"//*/phase/type[text()='Solid']/.."
-v
solid_phase
$1
>
/tmp/solid_phase_properties.prj
### add porosity property
sub_path
=
//OpenGeoSysProject/media/medium/phases/solid_phase/properties
xmlstarlet ed
--subnode
$sub_path
--type
elem
-n
"property_porosity"
/tmp/solid_phase_properties.prj
>
/tmp/solid_phase_properties_property_porosity.prj
# add property name
xmlstarlet ed
--subnode
$sub_path
/property_porosity
--type
elem
-n
name
-v
porosity /tmp/solid_phase_properties_property_porosity.prj
>
/tmp/solid_phase_properties_property_porosity_name.prj
# add property type
xmlstarlet ed
--subnode
$sub_path
/property_porosity
--type
elem
-n
type
-v
$porosity_type
/tmp/solid_phase_properties_property_porosity_name.prj
>
/tmp/solid_phase_properties_property_porosity_type.prj
# add property value
xmlstarlet ed
--subnode
$sub_path
/property_porosity
--type
elem
-n
value
-v
"
$porosity_entries
"
/tmp/solid_phase_properties_property_porosity_type.prj
>
/tmp/solid_phase_properties_property_porosity_entries.prj
# rename property_porosity to property
xmlstarlet ed
--rename
"//OpenGeoSysProject/media/medium/phases/solid_phase/properties/property_porosity"
-v
"property"
/tmp/solid_phase_properties_property_porosity_entries.prj
>
/tmp/with_porosity.prj
### rename solid_phase tag to phase
xmlstarlet ed
--rename
"//OpenGeoSysProject/media/medium/phases/solid_phase"
-v
"phase"
/tmp/with_porosity.prj
>
/tmp/with_solid_phase.prj
#format the result file
xmlstarlet fo
-s
4 /tmp/with_solid_phase.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