Skip to content

Commit f18fe28

Browse files
committed
Merge branch 'xmlpatch' into 'master'
[cmake] Bundle apply_xmlpatch tool See merge request ogs/ogs!5405
2 parents 73974ad + 61360ff commit f18fe28

File tree

4 files changed

+154
-0
lines changed

4 files changed

+154
-0
lines changed

Applications/Python/ogs/_internal/binaries_list.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sys
2+
13
binaries_list = [
24
"addDataToRaster",
35
"AddElementQuality",
@@ -70,3 +72,6 @@
7072
"Vtu2Grid",
7173
"xdmfdiff",
7274
]
75+
76+
if sys.platform != "win32":
77+
binaries_list.append("apply_xmlpatch")

Applications/Utils/Tests.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,3 +1611,14 @@ AddTest(
16111611
DIFF_DATA raster_based_3d_mesh.vtu raster_based_3d_mesh.vtu 1e-16
16121612
)
16131613

1614+
AddTest(
1615+
NAME xmlpatch
1616+
PATH Elliptic/square_1x1_SteadyStateDiffusion
1617+
WORKING_DIRECTORY ${Data_SOURCE_DIR}/<PATH>
1618+
EXECUTABLE apply_xmlpatch
1619+
EXECUTABLE_ARGS -f square_1e0.prj -p square_neumann.xml -o
1620+
${Data_BINARY_DIR}/Elliptic/square_1x1_SteadyStateDiffusion/square_1e0_neumann_patched.prj
1621+
TESTER diff
1622+
DIFF_DATA square_1e0_neumann_patched.prj
1623+
REQUIREMENTS NOT WIN32
1624+
)
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
<?xml version="1.0" encoding="ISO-8859-1"?>
2+
<OpenGeoSysProject>
3+
<mesh>square_1x1_quad_1e0.vtu</mesh>
4+
<geometry>square_1x1.gml</geometry>
5+
<processes>
6+
<process>
7+
<name>SteadyStateDiffusion</name>
8+
<type>STEADY_STATE_DIFFUSION</type>
9+
<integration_order>2</integration_order>
10+
<process_variables>
11+
<process_variable>pressure</process_variable>
12+
</process_variables>
13+
<secondary_variables>
14+
<secondary_variable internal_name="darcy_velocity" output_name="v"/>
15+
</secondary_variables>
16+
</process>
17+
</processes>
18+
<media>
19+
<medium id="0">
20+
<phases/>
21+
<properties>
22+
<property>
23+
<name>diffusion</name>
24+
<type>Constant</type>
25+
<value>1</value>
26+
</property>
27+
<property>
28+
<name>reference_temperature</name>
29+
<type>Constant</type>
30+
<value>293.15</value>
31+
</property>
32+
</properties>
33+
</medium>
34+
</media>
35+
<time_loop>
36+
<processes>
37+
<process ref="SteadyStateDiffusion">
38+
<nonlinear_solver>basic_picard</nonlinear_solver>
39+
<convergence_criterion>
40+
<type>DeltaX</type>
41+
<norm_type>NORM2</norm_type>
42+
<abstol>1.e-6</abstol>
43+
</convergence_criterion>
44+
<time_discretization>
45+
<type>BackwardEuler</type>
46+
</time_discretization>
47+
<time_stepping>
48+
<type>SingleStep</type>
49+
</time_stepping>
50+
</process>
51+
</processes>
52+
<output>
53+
<type>VTK</type>
54+
<prefix>square_1e0_neumann</prefix>
55+
<variables>
56+
<variable> pressure </variable>
57+
<variable> v </variable>
58+
</variables>
59+
<suffix>_ts_{:timestep}_t_{:time}</suffix>
60+
</output>
61+
</time_loop>
62+
<parameters>
63+
<parameter>
64+
<name>p0</name>
65+
<type>Constant</type>
66+
<value>0</value>
67+
</parameter>
68+
<parameter>
69+
<name>p_neumann</name>
70+
<type>Constant</type>
71+
<value>1</value>
72+
</parameter>
73+
<parameter>
74+
<name>p_Dirichlet</name>
75+
<type>Constant</type>
76+
<value>1</value>
77+
</parameter>
78+
</parameters>
79+
<process_variables>
80+
<process_variable>
81+
<name>pressure</name>
82+
<components>1</components>
83+
<order>1</order>
84+
<initial_condition>p0</initial_condition>
85+
<boundary_conditions>
86+
<boundary_condition>
87+
<geometrical_set>square_1x1_geometry</geometrical_set>
88+
<geometry>left</geometry>
89+
<type>Dirichlet</type>
90+
<parameter>p_Dirichlet</parameter>
91+
</boundary_condition>
92+
<boundary_condition>
93+
<geometrical_set>square_1x1_geometry</geometrical_set>
94+
<geometry>bottom</geometry>
95+
<type>Dirichlet</type>
96+
<parameter>p_Dirichlet</parameter>
97+
</boundary_condition>
98+
99+
<boundary_condition>
100+
<geometrical_set>square_1x1_geometry</geometrical_set>
101+
<geometry>right</geometry>
102+
<type>Neumann</type>
103+
<parameter>p_neumann</parameter>
104+
</boundary_condition>
105+
</boundary_conditions>
106+
</process_variable>
107+
</process_variables>
108+
<nonlinear_solvers>
109+
<nonlinear_solver>
110+
<name>basic_picard</name>
111+
<type>Picard</type>
112+
<max_iter>10</max_iter>
113+
<linear_solver>general_linear_solver</linear_solver>
114+
</nonlinear_solver>
115+
</nonlinear_solvers>
116+
<linear_solvers>
117+
<linear_solver>
118+
<name>general_linear_solver</name>
119+
<lis>-i cg -p jacobi -tol 1e-16 -maxiter 10000</lis>
120+
<eigen>
121+
<solver_type>CG</solver_type>
122+
<precon_type>DIAGONAL</precon_type>
123+
<max_iteration_step>10000</max_iteration_step>
124+
<error_tolerance>1e-16</error_tolerance>
125+
</eigen>
126+
<petsc>
127+
<prefix>gw</prefix>
128+
<parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
129+
</petsc>
130+
</linear_solver>
131+
</linear_solvers>
132+
</OpenGeoSysProject>

scripts/cmake/Dependencies.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ else()
270270
GIT_REPOSITORY https://gitlab.opengeosys.org/ogs/libs/xmlpatch.git
271271
OPTIONS "BUILD_SHARED_LIBS OFF" SYSTEM TRUE
272272
)
273+
if(NOT WIN32)
274+
ogs_add_executable(apply_xmlpatch ${xmlpatch_SOURCE_DIR}/tests/xml_patch_main.c)
275+
target_link_libraries(apply_xmlpatch PRIVATE xmlpatch)
276+
target_compile_definitions(apply_xmlpatch PRIVATE -DVERSION="0.4.3")
277+
install(TARGETS apply_xmlpatch RUNTIME DESTINATION bin)
278+
endif()
273279
endif()
274280

275281
if(OGS_BUILD_SWMM)

0 commit comments

Comments
 (0)