idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.77k stars 1.05k forks source link

A misleading error message related with adaptation and stateful material property #12422

Open YaqiWang opened 6 years ago

YaqiWang commented 6 years ago

Rationale

I am hitting an error

*** ERROR ***
Stateful neighbor material properties do not work with mesh adaptivity

I know I have a stateful material property and mesh adaptation, but this material property is only used by kernel. I should not hit this error though.

Description

As rational. I think it should be easy to come up a test to show the issue.

Impact

Make the error message meaningful and allow calculations prevented by the error.

permcody commented 6 years ago

Any chance you can help use replicate?

YaqiWang commented 6 years ago

Yes, but need to finish something first. I think produce this with a moose test should be easy. It may requires me to create a special dummy kernel and material for the test.

YaqiWang commented 6 years ago

Here you are:

[Mesh]
  type = GeneratedMesh
  dim = 2
  xmin = 0
  xmax = 1
  ymin = 0
  ymax = 1
  nx = 4
  ny = 4
[]

[Variables]
  [./u]
  [../]
[]

[Kernels]
  [./diff]
    type = MatDiffusionTest
    variable = u
    prop_state = old
    prop_name = a
  [../]
  [./time]
    type = TimeDerivative
    variable = u
  [../]
[]

[BCs]
  [./left]
    type = DirichletBC
    variable = u
    boundary = left
    value = 1
  [../]
[]

[DGKernels]
  [./dummy]
    type = DGDiffusion
    variable = u
    sigma = 4
    epsilon = 1
  [../]
[]

[Materials]
  [./mat]
    type = GenericConstantMaterial
    prop_names = a
    prop_values = 1
  [../]
[]

[Adaptivity]
  marker = box
  initial_steps = 3
  cycles_per_step = 0
  [./Markers]
    [./box]
      bottom_left = '0 0 0'
      inside = refine
      top_right = '0.5 0.5 0'
      outside = do_nothing
      type = BoxMarker
    [../]
  [../]
[]

[Executioner]
  type = Transient
  num_steps = 5
[]

[Outputs]
  exodus = true
[]

Note that the dummy dg kernel is the key. Looks to me logic in https://github.com/idaholab/moose/blob/devel/framework/src/problems/FEProblemBase.C#L618 is not fine enough thus issuing false positive error. Ideally it should check if side objects is using a stateful properties.

YaqiWang commented 6 years ago

Also looks like having stateful property changes the partitioning back the scene. If we do not use stateful properties on side, can we not change the partitioning?