forked from neams-th-coe/cardinal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request neams-th-coe#630 from aprilnovak/hide-other-stuff
Add base class to disable unused parameters.
- Loading branch information
Showing
6 changed files
with
113 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/********************************************************************/ | ||
/* SOFTWARE COPYRIGHT NOTIFICATION */ | ||
/* Cardinal */ | ||
/* */ | ||
/* (c) 2021 UChicago Argonne, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by UChicago Argonne, LLC */ | ||
/* Under Contract No. DE-AC02-06CH11357 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See LICENSE for full restrictions */ | ||
/********************************************************************/ | ||
|
||
#pragma once | ||
|
||
#include "ExternalProblem.h" | ||
|
||
/** | ||
* Base class for all MOOSE wrappings in Cardinal | ||
*/ | ||
class CardinalProblem : public ExternalProblem | ||
{ | ||
public: | ||
CardinalProblem(const InputParameters & params); | ||
|
||
static InputParameters validParams(); | ||
|
||
/** | ||
* Check whether the user has already created a variable using one of the protected | ||
* names that the wrapping is using. | ||
* @param[in] name variable name | ||
*/ | ||
void checkDuplicateVariableName(const std::string & name) const; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/********************************************************************/ | ||
/* SOFTWARE COPYRIGHT NOTIFICATION */ | ||
/* Cardinal */ | ||
/* */ | ||
/* (c) 2021 UChicago Argonne, LLC */ | ||
/* ALL RIGHTS RESERVED */ | ||
/* */ | ||
/* Prepared by UChicago Argonne, LLC */ | ||
/* Under Contract No. DE-AC02-06CH11357 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* Prepared by Battelle Energy Alliance, LLC */ | ||
/* Under Contract No. DE-AC07-05ID14517 */ | ||
/* With the U. S. Department of Energy */ | ||
/* */ | ||
/* See LICENSE for full restrictions */ | ||
/********************************************************************/ | ||
|
||
#include "CardinalProblem.h" | ||
#include "NonlinearSystem.h" | ||
#include "AuxiliarySystem.h" | ||
|
||
InputParameters | ||
CardinalProblem::validParams() | ||
{ | ||
InputParameters params = ExternalProblem::validParams(); | ||
|
||
// these parameters don't do anything for ExternalProblem, and instead just | ||
// clutter the MooseDocs | ||
params.suppressParameter<bool>("allow_invalid_solution"); | ||
params.suppressParameter<bool>("boundary_restricted_elem_integrity_check"); | ||
params.suppressParameter<bool>("boundary_restricted_node_integrity_check"); | ||
params.suppressParameter<bool>("check_uo_aux_state"); | ||
params.suppressParameter<bool>("error_on_jacobian_nonzero_reallocation"); | ||
params.suppressParameter<std::vector<std::vector<TagName>>>("extra_tag_matrices"); | ||
params.suppressParameter<std::vector<TagName>>("extra_tag_solutions"); | ||
params.suppressParameter<std::vector<std::vector<TagName>>>("extra_tag_vectors"); | ||
params.suppressParameter<bool>("force_restart"); | ||
params.suppressParameter<bool>("fv_bcs_integrity_check"); | ||
params.suppressParameter<bool>("material_dependency_check"); | ||
params.suppressParameter<unsigned int>("near_null_space_dimension"); | ||
params.suppressParameter<unsigned int>("null_space_dimension"); | ||
params.suppressParameter<unsigned int>("transpose_null_space_dimension"); | ||
|
||
return params; | ||
} | ||
|
||
CardinalProblem::CardinalProblem(const InputParameters & params) | ||
: ExternalProblem(params) | ||
{ | ||
} | ||
|
||
void | ||
CardinalProblem::checkDuplicateVariableName(const std::string & name) const | ||
{ | ||
if (_aux.get()->hasVariable(name)) | ||
mooseError("Cardinal is trying to add an auxiliary variable named '", name, | ||
"', but you already have a variable by this name. Please choose a different name " | ||
"for the auxiliary variable you are adding."); | ||
|
||
if (_nl[0].get()->hasVariable(name)) | ||
mooseError("Cardinal is trying to add a nonlinear variable named '", name, | ||
"', but you already have a variable by this name. Please choose a different name " | ||
"for the nonlinear variable you are adding."); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters