Flux reconstruction on FV does not work with alpha volumes
Flux reconstruction on FV does not work with alpha volumes
Summary
Whenever a volume method is added to the finite volume operators, a segfault is raised when computing the flux reconstruction for such an operator. This affects any model using flux reconstruction.
Steps to reproduce
Run https://ts-gitlab.iup.uni-heidelberg.de/sluedke/dorie/-/tree/master/ with finite volumes and flux reconstruction enabled.
What is the current bug behaviour?
Segfault when accessing the residual vector.
This happens because the volume part of the Raviart Thomas element of degree 0 has no degrees of freedom and thus volume methods should not contribute to the reconstruction. However, the local engine didn't foresee this situation and the volume methods are run. Naturally, this turns in a segfault.
What is the expected correct behaviour?
The alpha volume is not called when volume method has no degrees of freedm.
Relevant logs, screenshots, files...?
My test was run using cfg/config.ini
file on commit 0344494156ba2b49b2a59270d2a18995c98657e0
from @sluedke fork.
Expand to see logs
~/Codes/DORIE/dorie/cfg sluedke/master ● ⍟3 dorie run config.ini 2 ↵ 11096 21:02:14 [21:02:18.121 I] Starting DORiE [21:02:18.122 I] Reading configuration file: config.ini [21:02:18.131 I] Creating a rectangular grid in 2D [21:02:18.131 D] Grid extensions: 1.000000, 1.000000 [21:02:18.132 D] Grid cells: 100, 100 [21:02:18.138 D] Applying global refinement of level: 0 [21:02:18.178 T] [RIC] Setting up GridFunctionSpace [21:02:18.334 I] [RIC] Loading parameter data file: richards_param.yml [21:02:18.335 T] [RIC] Reading parameters. Volume: sand, Index: 1 [21:02:18.335 T] [RIC] Reading parameters. Volume: silt, Index: 0 [21:02:18.335 D] [RIC] Creating scaling adapter of type: None [21:02:18.354 I] [RIC] Loading boundary condition data file: richards_bc.yml [21:02:18.354 T] [RIC] Creating boundary condition. Mapping index: 0, Name: water_table [21:02:18.354 T] [RIC] Creating boundary condition. Mapping index: 1, Name: evaporation [21:02:18.354 T] [RIC] Creating boundary condition. Mapping index: 1, Name: long_rain [21:02:18.355 T] [RIC] Creating boundary condition. Mapping index: 1, Name: long_rain [21:02:18.355 T] [RIC] Creating boundary condition. Mapping index: 1, Name: evaporation [21:02:18.355 D] [RIC] Filling gaps in boundary condition specs with default boundary condition [21:02:18.360 W] read in end time as 1e+06 [21:02:18.360 I] the output_file is PlantOutput4_9_2020_21_2_18.csv [21:02:18.360 I] reading yml file root_parameter.yml [21:02:18.361 T] Creating Vector containing the Plants. [21:02:18.361 I] Reading in the data for Plant 1 [21:02:18.361 I] reading in the Seed location which is at x=0.3 [21:02:18.361 I] plant type is spruce [21:02:18.361 I] the alpha type is feddes [21:02:18.361 I] reading in feddes parameters [21:02:18.361 I] reading in beta parameters beta_type=spruce [21:02:18.361 I] gamma =0 [21:02:18.361 I] all plantdata is read in - plant is now created [21:02:18.361 I] the plant growth = true [21:02:18.372 I] Created Pointer to Boundary-Condition at Seed location [21:02:18.372 I] Reading in the data for Plant 2 [21:02:18.373 I] reading in the Seed location which is at x=1 [21:02:18.373 I] plant type is spruce [21:02:18.373 W] Plant-Seed close to the boundary [21:02:18.373 I] the alpha type is feddes [21:02:18.373 I] reading in feddes parameters [21:02:18.373 I] reading in beta parameters beta_type=spruce [21:02:18.373 I] gamma =1 [21:02:18.373 I] all plantdata is read in - plant is now created [21:02:18.373 I] the plant growth = false [21:02:18.384 I] Created Pointer to Boundary-Condition at Seed location [21:02:18.384 I] The Vector containing the plants is sucessfuly created. the filename isPlantOutput4_9_2020_21_2_18.csv initialization finished [21:02:18.384 D] [RIC] Creating initial condition of type: analytic [21:02:18.384 T] [RIC] Setting up parser for evaluating analytic function [21:02:18.385 D] [RIC] Reading local operator settings: [21:02:18.385 D] [RIC] Upwinding scheme: fullUpwind [21:02:18.385 D] [RIC] Ignoring settings 'numerics.DGMethod' and 'numerics.DGWeights' for finite volume solver. [21:02:18.385 D] [RIC] Setting up local grid operators: FV method [21:02:18.385 D] [RIC] Setting up grid operators and solvers [21:02:18.385 D] [RIC] Total number of DOF: 10000 [21:02:18.822 D] [RIC] Creating a VTK writer with subsampling level: 0 [21:02:18.822 I] [RIC] Setup complete [21:02:18.839 T] [RIC] Computing flux reconstruction with RT0 elements AddressSanitizer:DEADLYSIGNAL
Reproducing input
Do you have input files reproducing the problem? Insert them here:
Input data | |
---|---|
Simulation Case | Root plant computations |
PFG config file | none |
Grid mapping file | none |
GMSH grid file | none |
Parameterization file | richards_param.yml root_parameter.yml |
Boundary Condition file | richards_bc.yml |
Run config file | config.ini |
Ideas how to fix this?
Add conditional that avoids calling volume method when volume RT element is empty