Skip to content

Commit

Permalink
Source/header/style updates (idaholab#21885)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Aug 18, 2022
1 parent 3a50b33 commit 0730596
Show file tree
Hide file tree
Showing 53 changed files with 530 additions and 363 deletions.
12 changes: 6 additions & 6 deletions modules/optimization/examples/spherical_point_sources/adjoint.i
@@ -1,8 +1,8 @@
[Mesh]
[fmg]
type = FileMeshGenerator
file = halfSphere.e
[]
[fmg]
type = FileMeshGenerator
file = halfSphere.e
[]
[]

[Variables]
Expand Down Expand Up @@ -36,13 +36,13 @@
value_name = misfit/misfit_values
[]
[]

[Reporters]
[misfit]
type=OptimizationData
type = OptimizationData
[]
[]


[BCs]
[round]
type = ConvectiveFluxFunction
Expand Down
24 changes: 12 additions & 12 deletions modules/optimization/examples/spherical_point_sources/forward.i
Expand Up @@ -32,14 +32,14 @@
[]

[DiracKernels]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = 'point_source/x'
y_coord_name = 'point_source/y'
z_coord_name = 'point_source/z'
value_name = 'point_source/value'
[]
[pt]
type = ReporterPointSource
variable = temperature
x_coord_name = 'point_source/x'
y_coord_name = 'point_source/y'
z_coord_name = 'point_source/z'
value_name = 'point_source/value'
[]
[]

[BCs]
Expand All @@ -66,7 +66,7 @@
[]
[]

[Problem]#do we need this
[Problem] #do we need this
type = FEProblem
[]

Expand All @@ -83,7 +83,7 @@
[point_source]
type = ConstantVectorPostprocessor
vector_names = 'x y z value'
value = '4 2.3 2.3 2.3 2.3;
value = '4 2.3 2.3 2.3 2.3;
0 2.3 -2.3 -2.3 2.3;
0 2.3 2.3 -2.3 -2.3;
100 150 300 250 150'
Expand All @@ -99,12 +99,12 @@

[Reporters]
[measure_data]
type=OptimizationData
type = OptimizationData
[]
[]

[Outputs]
console = true #false
console = true
exodus = true
csv = true
file_base = 'forward'
Expand Down
9 changes: 0 additions & 9 deletions modules/optimization/include/base/IsopodAppTypes.h

This file was deleted.

Expand Up @@ -11,15 +11,14 @@

#include "MooseApp.h"

class isopodTestApp : public MooseApp
class OptimizationApp : public MooseApp
{
public:
static InputParameters validParams();

isopodTestApp(InputParameters parameters);
virtual ~isopodTestApp();
OptimizationApp(InputParameters parameters);
virtual ~OptimizationApp();

static void registerApps();
static void registerAll(Factory & f, ActionFactory & af, Syntax & s, bool use_test_objs = false);
static void registerAll(Factory & f, ActionFactory & af, Syntax & s);
};

19 changes: 19 additions & 0 deletions modules/optimization/include/base/OptimizationAppTypes.h
@@ -0,0 +1,19 @@
//* 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 "Moose.h"

namespace OptimizationAppTypes
{
extern const ExecFlagType EXEC_FORWARD;
extern const ExecFlagType EXEC_ADJOINT;
extern const ExecFlagType EXEC_HOMOGENEOUS_FORWARD;
}
15 changes: 0 additions & 15 deletions modules/optimization/include/base/isopodApp.h

This file was deleted.

@@ -1,3 +1,12 @@
//* 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

// MOOSE includes
Expand Down
9 changes: 9 additions & 0 deletions modules/optimization/include/executioners/Optimize.h
@@ -1,3 +1,12 @@
//* 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 "Steady.h"
Expand Down
11 changes: 11 additions & 0 deletions modules/optimization/include/multiapps/OptimizeFullSolveMultiApp.h
@@ -1,6 +1,17 @@
//* 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

// fixme lynn this is included because MultiApp probably needs it
#include "libmesh/numeric_vector.h"

// MOOSE includes
#include "FullSolveMultiApp.h"

Expand Down
@@ -1,3 +1,12 @@
//* 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 "OptimizationReporter.h"
Expand Down
@@ -1,3 +1,12 @@
//* 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 "OptimizationReporter.h"
Expand Down
@@ -1,3 +1,12 @@
//* 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 "OptimizationData.h"
Expand Down
@@ -1,3 +1,12 @@
//* 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 "GeneralPostprocessor.h"
Expand All @@ -15,8 +24,8 @@ class ConstantValuePostprocessor : public GeneralPostprocessor

ConstantValuePostprocessor(const InputParameters & parameters);

virtual void initialize() override;
virtual void execute() override;
virtual void initialize() override{};
virtual void execute() override{};
virtual PostprocessorValue getValue() override;

protected:
Expand Down
@@ -1,6 +1,14 @@
//* 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

// MOOSE includes
#include "MultiAppTransfer.h"
#include "ReporterInterface.h"

Expand Down
16 changes: 14 additions & 2 deletions modules/optimization/src/actions/AddOptimizationReporterAction.C
@@ -1,10 +1,19 @@
//* 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 "AddOptimizationReporterAction.h"

#include "Factory.h"
#include "FEProblemBase.h"
#include "OptimizationReporter.h"

registerMooseAction("isopodApp", AddOptimizationReporterAction, "add_reporter");
registerMooseAction("OptimizationApp", AddOptimizationReporterAction, "add_reporter");

InputParameters
AddOptimizationReporterAction::validParams()
Expand All @@ -14,7 +23,10 @@ AddOptimizationReporterAction::validParams()
return params;
}

