Skip to content

Commit

Permalink
add in-code quadrature bump test
Browse files Browse the repository at this point in the history
  • Loading branch information
rwcarlsen authored and milljm committed Jul 15, 2020
1 parent 52261f2 commit 5dc564b
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 2 deletions.
8 changes: 6 additions & 2 deletions framework/include/base/Assembly.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,19 @@ class Assembly

/**
* Creates volume, face and arbitrary qrules based on the orders passed in
* that apply to all subdomains.
* that apply to all subdomains. order is used for arbitrary volume
* quadrature rules, while volume_order and face_order are for elem and face
* quadrature respectively.
*/
void createQRules(QuadratureType type, Order order, Order volume_order, Order face_order);

/**
* Creates block-specific volume, face and arbitrary qrules based on the
* orders passed in. Any quadrature rules specified using this function
* override those created via in the non-block-specific/global createQRules
* function.
* function. order is used for arbitrary volume quadrature rules, while
* volume_order and face_order are for elem and face quadrature
* respectively.
*/
void createQRules(
QuadratureType type, Order order, Order volume_order, Order face_order, SubdomainID block);
Expand Down
26 changes: 26 additions & 0 deletions test/include/materials/QuadratureOrderBumper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#pragma once

#include "Material.h"

/**
* Bumps the quadrature to a higher specified order on its active blocks.
*/
class QuadratureOrderBumper : public Material
{
public:
static InputParameters validParams();

QuadratureOrderBumper(const InputParameters & parameters);

protected:
virtual void computeQpProperties() {}
};
33 changes: 33 additions & 0 deletions test/src/materials/QuadratureOrderBumper.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html

#include "QuadratureOrderBumper.h"

registerMooseObject("MooseTestApp", QuadratureOrderBumper);

InputParameters
QuadratureOrderBumper::validParams()
{
MooseEnum order("AUTO CONSTANT FIRST SECOND THIRD FOURTH FIFTH SIXTH SEVENTH EIGHTH NINTH TENTH "
"ELEVENTH TWELFTH THIRTEENTH FOURTEENTH FIFTEENTH SIXTEENTH SEVENTEENTH "
"EIGHTTEENTH NINTEENTH TWENTIETH",
"AUTO");

InputParameters params = Material::validParams();
params.addParam<MooseEnum>("order", order, "Order of the quadrature");
return params;
}

QuadratureOrderBumper::QuadratureOrderBumper(const InputParameters & parameters)
: Material(parameters)
{
for (auto block : blockIDs())
_fe_problem.bumpVolumeQRuleOrder(Moose::stringToEnum<Order>(getParam<MooseEnum>("order")),
block);
}
66 changes: 66 additions & 0 deletions test/tests/quadrature/order/code-order-bump.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 1
ny = 2
xmin = 0
xmax = 1
ymin = 0
ymax = 2
[]

[left]
type = SubdomainBoundingBoxGenerator
input = gmg
block_id = 1
bottom_left = '0 0 0'
top_right = '1 1 0'
[]
[right]
type = SubdomainBoundingBoxGenerator
input = left
block_id = 2
bottom_left = '0 1 0'
top_right = '1 2 0'
[]
[]

[Materials]
[mat2]
type = QuadratureOrderBumper
order = third
block = '1'
[]
[mat]
type = QuadratureOrderBumper
order = tenth
block = '2'
[]
[]

[Postprocessors]
[block1_qps]
type = NumElemQPs
block = 1
[]
[block2_qps]
type = NumElemQPs
block = 2
[]
[]

[Problem]
type = FEProblem
solve = false
[]

[Executioner]
type = Steady
[]

[Outputs]
execute_on = 'timestep_end'
exodus = false
csv = true
[]
2 changes: 2 additions & 0 deletions test/tests/quadrature/order/gold/code-order-bump_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
time,block1_qps,block2_qps
1,4,36
10 changes: 10 additions & 0 deletions test/tests/quadrature/order/tests
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
issues = '#14055'
design = 'Quadrature/index.md'
[../]
[./code-order-bump]
type = CSVDiff
input = 'code-order-bump.i'
csvdiff = 'code-order-bump_out.csv'

requirement = 'The system shall support the ability for objects to increase quadrature order'
' in code during runtime.'
issues = '#14055'
design = 'Quadrature/index.md'
[../]
[./elem5_side7]
type = CSVDiff
input = 'elem5_side7.i'
Expand Down

0 comments on commit 5dc564b

Please sign in to comment.