SSH host keys have changed! See this Discourse post for details.

Commit 4653460d authored by Lars Bilke's avatar Lars Bilke
Browse files

Added Tests/lfs-data as of ufz/ogs-data@a9f0365.

parent 076a2590
from paraview.simple import *
from paraview import coprocessing
#--------------------------------------------------------------
# Code generated from cpstate.py to create the CoProcessor.
# ParaView 5.2.0 64 bits
# ----------------------- CoProcessor definition -----------------------
def CreateCoProcessor():
def _CreatePipeline(coprocessor, datadescription):
class Pipeline:
# state file generated using paraview version 5.2.0
# ----------------------------------------------------------------
# setup the data processing pipelines
# ----------------------------------------------------------------
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'XML Unstructured Grid Reader'
# create a producer from a simulation input
cube_1e0_pcs_0_ts_0_t_0000000vtu = coprocessor.CreateProducer(datadescription, 'input')
# create a new 'Contour'
contour1 = Contour(Input=cube_1e0_pcs_0_ts_0_t_0000000vtu)
contour1.ContourBy = ['POINTS', 'D1_left_front_N1_right']
contour1.ComputeScalars = 1
contour1.Isosurfaces = [1.0, 1.0750344444444444, 1.1500688888888888, 1.2251033333333334, 1.3001377777777778, 1.3751722222222222, 1.4502066666666669, 1.5252411111111113, 1.6002755555555557, 1.67531]
contour1.PointMergeMethod = 'Uniform Binning'
# create a new 'Parallel PolyData Writer'
parallelPolyDataWriter1 = servermanager.writers.XMLPPolyDataWriter(Input=contour1)
# register the writer with coprocessor
# and provide it with information such as the filename to use,
# how frequently to write the data, etc.
coprocessor.RegisterWriter(parallelPolyDataWriter1, filename='filename_%t.pvtp', freq=1)
# ----------------------------------------------------------------
# finally, restore active source
SetActiveSource(contour1)
# ----------------------------------------------------------------
return Pipeline()
class CoProcessor(coprocessing.CoProcessor):
def CreatePipeline(self, datadescription):
self.Pipeline = _CreatePipeline(self, datadescription)
coprocessor = CoProcessor()
# these are the frequencies at which the coprocessor updates.
freqs = {'input': [1]}
coprocessor.SetUpdateFrequencies(freqs)
return coprocessor
#--------------------------------------------------------------
# Global variables that will hold the pipeline for each timestep
# Creating the CoProcessor object, doesn't actually create the ParaView pipeline.
# It will be automatically setup when coprocessor.UpdateProducers() is called the
# first time.
coprocessor = CreateCoProcessor()
#--------------------------------------------------------------
# Enable Live-Visualizaton with ParaView
coprocessor.EnableLiveVisualization(False, 1)
# ---------------------- Data Selection method ----------------------
def RequestDataDescription(datadescription):
"Callback to populate the request for current timestep"
global coprocessor
if datadescription.GetForceOutput() == True:
# We are just going to request all fields and meshes from the simulation
# code/adaptor.
for i in range(datadescription.GetNumberOfInputDescriptions()):
datadescription.GetInputDescription(i).AllFieldsOn()
datadescription.GetInputDescription(i).GenerateMeshOn()
return
# setup requests for all inputs based on the requirements of the
# pipeline.
coprocessor.LoadRequestedData(datadescription)
# ------------------------ Processing method ------------------------
def DoCoProcessing(datadescription):
"Callback to do co-processing for current timestep"
global coprocessor
# Update the coprocessor by providing it the newly generated simulation data.
# If the pipeline hasn't been setup yet, this will setup the pipeline.
coprocessor.UpdateProducers(datadescription)
# Write output data, if appropriate.
coprocessor.WriteData(datadescription);
# Write image capture (Last arg: rescale lookup table), if appropriate.
coprocessor.WriteImages(datadescription, rescale_lookuptable=False)
# Live Visualization, if enabled.
coprocessor.DoLiveVisualization(datadescription, "localhost", 22222)
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<mesh>cube_1x1x1_hex_1e0.vtu</mesh>
<geometry>cube_1x1x1.gml</geometry>
<processes>
<process>
<name>GW23</name>
<type>GROUNDWATER_FLOW</type>
<integration_order>2</integration_order>
<hydraulic_conductivity>K</hydraulic_conductivity>
<process_variables>
<process_variable>pressure</process_variable>
</process_variables>
<secondary_variables>
<secondary_variable type="static" internal_name="darcy_velocity" output_name="v"/>
</secondary_variables>
</process>
</processes>
<time_loop>
<processes>
<process ref="GW23">
<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>
<output>
<variables>
<variable> pressure </variable>
<variable> v </variable>
</variables>
</output>
<time_stepping>
<type>SingleStep</type>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>cube_1e0</prefix>
</output>
</time_loop>
<parameters>
<parameter>
<name>K</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>p0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>p_Dirichlet_left</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>p_Dirichlet_right</name>
<type>Constant</type>
<value>-1</value>
</parameter>
</parameters>
<process_variables>
<process_variable>
<name>pressure</name>
<components>1</components>
<order>1</order>
<initial_condition>p0</initial_condition>
<boundary_conditions>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>left</geometry>
<type>Dirichlet</type>
<parameter>p_Dirichlet_left</parameter>
</boundary_condition>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>right</geometry>
<type>Dirichlet</type>
<parameter>p_Dirichlet_right</parameter>
</boundary_condition>
</boundary_conditions>
</process_variable>
</process_variables>
<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-16 -maxiter 10000</lis>
<eigen>
<solver_type>CG</solver_type>
<precon_type>DIAGONAL</precon_type>
<max_iteration_step>10000</max_iteration_step>
<error_tolerance>1e-16</error_tolerance>
</eigen>
<petsc>
<prefix>gw</prefix>
<parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
</petsc>
</linear_solver>
</linear_solvers>
</OpenGeoSysProject>
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<mesh>cube_1x1x1_hex_1e0.vtu</mesh>
<geometry>cube_1x1x1.gml</geometry>
<processes>
<process>
<name>GW23</name>
<type>GROUNDWATER_FLOW</type>
<integration_order>2</integration_order>
<hydraulic_conductivity>K</hydraulic_conductivity>
<process_variables>
<process_variable>pressure</process_variable>
</process_variables>
<secondary_variables>
<secondary_variable type="static" internal_name="darcy_velocity" output_name="v"/>
</secondary_variables>
</process>
</processes>
<time_loop>
<processes>
<process ref="GW23">
<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>
<output>
<variables>
<variable> pressure </variable>
<variable> v </variable>
</variables>
</output>
<time_stepping>
<type>SingleStep</type>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>cube_1e0_neumann</prefix>
</output>
</time_loop>
<parameters>
<parameter>
<name>K</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>p0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>p_neumann</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>p_Dirichlet</name>
<type>Constant</type>
<value>1</value>
</parameter>
</parameters>
<process_variables>
<process_variable>
<name>pressure</name>
<components>1</components>
<order>1</order>
<initial_condition>p0</initial_condition>
<boundary_conditions>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>left</geometry>
<type>Dirichlet</type>
<parameter>p_Dirichlet</parameter>
</boundary_condition>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>front</geometry>
<type>Dirichlet</type>
<parameter>p_Dirichlet</parameter>
</boundary_condition>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>right</geometry>
<type>Neumann</type>
<parameter>p_neumann</parameter>
</boundary_condition>
</boundary_conditions>
</process_variable>
</process_variables>
<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-16 -maxiter 10000</lis>
<eigen>
<solver_type>CG</solver_type>
<precon_type>DIAGONAL</precon_type>
<max_iteration_step>10000</max_iteration_step>
<error_tolerance>1e-16</error_tolerance>
</eigen>
<petsc>
<prefix>gw</prefix>
<parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
</petsc>
</linear_solver>
</linear_solvers>
</OpenGeoSysProject>
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<mesh>cube_1x1x1_hex_1e0.vtu</mesh>
<geometry>cube_1x1x1.gml</geometry>
<processes>
<process>
<name>GW23</name>
<type>GROUNDWATER_FLOW</type>
<integration_order>2</integration_order>
<hydraulic_conductivity>K</hydraulic_conductivity>
<jacobian_assembler>
<type>CentralDifferences</type>
</jacobian_assembler>
<process_variables>
<process_variable>pressure</process_variable>
</process_variables>
<secondary_variables>
<secondary_variable type="static" internal_name="darcy_velocity" output_name="v"/>
</secondary_variables>
</process>
</processes>
<time_loop>
<processes>
<process ref="GW23">
<nonlinear_solver>basic_newton</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>
<output>
<variables>
<variable> pressure </variable>
<variable> v </variable>
</variables>
</output>
<time_stepping>
<type>SingleStep</type>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>cube_1e0_newton</prefix>
</output>
</time_loop>
<parameters>
<parameter>
<name>K</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>p0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>p_Dirichlet_left</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>p_Dirichlet_right</name>
<type>Constant</type>
<value>-1</value>
</parameter>
</parameters>
<process_variables>
<process_variable>
<name>pressure</name>
<components>1</components>
<order>1</order>
<initial_condition>p0</initial_condition>
<boundary_conditions>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>left</geometry>
<type>Dirichlet</type>
<parameter>p_Dirichlet_left</parameter>
</boundary_condition>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>right</geometry>
<type>Dirichlet</type>
<parameter>p_Dirichlet_right</parameter>
</boundary_condition>
</boundary_conditions>
</process_variable>
</process_variables>
<nonlinear_solvers>
<nonlinear_solver>
<name>basic_newton</name>
<type>Newton</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-16 -maxiter 10000</lis>
<eigen>
<solver_type>CG</solver_type>
<precon_type>DIAGONAL</precon_type>
<max_iteration_step>10000</max_iteration_step>
<error_tolerance>1e-16</error_tolerance>
</eigen>
<petsc>
<prefix>gw</prefix>
<parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
</petsc>
</linear_solver>
</linear_solvers>
</OpenGeoSysProject>
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<mesh>cube_1x1x1_hex20_1e0.vtu</mesh>
<geometry>cube_1x1x1.gml</geometry>
<processes>
<process>
<name>GW23</name>
<type>GROUNDWATER_FLOW</type>
<integration_order>3</integration_order>
<hydraulic_conductivity>K</hydraulic_conductivity>
<process_variables>
<process_variable>pressure</process_variable>
</process_variables>
<secondary_variables>
<secondary_variable type="static" internal_name="darcy_velocity" output_name="v"/>
</secondary_variables>
</process>
</processes>
<time_loop>
<processes>
<process ref="GW23">
<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>
<output>
<variables>
<variable> pressure </variable>
<variable> v </variable>
</variables>
</output>
<time_stepping>
<type>SingleStep</type>
</time_stepping>
</process>
</processes>
<output>
<type>VTK</type>
<prefix>cube_1e0_quadratic_hex</prefix>
</output>
</time_loop>
<parameters>
<parameter>
<name>K</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>p0</name>
<type>Constant</type>
<value>0</value>
</parameter>
<parameter>
<name>p_Dirichlet_left</name>
<type>Constant</type>
<value>1</value>
</parameter>
<parameter>
<name>p_Dirichlet_right</name>
<type>Constant</type>
<value>-1</value>
</parameter>
</parameters>
<process_variables>
<process_variable>
<name>pressure</name>
<components>1</components>
<order>2</order>
<initial_condition>p0</initial_condition>
<boundary_conditions>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>left</geometry>
<type>Dirichlet</type>
<parameter>p_Dirichlet_left</parameter>
</boundary_condition>
<boundary_condition>
<geometrical_set>cube_1x1x1_geometry</geometrical_set>
<geometry>right</geometry>
<type>Dirichlet</type>
<parameter>p_Dirichlet_right</parameter>
</boundary_condition>
</boundary_conditions>
</process_variable>
</process_variables>
<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-16 -maxiter 10000</lis>
<eigen>
<solver_type>CG</solver_type>
<precon_type>DIAGONAL</precon_type>
<max_iteration_step>10000</max_iteration_step>
<error_tolerance>1e-16</error_tolerance>
</eigen>
<petsc>
<prefix>gw</prefix>
<parameters>-gw_ksp_type cg -gw_pc_type bjacobi -gw_ksp_rtol 1e-16 -gw_ksp_max_it 10000</parameters>
</petsc>
</linear_solver>
</linear_solvers>
</OpenGeoSysProject>
<?xml version="1.0" encoding="ISO-8859-1"?>
<OpenGeoSysProject>
<mesh>cube_1x1x1_hex_1e1.vtu</mesh>
<geometry>cube_1x1x1.gml</geometry>
<processes>
<process>
<name>GW23</name>
<type>GROUNDWATER_FLOW</type>
<integration_order>2</integration_order>
<hydraulic_conductivity>K</hydraulic_conductivity>
<process_variables>
<process_variable>pressure</process_variable>
</process_variables>