AddOptimizationReporterAction::AddOptimizationReporterAction(InputParameters params) : MooseObjectAction(params) {}
AddOptimizationReporterAction::AddOptimizationReporterAction(InputParameters params)
: MooseObjectAction(params)
{
}

void
AddOptimizationReporterAction::act()
Expand Down
@@ -1,6 +1,6 @@
#include "MaterialScaledGradientVector.h"

registerMooseObject("isopodApp", MaterialScaledGradientVector);
registerMooseObject("OptimizationApp", MaterialScaledGradientVector);

InputParameters
MaterialScaledGradientVector::validParams()
Expand Down
9 changes: 0 additions & 9 deletions modules/optimization/src/base/IsopodAppTypes.C

This file was deleted.

71 changes: 71 additions & 0 deletions modules/optimization/src/base/OptimizationApp.C
@@ -0,0 +1,71 @@
//* 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 "OptimizationApp.h"
#include "HeatConductionApp.h"
#include "StochasticToolsApp.h"
#include "Moose.h"
#include "AppFactory.h"
#include "MooseSyntax.h"
#include "ExecFlagRegistry.h"

#include "OptimizationAppTypes.h"

InputParameters
OptimizationApp::validParams()
{
InputParameters params = MooseApp::validParams();

// Do not use legacy DirichletBC, that is, set DirichletBC default for preset = true
params.set<bool>("use_legacy_material_output") = false;

return params;
}

OptimizationApp::OptimizationApp(InputParameters parameters) : MooseApp(parameters)
{
OptimizationApp::registerAll(_factory, _action_factory, _syntax);
}

OptimizationApp::~OptimizationApp() {}

void
OptimizationApp::registerAll(Factory & f, ActionFactory & af, Syntax & s)
{
Registry::registerObjectsTo(f, {"OptimizationApp"});
Registry::registerActionsTo(af, {"OptimizationApp"});

auto & syntax = s;

// Form Function actions
registerSyntaxTask("AddOptimizationReporterAction", "OptimizationReporter", "add_reporter");

HeatConductionApp::registerAll(f, af, s);
StochasticToolsApp::registerAll(f, af, s);
}

void
OptimizationApp::registerApps()
{
registerApp(OptimizationApp);
}

/***************************************************************************************************
*********************** Dynamic Library Entry Points - DO NOT MODIFY ******************************
**************************************************************************************************/
extern "C" void
OptimizationApp__registerAll(Factory & f, ActionFactory & af, Syntax & s)
{
OptimizationApp::registerAll(f, af, s);
}
extern "C" void
OptimizationApp__registerApps()
{
OptimizationApp::registerApps();
}

0 comments on commit 0730596

Please sign in to comment.