Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getMaterialProperty in DGKernel is not checked for integrity #9482

Closed
YaqiWang opened this issue Jul 11, 2017 · 6 comments
Closed

getMaterialProperty in DGKernel is not checked for integrity #9482

YaqiWang opened this issue Jul 11, 2017 · 6 comments
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.

Comments

@YaqiWang
Copy link
Contributor

Description of the enhancement or error report

Looks like DGKernel::getMaterialProperty is not mark the consumer of the material property, thus the problem integrity check is not covering the case where DGKernel is trying to use a un-declared property.

Rationale for the enhancement or information for reproducing the error

DG kernels may not properly set up.

Identified impact

(i.e. Internal object changes, limited interface changes, public API change, or a list of specific applications impacted)
Input robustness.

@YaqiWang
Copy link
Contributor Author

YaqiWang commented Jul 12, 2017

Here is a test!

[Mesh]
  type = GeneratedMesh
  dim = 2
  nx = 2
  ny = 2
[]

[Debug]
  show_material_props = true
[]

[MeshModifiers]
  [./subdomain1]
    type = SubdomainBoundingBox
    bottom_left = '0 0 0'
    top_right = '0.5 0.5 0'
    block_id = 1
  [../]
[]

[Variables]
  [./u]
    order = FIRST
    family = MONOMIAL
  [../]
[]

[Kernels]
  [./diff]
    type = DiffMKernel
    variable = u
    mat_prop = prop1
    offset = 0
  [../]
  [./force]
    type = BodyForce
    variable = u
  [../]
[]

[DGKernels]
  [./dgdiffusion]
    type = DGDiffusion
    variable = u
    epsilon = 1
    sigma = 4
    diff = prop2
  [../]
[]

[BCs]
  [./vacuum]
    type = VacuumBC
    variable = u
    boundary = 'left right top bottom'
  [../]
[]

[Materials]
  [./mat1]
    type = GenericConstantMaterial
    block = '0 1'
    prop_names = 'prop1'
    prop_values = '1'
  [../]
  [./mat2]
    type = GenericConstantMaterial
# missing block 0 here, we should see an error!
    block = '1'
    prop_names = 'prop2'
    prop_values = '2'
  [../]
[]

[Postprocessors]
  [./unorm]
    type = ElementL2Norm
    variable = u
  [../]
[]

[Executioner]
  type = Steady
[]

[Outputs]
  exodus = true
[]

@permcody permcody added C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software. labels Jul 12, 2017
@permcody
Copy link
Member

I don't have time to work on this right now but it should be very easy to fix. We've just been intercepting the calls in other objects and keeping track of these things. I believe we do it in AuxKernel for instance.

YaqiWang added a commit to YaqiWang/moose that referenced this issue Jul 13, 2017
YaqiWang added a commit to YaqiWang/moose that referenced this issue Jul 13, 2017
YaqiWang added a commit to YaqiWang/moose that referenced this issue Jul 13, 2017
YaqiWang added a commit to YaqiWang/moose that referenced this issue Jul 14, 2017
YaqiWang added a commit to YaqiWang/moose that referenced this issue Jul 14, 2017
YaqiWang added a commit to YaqiWang/moose that referenced this issue Jul 14, 2017
@YaqiWang
Copy link
Contributor Author

While fixing this, I noticed two corner cases we miss the coverage check, see 18e60a2. We need to fix them in the future.

@lindsayad
Copy link
Member

@YaqiWang you should fix the coverage for IntegratedBC (#5309) as well :-)

@YaqiWang
Copy link
Contributor Author

Ah, did not realize an issue has already been created. It is too complicated because the property could be provided through volume-face materials or boundary materials. First there should be something in place to make sure the two sets of materials are not providing the same properties. We basically need a map in type std::map<BoundaryID, std::set<SubdomainID>> for all the blocks to any boundary and perform checks from there. Neighboring check on the other hand will be easier. It is a perfect moose project ;-)

@YaqiWang
Copy link
Contributor Author

YaqiWang commented Aug 31, 2017

The three tests contained in these two commit 5c033e6 and 18e60a2 can be used when the right fix is in place. Tag @permcody .

aeslaughter added a commit to aeslaughter/moose that referenced this issue Sep 13, 2017
aeslaughter added a commit to aeslaughter/moose that referenced this issue Sep 19, 2017
jarons pushed a commit to jarons/moose that referenced this issue Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.
Projects
None yet
Development

No branches or pull requests

3 participants