From c668bcaf49f5229c1f7a751a946d8282a2d06246 Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Mon, 20 Jul 2020 11:30:30 +0200
Subject: [PATCH] [T] Test for mesh independent FunctionParameter.

---
 ProcessLib/LiquidFlow/Tests.cmake             |   1 +
 .../FunctionParameterTest.prj                 | 182 ++++++++++++++++++
 .../SimpleSynthetics/square_5x5_tris_32.vtu   | Bin 0 -> 4038 bytes
 .../square_5x5_tris_32_left_boundary.vtu      |  51 +++++
 .../square_5x5_tris_32_right_boundary.vtu     |  51 +++++
 .../square_5x5_tris_32_ts_1_t_1.000000.vtu    | Bin 0 -> 4038 bytes
 6 files changed, 285 insertions(+)
 create mode 100644 Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/FunctionParameterTest.prj
 create mode 100644 Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32.vtu
 create mode 100644 Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_left_boundary.vtu
 create mode 100644 Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_right_boundary.vtu
 create mode 100644 Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_ts_1_t_1.000000.vtu

diff --git a/ProcessLib/LiquidFlow/Tests.cmake b/ProcessLib/LiquidFlow/Tests.cmake
index 155110cdd9c..769dd439834 100644
--- a/ProcessLib/LiquidFlow/Tests.cmake
+++ b/ProcessLib/LiquidFlow/Tests.cmake
@@ -440,4 +440,5 @@ if (NOT (OGS_USE_MPI))
     OgsTest(PROJECTFILE Parabolic/LiquidFlow/SimpleSynthetics/PrimaryVariableConstraintDirichletBC/cuboid_1x1x1_hex_1000_Dirichlet_Dirichlet_1.prj)
     OgsTest(PROJECTFILE Parabolic/LiquidFlow/SimpleSynthetics/PrimaryVariableConstraintDirichletBC/cuboid_1x1x1_hex_1000_Dirichlet_Dirichlet_2.prj)
     OgsTest(PROJECTFILE Parabolic/LiquidFlow/SimpleSynthetics/PrimaryVariableConstraintDirichletBC/cuboid_1x1x1_hex_1000_Dirichlet_Dirichlet_3.prj)
+    OgsTest(PROJECTFILE Parabolic/LiquidFlow/SimpleSynthetics/FunctionParameterTest.prj)
 endif()
diff --git a/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/FunctionParameterTest.prj b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/FunctionParameterTest.prj
new file mode 100644
index 00000000000..a0d7394bd82
--- /dev/null
+++ b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/FunctionParameterTest.prj
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<OpenGeoSysProject>
+    <meshes>
+        <mesh>square_5x5_tris_32.vtu</mesh>
+        <mesh>square_5x5_tris_32_left_boundary.vtu</mesh>
+        <mesh>square_5x5_tris_32_right_boundary.vtu</mesh>
+    </meshes>
+    <processes>
+        <process>
+            <name>LiquidFlow</name>
+            <type>LIQUID_FLOW</type>
+            <integration_order>2</integration_order>
+            <darcy_gravity>
+                <axis_id>1</axis_id>
+                <g>0</g>
+            </darcy_gravity>
+            <process_variables>
+                <process_variable>pressure</process_variable>
+            </process_variables>
+            <secondary_variables>
+                <secondary_variable internal_name="darcy_velocity" output_name="v"/>
+            </secondary_variables>
+        </process>
+    </processes>
+    <media>
+        <medium id="0">
+            <phases>
+                <phase>
+                    <type>AqueousLiquid</type>
+                    <properties>
+                        <property>
+                            <name>viscosity</name>
+                            <type>Constant</type>
+                            <value> 0.0011373 </value>
+                        </property>
+                        <property>
+                            <name>density</name>
+                            <type>Constant</type>
+                            <value> 1000 </value>
+                        </property>
+                    </properties>
+                </phase>
+            </phases>
+            <properties>
+                <property>
+                    <name>permeability</name>
+                    <type>Constant</type>
+                    <value>3.2439e-12</value>
+                </property>
+                <property>
+                    <name>reference_temperature</name>
+                    <type>Constant</type>
+                    <value>293.15</value>
+                </property>
+                <property>
+                    <name>porosity</name>
+                    <type>Constant</type>
+                    <value>0.17</value>
+                </property>
+                <property>
+                    <name>storage</name>
+                    <type>Constant</type>
+                    <value> 0.0 </value>
+                </property>
+            </properties>
+        </medium>
+    </media>
+    <parameters>
+        <parameter>
+             <name>p_0</name>
+             <type>Function</type>
+             <expression>z</expression>
+        </parameter>
+        <parameter>
+             <name>p_polyline_left</name>
+             <type>Function</type>
+             <expression>x+1</expression>
+        </parameter>
+        <parameter>
+             <name>p_polyline_right</name>
+             <type>Function</type>
+             <expression>x-5</expression>
+        </parameter>
+    </parameters>
+    <process_variables>
+        <process_variable>
+            <name>pressure</name>
+            <order>1</order>
+            <components>1</components>
+            <initial_condition>p_0</initial_condition>
+            <boundary_conditions>
+                <boundary_condition>
+                    <type>Dirichlet</type>
+                    <mesh>square_5x5_tris_32_left_boundary</mesh>
+                    <parameter>p_polyline_left</parameter>
+                </boundary_condition>
+                <boundary_condition>
+                    <type>Dirichlet</type>
+                    <mesh>square_5x5_tris_32_right_boundary</mesh>
+                    <parameter>p_polyline_right</parameter>
+                </boundary_condition>
+            </boundary_conditions>
+        </process_variable>
+    </process_variables>
+    <time_loop>
+        <processes>
+            <process ref="LiquidFlow">
+                <nonlinear_solver>basic_picard</nonlinear_solver>
+                <convergence_criterion>
+                    <type>DeltaX</type>
+                    <norm_type>NORM2</norm_type>
+                    <abstol>1.e-6</abstol>
+                </convergence_criterion>
+                <time_discretization>
+                    <type>BackwardEuler</type>
+                </time_discretization>
+                <time_stepping>
+                    <type>FixedTimeStepping</type>
+                    <t_initial> 0 </t_initial>
+                    <t_end> 1 </t_end>
+                    <timesteps>
+                        <pair>
+                            <repeat>1</repeat>
+                            <delta_t>1</delta_t>
+                        </pair>
+                    </timesteps>
+                </time_stepping>
+            </process>
+        </processes>
+        <output>
+            <type>VTK</type>
+            <prefix>{:meshname}</prefix>
+            <suffix>_ts_{:timestep}_t_{:time}</suffix>
+            <meshes>
+                <mesh>square_5x5_tris_32</mesh>
+            </meshes>
+            <timesteps>
+                <pair>
+                    <repeat>1</repeat>
+                    <each_steps>1</each_steps>
+                </pair>
+            </timesteps>
+            <output_iteration_results>false</output_iteration_results>
+            <variables>
+                <variable> pressure </variable>
+                <variable> v </variable>
+            </variables>
+        </output>
+    </time_loop>
+    <nonlinear_solvers>
+        <nonlinear_solver>
+            <name>basic_picard</name>
+            <type>Picard</type>
+            <max_iter>10</max_iter>
+            <linear_solver>general_linear_solver</linear_solver>
+        </nonlinear_solver>
+    </nonlinear_solvers>
+    <linear_solvers>
+        <linear_solver>
+            <name>general_linear_solver</name>
+            <lis>-i cg -p jacobi -tol 1e-15 -maxiter 10000</lis>
+            <eigen>
+                <solver_type>BiCGSTAB</solver_type>
+                <precon_type>DIAGONAL</precon_type>
+                <max_iteration_step>1000</max_iteration_step>
+                <error_tolerance>1e-16</error_tolerance>
+            </eigen>
+            <petsc>
+                <prefix>lf</prefix>
+                <parameters>-lf_ksp_type cg -lf_pc_type bjacobi -lf_ksp_rtol 1e-16 -lf_ksp_max_it 10000</parameters>
+            </petsc>
+        </linear_solver>
+    </linear_solvers>
+    <test_definition>
+        <vtkdiff>
+            <regex>square_5x5_tris_32_ts_1_t_1.000000.vtu</regex>
+            <field>pressure</field>
+            <absolute_tolerance>1e-15</absolute_tolerance>
+            <relative_tolerance>1e-14</relative_tolerance>
+        </vtkdiff>
+    </test_definition>
+</OpenGeoSysProject>
diff --git a/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32.vtu b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32.vtu
new file mode 100644
index 0000000000000000000000000000000000000000..af7bdb6b4b1f69d6f3aa8d7328b55cc447297416
GIT binary patch
literal 4038
zcmds4T~8B16h#Has`!N;iHTV^CMG7*ZVN3<wkSfu1}KPt#>CX2ox;ZLZnL{Z`wxBe
zC-~^25B>mWcJJA?(=ClL8soei?zwmGJ$LrbY%ve^Hr6bgYeBcoOZvX!2VSQhbUfZz
z_pFAlop8^$T&JWPa~WMb>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;rI3HJzJ6TT&UNBEvl
YBb*wu!k+{EU;d?(_#q$t@4l4!2_73paR2}S

literal 0
HcmV?d00001

diff --git a/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_left_boundary.vtu b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_left_boundary.vtu
new file mode 100644
index 00000000000..52b20854c8f
--- /dev/null
+++ b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_left_boundary.vtu
@@ -0,0 +1,51 @@
+<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
+  <UnstructuredGrid>
+    <Piece NumberOfPoints="5" NumberOfCells="4">
+      <PointData Scalars="bulk_node_ids">
+        <DataArray type="UInt64" IdType="1" Name="bulk_node_ids" format="ascii" RangeMin="0" RangeMax="20">
+          5 0 10 15 20
+        </DataArray>
+      </PointData>
+      <CellData Scalars="bulk_element_ids">
+        <DataArray type="UInt64" IdType="1" Name="bulk_element_ids" format="ascii" RangeMin="0" RangeMax="24">
+          0 8 16 24
+        </DataArray>
+      </CellData>
+      <Points>
+        <DataArray type="Float64" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="0" RangeMax="5">
+          0 1.25 3 0 0 3
+          0 2.5 3 0 3.75 3
+          0 5 3
+          <InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
+            <Value index="0">
+              0
+            </Value>
+            <Value index="1">
+              5
+            </Value>
+          </InformationKey>
+          <InformationKey name="L2_NORM_FINITE_RANGE" location="vtkDataArray" length="2">
+            <Value index="0">
+              0
+            </Value>
+            <Value index="1">
+              5
+            </Value>
+          </InformationKey>
+        </DataArray>
+      </Points>
+      <Cells>
+        <DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="4">
+          0 1 2 0 3 2
+          4 3
+        </DataArray>
+        <DataArray type="Int64" Name="offsets" format="ascii" RangeMin="2" RangeMax="8">
+          2 4 6 8
+        </DataArray>
+        <DataArray type="UInt8" Name="types" format="ascii" RangeMin="3" RangeMax="3">
+          3 3 3 3
+        </DataArray>
+      </Cells>
+    </Piece>
+  </UnstructuredGrid>
+</VTKFile>
diff --git a/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_right_boundary.vtu b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_right_boundary.vtu
new file mode 100644
index 00000000000..8df915d4a23
--- /dev/null
+++ b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_right_boundary.vtu
@@ -0,0 +1,51 @@
+<VTKFile type="UnstructuredGrid" version="1.0" byte_order="LittleEndian" header_type="UInt64">
+  <UnstructuredGrid>
+    <Piece NumberOfPoints="5" NumberOfCells="4">
+      <PointData Scalars="bulk_node_ids">
+        <DataArray type="UInt64" IdType="1" Name="bulk_node_ids" format="ascii" RangeMin="4" RangeMax="24">
+          4 9 14 19 24
+        </DataArray>
+      </PointData>
+      <CellData Scalars="bulk_element_ids">
+        <DataArray type="UInt64" IdType="1" Name="bulk_element_ids" format="ascii" RangeMin="7" RangeMax="31">
+          7 15 23 31
+        </DataArray>
+      </CellData>
+      <Points>
+        <DataArray type="Float64" Name="Points" NumberOfComponents="3" format="ascii" RangeMin="5" RangeMax="7.0710678118654755">
+          5 0 3 5 1.25 3
+          5 2.5 3 5 3.75 3
+          5 5 3
+          <InformationKey name="L2_NORM_RANGE" location="vtkDataArray" length="2">
+            <Value index="0">
+              5
+            </Value>
+            <Value index="1">
+              7.0710678119
+            </Value>
+          </InformationKey>
+          <InformationKey name="L2_NORM_FINITE_RANGE" location="vtkDataArray" length="2">
+            <Value index="0">
+              5
+            </Value>
+            <Value index="1">
+              7.0710678119
+            </Value>
+          </InformationKey>
+        </DataArray>
+      </Points>
+      <Cells>
+        <DataArray type="Int64" Name="connectivity" format="ascii" RangeMin="0" RangeMax="4">
+          0 1 1 2 2 3
+          3 4
+        </DataArray>
+        <DataArray type="Int64" Name="offsets" format="ascii" RangeMin="2" RangeMax="8">
+          2 4 6 8
+        </DataArray>
+        <DataArray type="UInt8" Name="types" format="ascii" RangeMin="3" RangeMax="3">
+          3 3 3 3
+        </DataArray>
+      </Cells>
+    </Piece>
+  </UnstructuredGrid>
+</VTKFile>
diff --git a/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_ts_1_t_1.000000.vtu b/Tests/Data/Parabolic/LiquidFlow/SimpleSynthetics/square_5x5_tris_32_ts_1_t_1.000000.vtu
new file mode 100644
index 0000000000000000000000000000000000000000..af7bdb6b4b1f69d6f3aa8d7328b55cc447297416
GIT binary patch
literal 4038
zcmds4T~8B16h#Has`!N;iHTV^CMG7*ZVN3<wkSfu1}KPt#>CX2ox;ZLZnL{Z`wxBe
zC-~^25B>mWcJJA?(=ClL8soei?zwmGJ$LrbY%ve^Hr6bgYeBcoOZvX!2VSQhbUfZz
z_pFAlop8^$T&JWPa~WMb>;}B%dJXQC^i3-WY+iO67ISp%m@~oFC{4u)^7HyqO4Cd=
zr6dKtWAQrIs-4y$_qLlmuH^)NNzX3m(yJ^)t#I2GLAh)~P?T0CmZ?@*z_eF&W;0Jb
z(Du0Ri<Uw`QEpR4EPEd7Qs+Xk%v)tGu?<@+;GV_o%BrtxP1kF&pro^Qn>!6I_GFhi
zM|{f?n<BO(VMTuSX_Vh>HhnHKCO(ZuL@Vi7WFHxGBz(<wncQrW9{2iNx{buXpxekS
z4*UBg4(m44@oPbxDc`1SCMMEDOf(h<5IZua`6ym&1&!5;+iJTG4@WC^`kNH)gw=bK
zg}MBqVazWS<_pDMD0U=g<a;FY^mGg56(^b_ah5iCS98KS+sxLg+q+w}wMw<JSFY_Y
zSJ%tBX1jG3glFy~_z-t2c<vkp$KsIm&9SUy9x%JZHA@U<ICA}Ur9T&*IQf@cW;zTX
z3>r*fC<QdFzx#37%=BQd{gqDNhX1|)gab_n!^b9try{lzCO*1Z>9E&b$KmzBI<bQ8
z>Ek^-opKg><D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