Skip to content
Permalink
Browse files

Merge pull request #13148 from tophmatthews/ad_dump_json_12960

Attempt to fix --dump and --json for AD objects
  • Loading branch information...
permcody committed Apr 1, 2019
2 parents b93bb87 + 2e34880 commit 26a7981013bf107c689780d7851e50d4c798ebb8
@@ -717,8 +717,10 @@ Parser::buildJsonSyntaxTree(JsonSyntaxTree & root) const
buildable_types.end()) && // Restricted but found
moose_obj_params.have_parameter<std::string>("_moose_base") && // Has a registered base
_syntax.verifyMooseObjectTask(moose_obj_params.get<std::string>("_moose_base"),
task) && // and that base is associated
action_obj_params.mooseObjectSyntaxVisibility()) // and the Action says it's visible
task) && // and that base is associated
action_obj_params.mooseObjectSyntaxVisibility() && // and the Action says it's visible
moose_obj->first.find("<JACOBIAN>") ==
std::string::npos) // And it is not a Jacobian templated AD object
{
std::string name;
size_t pos = 0;
@@ -814,8 +816,10 @@ Parser::buildFullTree(const std::string & search_string)
buildable_types.end()) && // Restricted but found
moose_obj_params.have_parameter<std::string>("_moose_base") && // Has a registered base
_syntax.verifyMooseObjectTask(moose_obj_params.get<std::string>("_moose_base"),
task) && // and that base is associated
action_obj_params.mooseObjectSyntaxVisibility()) // and the Action says it's visible
task) && // and that base is associated
action_obj_params.mooseObjectSyntaxVisibility() && // and the Action says it's visible
moose_obj->first.find("<JACOBIAN>") ==
std::string::npos) // And it is not a Jacobian templated AD object
{
std::string name;
size_t pos = 0;
@@ -824,8 +828,12 @@ Parser::buildFullTree(const std::string & search_string)
{
pos = act_name.size();

// Remove <RESIDUAL> append for AD objects
std::string obj_name = moose_obj->first;
removeSubstring(obj_name, "<RESIDUAL>");

if (!action_obj_params.collapseSyntaxNesting())
name = act_name.substr(0, pos - 1) + moose_obj->first;
name = act_name.substr(0, pos - 1) + obj_name;
else
{
name = act_name.substr(0, pos - 1) + "/<type>/" + moose_obj->first;
@@ -91,7 +91,7 @@ def initialize(self):
self._vtkplot = vtk.vtkPlotLine()
self._vtkplot.SetInputData(self._vtktable, 0, 1)

elif style is 'none' and not isinstance(self._vtkplot, vtk.vtkPlotPoints):
elif style == 'none' and not isinstance(self._vtkplot, vtk.vtkPlotPoints):
self._vtkplot = vtk.vtkPlotPoints()
self._vtkplot.SetInputData(self._vtktable, 0, 1)

@@ -79,7 +79,7 @@ def update(self, **kwargs):
length0 = 0
length1 = 0
loc = self.getOption('location')
if (loc is 'right') or (loc is 'left'):
if (loc == 'right') or (loc == 'left'):
length0 = self.getOption('width')
length1 = self.getOption('length')
plane.setOptions(resolution=[1, n+1])
@@ -81,7 +81,7 @@ def str2bool(string):
string[str]: The text to convert (e.g., 'true' or '1')
"""
string = string.lower()
if string is 'true' or string is '1':
if string == 'true' or string == '1':
return True
else:
return False

0 comments on commit 26a7981

Please sign in to comment.
You can’t perform that action at this time.