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

Allowing to define an array varible with component size one #19564

Closed
yjung-anl opened this issue Dec 7, 2021 · 1 comment · Fixed by #19567
Closed

Allowing to define an array varible with component size one #19564

yjung-anl opened this issue Dec 7, 2021 · 1 comment · Fixed by #19567
Labels
C: Framework T: task An enhancement to the software.

Comments

@yjung-anl
Copy link
Contributor

Reason

An array variable is automatically defined as an normal variable if its component size is one.
This is a reasonable implementation in for most of cases.

In the HFEM-PN solver of Griffin, the solution is expnanded using the spherical harmonics functions. Its expansion coefficients are dofs of the HFEM-PN solver. The expansion coefficients are defined as array variables and the array kernels for HFEM-PN equations were developed. The number of components in array variables are determined the expansion order of spherical harmonics. If the expansion order is set one, the number of component of array variable become one.Then, this variable is automatically defined as normal variables, which are incompatible with the array kernels.

In order to make it compatible with the array kernel in any expansion orders, a new option for defining an array varialbe regardless of its component sizes (allow us to define an array variable with size one).

Design

A new input parameter, is_av, was added to AddVariableAction::determineType in AddVariableAction.C:

std::string
AddVariableAction::determineType(const FEType & fe_type, unsigned int components, bool is_fv, bool is_av)
{
  if (is_fv)
    return "MooseVariableFVReal";

  if (components > 1 || is_av)
  {
    if (fe_type.family == LAGRANGE_VEC || fe_type.family == NEDELEC_ONE ||
        fe_type.family == MONOMIAL_VEC)
      mooseError("Vector finite element families do not currently have ArrayVariable support");
    else
      return "ArrayMooseVariable";
  }
  ...
}

Some minor changes were made accordingly to MooseVariableBase::MooseVariableBase and SystemBase::addVariable.

Impact

A new option become avaiable which allows to define a array variable with component size one.

@yjung-anl yjung-anl added the T: task An enhancement to the software. label Dec 7, 2021
@yjung-anl
Copy link
Contributor Author

@YaqiWang
I created an issue for array variable with component size one.

loganharbour added a commit to yjung-anl/moose that referenced this issue Dec 7, 2021
loganharbour added a commit to yjung-anl/moose that referenced this issue Dec 7, 2021
loganharbour added a commit to yjung-anl/moose that referenced this issue Dec 7, 2021
loganharbour added a commit to yjung-anl/moose that referenced this issue Dec 7, 2021
loganharbour added a commit to loganharbour/moose that referenced this issue Dec 8, 2021
loganharbour added a commit to loganharbour/moose that referenced this issue Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework T: task An enhancement to the software.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants