diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..831445b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,56 @@ +{ + "C_Cpp.default.configurationProvider": "ms-vscode.makefile-tools", + "files.associations": { + "ZoneAux.C": "cpp", + "GardensnakeApp.C": "cpp", + "FVVacuumBC.C": "cpp", + "PenaltyBC.C": "cpp", + "FVNeutronDiffusion.C": "cpp", + "Absorption.C": "cpp", + "Fission.C": "cpp", + "Scattering.C": "cpp", + "cctype": "cpp", + "cmath": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "exceptio": "cpp", + "fstream": "cpp", + "ios": "cpp", + "iostream": "cpp", + "istream": "cpp", + "iterator": "cpp", + "memory": "cpp", + "new": "cpp", + "ostream": "cpp", + "stdexcep": "cpp", + "streambu": "cpp", + "string": "cpp", + "typeinfo": "cpp", + "XSMaterial.C": "cpp", + "FissionSourceRMSFractionalChange.C": "cpp", + "SolutionNormalizer.C": "cpp", + "main.C": "cpp", + "bcs_Unity.C": "cpp", + "auxkernels_Unity.C": "cpp", + "array": "cpp", + "chrono": "cpp", + "compare": "cpp", + "functional": "cpp", + "ratio": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "IntegratedFissionRatePostprocessor.C": "cpp", + "KEigenvalue.C": "cpp", + "PeakFissionSource.C": "cpp", + "PostprocessorRelativeChange.C": "cpp", + "TotalFluxRMSFractionalChange.C": "cpp", + "ZoneElementAverageValue.C": "cpp", + "ZoneElementIntegralPostprocessor.C": "cpp" + } +} \ No newline at end of file diff --git a/Makefile b/Makefile index b9c1c5a..680cad3 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,54 @@ +# ############################################################################### +# ################### MOOSE Application Standard Makefile ####################### +# ############################################################################### +# # +# # Optional Environment variables +# # MOOSE_DIR - Root directory of the MOOSE project +# # MODULE_DIR - Location of the MOOSE modules directory +# # FRAMEWORK_DIR - Location of the MOOSE framework +# # +# ############################################################################### +# # Use the MOOSE submodule if it exists and MOOSE_DIR is not set +# ############################################################################### +# MODULE_DIR ?= $(shell dirname `pwd`) +# MOOSE_DIR ?= $(shell dirname $(MODULE_DIR)) +# FRAMEWORK_DIR ?= $(MOOSE_DIR)/framework +# ADDITIONAL_CPPFLAGS += -Wall -Wextra +# ############################################################################### +# # framework +# include $(FRAMEWORK_DIR)/build.mk +# include $(FRAMEWORK_DIR)/moose.mk + +# # Module +# MODULE_NAME := gardensnake +# include $(MODULE_DIR)/modules.mk + +# # MOOSE_SUBMODULE := $(CURDIR)/moose +# # ifneq ($(wildcard $(MOOSE_SUBMODULE)/framework/Makefile),) +# # MOOSE_DIR ?= $(MOOSE_SUBMODULE) +# # else +# # MOOSE_DIR ?= $(shell dirname `pwd`)/moose +# # endif + +# # # framework +# # FRAMEWORK_DIR := $(MOOSE_DIR)/framework +# # include $(FRAMEWORK_DIR)/build.mk +# # include $(FRAMEWORK_DIR)/moose.mk + +# # ################################## MODULES #################################### +# # ALL_MODULES := no +# # include $(MOOSE_DIR)/modules/modules.mk +# ############################################################################### + +# # dep apps +# APPLICATION_DIR := $(MODULE_DIR)/gardensnake +# APPLICATION_NAME := gardensnake +# BUILD_EXEC := yes +# DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME)) +# include $(FRAMEWORK_DIR)/app.mk + +# ############################################################################### +# # Additional special case targets should be added here ############################################################################### ################### MOOSE Application Standard Makefile ####################### ############################################################################### @@ -20,7 +71,7 @@ include $(FRAMEWORK_DIR)/build.mk include $(FRAMEWORK_DIR)/moose.mk ################################## MODULES #################################### -ALL_MODULES := no +ALL_MODULES := yes include $(MOOSE_DIR)/modules/modules.mk ############################################################################### @@ -32,4 +83,4 @@ DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLIC include $(FRAMEWORK_DIR)/app.mk ############################################################################### -# Additional special case targets should be added here +# Additional special case targets should be added here \ No newline at end of file diff --git a/README.md b/README.md index 6564432..40fd0a9 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,11 @@ Gardensnake ===== Simple neutron diffusion solver. + +To install, put the gardensnake module inside the modules directory. Then compile by using make. + +To test, assuming you compiled an optimized executable, run the follwoing inside the gardensnake drietory after successful compilation: + +**./gardensnake-opt -i problems/problem1/problem1.i** + +You can test different problems inside the problems directory. diff --git a/build/header_symlinks/Absorption.h b/build/header_symlinks/Absorption.h new file mode 120000 index 0000000..b6afb83 --- /dev/null +++ b/build/header_symlinks/Absorption.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/kernels/Absorption.h \ No newline at end of file diff --git a/build/header_symlinks/FVNeutronDiffusion.h b/build/header_symlinks/FVNeutronDiffusion.h new file mode 120000 index 0000000..843feb4 --- /dev/null +++ b/build/header_symlinks/FVNeutronDiffusion.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/dgkernels/FVNeutronDiffusion.h \ No newline at end of file diff --git a/build/header_symlinks/FVVacuumBC.h b/build/header_symlinks/FVVacuumBC.h new file mode 120000 index 0000000..bea9052 --- /dev/null +++ b/build/header_symlinks/FVVacuumBC.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/bcs/FVVacuumBC.h \ No newline at end of file diff --git a/build/header_symlinks/Fission.h b/build/header_symlinks/Fission.h new file mode 120000 index 0000000..4066c31 --- /dev/null +++ b/build/header_symlinks/Fission.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/kernels/Fission.h \ No newline at end of file diff --git a/build/header_symlinks/FissionSourceRMSFractionalChange.h b/build/header_symlinks/FissionSourceRMSFractionalChange.h new file mode 120000 index 0000000..b703c16 --- /dev/null +++ b/build/header_symlinks/FissionSourceRMSFractionalChange.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/postprocessors/FissionSourceRMSFractionalChange.h \ No newline at end of file diff --git a/build/header_symlinks/GardensnakeApp.h b/build/header_symlinks/GardensnakeApp.h new file mode 120000 index 0000000..021e294 --- /dev/null +++ b/build/header_symlinks/GardensnakeApp.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/base/GardensnakeApp.h \ No newline at end of file diff --git a/build/header_symlinks/GardensnakeRevision.h b/build/header_symlinks/GardensnakeRevision.h new file mode 120000 index 0000000..b8bed6b --- /dev/null +++ b/build/header_symlinks/GardensnakeRevision.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/base/GardensnakeRevision.h \ No newline at end of file diff --git a/build/header_symlinks/IntegratedFissionRatePostprocessor.h b/build/header_symlinks/IntegratedFissionRatePostprocessor.h new file mode 120000 index 0000000..f8ddb25 --- /dev/null +++ b/build/header_symlinks/IntegratedFissionRatePostprocessor.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/postprocessors/IntegratedFissionRatePostprocessor.h \ No newline at end of file diff --git a/build/header_symlinks/KEigenvalue.h b/build/header_symlinks/KEigenvalue.h new file mode 120000 index 0000000..e6fa910 --- /dev/null +++ b/build/header_symlinks/KEigenvalue.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/postprocessors/KEigenvalue.h \ No newline at end of file diff --git a/build/header_symlinks/PeakFissionSource.h b/build/header_symlinks/PeakFissionSource.h new file mode 120000 index 0000000..425d21e --- /dev/null +++ b/build/header_symlinks/PeakFissionSource.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/postprocessors/PeakFissionSource.h \ No newline at end of file diff --git a/build/header_symlinks/PenaltyBC.h b/build/header_symlinks/PenaltyBC.h new file mode 120000 index 0000000..20383d6 --- /dev/null +++ b/build/header_symlinks/PenaltyBC.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/bcs/PenaltyBC.h \ No newline at end of file diff --git a/build/header_symlinks/PostprocessorRelativeChange.h b/build/header_symlinks/PostprocessorRelativeChange.h new file mode 120000 index 0000000..f777b17 --- /dev/null +++ b/build/header_symlinks/PostprocessorRelativeChange.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/postprocessors/PostprocessorRelativeChange.h \ No newline at end of file diff --git a/build/header_symlinks/Scattering.h b/build/header_symlinks/Scattering.h new file mode 120000 index 0000000..9120f96 --- /dev/null +++ b/build/header_symlinks/Scattering.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/kernels/Scattering.h \ No newline at end of file diff --git a/build/header_symlinks/SolutionNormalizer.h b/build/header_symlinks/SolutionNormalizer.h new file mode 120000 index 0000000..b0d114d --- /dev/null +++ b/build/header_symlinks/SolutionNormalizer.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/userobjects/SolutionNormalizer.h \ No newline at end of file diff --git a/build/header_symlinks/TotalFluxRMSFractionalChange.h b/build/header_symlinks/TotalFluxRMSFractionalChange.h new file mode 120000 index 0000000..387cd1b --- /dev/null +++ b/build/header_symlinks/TotalFluxRMSFractionalChange.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/postprocessors/TotalFluxRMSFractionalChange.h \ No newline at end of file diff --git a/build/header_symlinks/XSMaterial.h b/build/header_symlinks/XSMaterial.h new file mode 120000 index 0000000..8f47b48 --- /dev/null +++ b/build/header_symlinks/XSMaterial.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/materials/XSMaterial.h \ No newline at end of file diff --git a/build/header_symlinks/ZoneAux.h b/build/header_symlinks/ZoneAux.h new file mode 120000 index 0000000..dab3983 --- /dev/null +++ b/build/header_symlinks/ZoneAux.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/auxkernels/ZoneAux.h \ No newline at end of file diff --git a/build/header_symlinks/ZoneElementAverageValue.h b/build/header_symlinks/ZoneElementAverageValue.h new file mode 120000 index 0000000..d0fd97f --- /dev/null +++ b/build/header_symlinks/ZoneElementAverageValue.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/postprocessors/ZoneElementAverageValue.h \ No newline at end of file diff --git a/build/header_symlinks/ZoneElementIntegralPostprocessor.h b/build/header_symlinks/ZoneElementIntegralPostprocessor.h new file mode 120000 index 0000000..a9911ed --- /dev/null +++ b/build/header_symlinks/ZoneElementIntegralPostprocessor.h @@ -0,0 +1 @@ +/home/ramzy/projects/gardensnake/include/postprocessors/ZoneElementIntegralPostprocessor.h \ No newline at end of file diff --git a/build/unity_src/auxkernels_Unity.C b/build/unity_src/auxkernels_Unity.C new file mode 100644 index 0000000..3ef8675 --- /dev/null +++ b/build/unity_src/auxkernels_Unity.C @@ -0,0 +1,2 @@ + +#include"/home/ramzy/projects/gardensnake/src/auxkernels/ZoneAux.C" diff --git a/build/unity_src/bcs_Unity.C b/build/unity_src/bcs_Unity.C new file mode 100644 index 0000000..1deeb97 --- /dev/null +++ b/build/unity_src/bcs_Unity.C @@ -0,0 +1,3 @@ + +#include"/home/ramzy/projects/gardensnake/src/bcs/FVVacuumBC.C" +#include"/home/ramzy/projects/gardensnake/src/bcs/PenaltyBC.C" diff --git a/build/unity_src/dgkernels_Unity.C b/build/unity_src/dgkernels_Unity.C new file mode 100644 index 0000000..ee69b9f --- /dev/null +++ b/build/unity_src/dgkernels_Unity.C @@ -0,0 +1,2 @@ + +#include"/home/ramzy/projects/gardensnake/src/dgkernels/FVNeutronDiffusion.C" diff --git a/build/unity_src/kernels_Unity.C b/build/unity_src/kernels_Unity.C new file mode 100644 index 0000000..0c1b75d --- /dev/null +++ b/build/unity_src/kernels_Unity.C @@ -0,0 +1,4 @@ + +#include"/home/ramzy/projects/gardensnake/src/kernels/Absorption.C" +#include"/home/ramzy/projects/gardensnake/src/kernels/Fission.C" +#include"/home/ramzy/projects/gardensnake/src/kernels/Scattering.C" diff --git a/build/unity_src/materials_Unity.C b/build/unity_src/materials_Unity.C new file mode 100644 index 0000000..dbc0058 --- /dev/null +++ b/build/unity_src/materials_Unity.C @@ -0,0 +1,2 @@ + +#include"/home/ramzy/projects/gardensnake/src/materials/XSMaterial.C" diff --git a/build/unity_src/postprocessors_Unity.C b/build/unity_src/postprocessors_Unity.C new file mode 100644 index 0000000..82d84b6 --- /dev/null +++ b/build/unity_src/postprocessors_Unity.C @@ -0,0 +1,9 @@ + +#include"/home/ramzy/projects/gardensnake/src/postprocessors/FissionSourceRMSFractionalChange.C" +#include"/home/ramzy/projects/gardensnake/src/postprocessors/IntegratedFissionRatePostprocessor.C" +#include"/home/ramzy/projects/gardensnake/src/postprocessors/KEigenvalue.C" +#include"/home/ramzy/projects/gardensnake/src/postprocessors/PeakFissionSource.C" +#include"/home/ramzy/projects/gardensnake/src/postprocessors/PostprocessorRelativeChange.C" +#include"/home/ramzy/projects/gardensnake/src/postprocessors/TotalFluxRMSFractionalChange.C" +#include"/home/ramzy/projects/gardensnake/src/postprocessors/ZoneElementAverageValue.C" +#include"/home/ramzy/projects/gardensnake/src/postprocessors/ZoneElementIntegralPostprocessor.C" diff --git a/build/unity_src/userobjects_Unity.C b/build/unity_src/userobjects_Unity.C new file mode 100644 index 0000000..0abacdc --- /dev/null +++ b/build/unity_src/userobjects_Unity.C @@ -0,0 +1,2 @@ + +#include"/home/ramzy/projects/gardensnake/src/userobjects/SolutionNormalizer.C" diff --git a/include/auxkernels/ZoneAux.h b/include/auxkernels/ZoneAux.h index 4ee630f..c05a327 100644 --- a/include/auxkernels/ZoneAux.h +++ b/include/auxkernels/ZoneAux.h @@ -11,18 +11,18 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ +#pragma once -#ifndef ZONEAUX_H -#define ZONEAUX_H +// #ifndef ZONEAUX_H +// #define ZONEAUX_H #include "AuxKernel.h" +// Forward Declarations +// class ZoneAux; -//Forward Declarations -class ZoneAux; - -template<> -InputParameters validParams(); +// template <> +// InputParameters validParams(); /** * Constant auxiliary value @@ -30,6 +30,7 @@ InputParameters validParams(); class ZoneAux : public AuxKernel { public: + static InputParameters validParams(); /** * Factory constructor, takes parameters so that all derived classes can be built using the same @@ -37,7 +38,7 @@ class ZoneAux : public AuxKernel */ ZoneAux(const InputParameters & parameters); - virtual ~ZoneAux() {} +// virtual ~ZoneAux() {} protected: virtual Real computeValue(); @@ -49,4 +50,4 @@ class ZoneAux : public AuxKernel const std::vector & _zone_numbers; }; -#endif //ZONEAUX_H +// #endif // ZONEAUX_H diff --git a/include/base/GardensnakeApp.h b/include/base/GardensnakeApp.h index ec27ba7..36a7d1f 100644 --- a/include/base/GardensnakeApp.h +++ b/include/base/GardensnakeApp.h @@ -1,22 +1,27 @@ -#ifndef GARDENSNAKEAPP_H -#define GARDENSNAKEAPP_H +//* This file is part of GardenSnake, an open-source +//* application for the simulation of plasmas +//* https://github.com/friedmud/gardensnake +//* +//* GardenSnake is powered by the MOOSE Framework +//* https://www.mooseframework.org +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html -#include "MooseApp.h" - -class GardensnakeApp; +#pragma once -template<> -InputParameters validParams(); +#include "MooseApp.h" class GardensnakeApp : public MooseApp { public: + static InputParameters validParams(); + GardensnakeApp(InputParameters parameters); + virtual ~GardensnakeApp(); static void registerApps(); - static void registerObjects(Factory & factory); - static void associateSyntax(Syntax & syntax, ActionFactory & action_factory); -}; + static void registerAll(Factory & f, ActionFactory & af, Syntax & s); -#endif /* GARDENSNAKEAPP_H */ +}; \ No newline at end of file diff --git a/include/base/GardensnakeRevision.h b/include/base/GardensnakeRevision.h new file mode 100644 index 0000000..00281a7 --- /dev/null +++ b/include/base/GardensnakeRevision.h @@ -0,0 +1,7 @@ +/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */ + +#pragma once + +#define GARDENSNAKE_REVISION "git commit 9f0b7b9 on 2023-07-15" +#define GARDENSNAKE_VERSION "9f0b7b9" +#define GARDENSNAKE_INSTALLABLE_DIRS "tests" diff --git a/include/bcs/FVVacuumBC.h b/include/bcs/FVVacuumBC.h index fe168c1..689c1a7 100644 --- a/include/bcs/FVVacuumBC.h +++ b/include/bcs/FVVacuumBC.h @@ -11,18 +11,15 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ +#pragma once -#ifndef FVVACUUMBC_H -#define FVVACUUMBC_H +// #ifndef FVVACUUMBC_H +// #define FVVACUUMBC_H #include "IntegratedBC.h" - -//Forward Declarations -class FVVacuumBC; - -template<> -InputParameters validParams(); +// Forward Declarations +// class FVVacuumBC; /** * Applies a DirichletBC using integral(penalty*(u - value)) @@ -30,6 +27,7 @@ InputParameters validParams(); class FVVacuumBC : public IntegratedBC { public: + static InputParameters validParams(); FVVacuumBC(const InputParameters & parameters); @@ -39,7 +37,7 @@ class FVVacuumBC : public IntegratedBC const unsigned int _group; - const MaterialProperty > & _diffusivity; + const MaterialProperty> & _diffusivity; }; -#endif //FVVACUUMBC_H +// #endif // FVVACUUMBC_H diff --git a/include/bcs/PenaltyBC.h b/include/bcs/PenaltyBC.h index 6589ada..cfccfad 100644 --- a/include/bcs/PenaltyBC.h +++ b/include/bcs/PenaltyBC.h @@ -11,21 +11,19 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef PENALTYBC_H -#define PENALTYBC_H +#pragma once +// #ifndef PENALTYBC_H +// #define PENALTYBC_H #include "IntegratedBC.h" - -class PenaltyBC; - -template<> -InputParameters validParams(); +// class PenaltyBC; class PenaltyBC : public IntegratedBC { public: + static InputParameters validParams(); + PenaltyBC(const InputParameters & parameters); protected: @@ -36,5 +34,4 @@ class PenaltyBC : public IntegratedBC const Real & _penalty; }; - -#endif //PENALTYBC_H +// #endif // PENALTYBC_H diff --git a/include/dgkernels/FVNeutronDiffusion.h b/include/dgkernels/FVNeutronDiffusion.h index e66d9d5..d92ec96 100644 --- a/include/dgkernels/FVNeutronDiffusion.h +++ b/include/dgkernels/FVNeutronDiffusion.h @@ -11,31 +11,46 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef FVNEUTRONDIFFUSION_H -#define FVNEUTRONDIFFUSION_H +#pragma once +// #ifndef FVNEUTRONDIFFUSION_H +// #define FVNEUTRONDIFFUSION_H #include "DGKernel.h" -//Forward Declarations -class FVNeutronDiffusion; -template<> -InputParameters validParams(); +// For AD DG Kernel: +// #include "ADDGKernel.h" +/** + * DG kernel for diffusion + * + * General DG kernel that this class can handle is: + * \f$ { \nabla u * n_e} [v] + epsilon { \nabla v * n_e } [u] + (sigma / |e| * [u][v]) \f$ + * + * \f$ [a] = [ a_1 - a_2 ] \f$ + * \f$ {a} = 0.5 * (a_1 + a_2) \f$ + * + */ /* The previous is taken from Zapdos app, and could be related to AD DG kernels only, or for specific physics simualted there. Not checked! */ + + +// Forward Declarations +// class FVNeutronDiffusion; class FVNeutronDiffusion : public DGKernel { public: + static InputParameters validParams(); + FVNeutronDiffusion(const InputParameters & parameters); protected: virtual Real computeQpResidual(Moose::DGResidualType type); - virtual Real computeQpJacobian(Moose::DGJacobianType type); + virtual Real computeQpJacobian(Moose::DGJacobianType type); // Not needed in AD DG kernels. const unsigned int _group; - const MaterialProperty > & _diffusivity; - const MaterialProperty > & _diffusivity_neighbor; + // Related to the diffusion coefficient + const MaterialProperty> & _diffusivity; + const MaterialProperty> & _diffusivity_neighbor; }; -#endif +// #endif diff --git a/include/kernels/Absorption.h b/include/kernels/Absorption.h index 1f96846..6fd0a99 100644 --- a/include/kernels/Absorption.h +++ b/include/kernels/Absorption.h @@ -11,23 +11,22 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef ABSORPTION_H -#define ABSORPTION_H +#pragma once +// #ifndef ABSORPTION_H +// #define ABSORPTION_H #include "Kernel.h" -class Absorption; - -template<> -InputParameters validParams(); - +// class Absorption; class Absorption : public Kernel { public: + static InputParameters validParams(); + Absorption(const InputParameters & parameters); - virtual ~Absorption(); + +// virtual ~Absorption(); protected: virtual Real computeQpResidual(); @@ -35,8 +34,7 @@ class Absorption : public Kernel const unsigned int _group; - const MaterialProperty > & _sigma_a; + const MaterialProperty> & _sigma_a; }; - -#endif /* ABSORPTION_H */ +// #endif /* ABSORPTION_H */ diff --git a/include/kernels/Fission.h b/include/kernels/Fission.h index 853ac58..60e3176 100644 --- a/include/kernels/Fission.h +++ b/include/kernels/Fission.h @@ -11,23 +11,22 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef FISSION_H -#define FISSION_H +#pragma once +// #ifndef FISSION_H +// #define FISSION_H #include "Kernel.h" -class Fission; - -template<> -InputParameters validParams(); +// class Fission; class Fission : public Kernel { public: +static InputParameters validParams(); + Fission(const InputParameters & parameters); - virtual ~Fission(); +// virtual ~Fission(); protected: virtual Real computeQpResidual(); @@ -45,4 +44,4 @@ class Fission : public Kernel }; -#endif /* FISSION_H */ +// #endif /* FISSION_H */ diff --git a/include/kernels/Scattering.h b/include/kernels/Scattering.h index ba86b5b..0b77498 100644 --- a/include/kernels/Scattering.h +++ b/include/kernels/Scattering.h @@ -11,23 +11,21 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef SCATTERING_H -#define SCATTERING_H +#pragma once +// #ifndef SCATTERING_H +// #define SCATTERING_H #include "Kernel.h" class Scattering; -template<> -InputParameters validParams(); - - class Scattering : public Kernel { public: + static InputParameters validParams(); + Scattering(const InputParameters & parameters); - virtual ~Scattering(); +// virtual ~Scattering(); protected: virtual Real computeQpResidual(); @@ -36,11 +34,10 @@ class Scattering : public Kernel const unsigned int _group; - const MaterialProperty > > & _sigma_s; + const MaterialProperty>> & _sigma_s; // The values of all of the fluxes std::vector _vals; }; - -#endif /* SCATTERING_H */ +// #endif /* SCATTERING_H */ diff --git a/include/materials/XSMaterial.h b/include/materials/XSMaterial.h index 967319d..5a21e57 100644 --- a/include/materials/XSMaterial.h +++ b/include/materials/XSMaterial.h @@ -11,22 +11,23 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef XSMATERIAL_H -#define XSMATERIAL_H +#pragma once +// #ifndef XSMATERIAL_H +// #define XSMATERIAL_H #include "Material.h" +// Forward Declarations +// class XSMaterial; -//Forward Declarations -class XSMaterial; - -template<> -InputParameters validParams(); +// template <> +// InputParameters validParams(); class XSMaterial : public Material { public: + static InputParameters validParams(); + XSMaterial(const InputParameters & parameters); protected: @@ -40,23 +41,23 @@ class XSMaterial : public Material /// Indexed by group! std::vector diffusivity; std::vector sigma_a; - std::vector > sigma_s; + std::vector> sigma_s; std::vector nu_sigma_f; }; std::vector _zones; /// Diffusivity coefficient for each group - MaterialProperty > & _diffusivity; + MaterialProperty> & _diffusivity; /// Absorption XS for each group - MaterialProperty > & _sigma_a; + MaterialProperty> & _sigma_a; /// Scattering cross section (full matrix: column->row) - MaterialProperty > > & _sigma_s; + MaterialProperty>> & _sigma_s; /// Fission XS for each group - MaterialProperty > & _nu_sigma_f; + MaterialProperty> & _nu_sigma_f; }; -#endif //XSMATERIAL_H +// #endif // XSMATERIAL_H diff --git a/include/postprocessors/FissionSourceRMSFractionalChange.h b/include/postprocessors/FissionSourceRMSFractionalChange.h index bcae2ed..f3d3b85 100644 --- a/include/postprocessors/FissionSourceRMSFractionalChange.h +++ b/include/postprocessors/FissionSourceRMSFractionalChange.h @@ -11,32 +11,32 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef FISSIONSOURCERMSFRACTIONALCHANGE_H -#define FISSIONSOURCERMSFRACTIONALCHANGE_H +#pragma once +// #ifndef FISSIONSOURCERMSFRACTIONALCHANGE_H +// #define FISSIONSOURCERMSFRACTIONALCHANGE_H #include "ZoneElementAverageValue.h" -//Forward Declarations -class FissionSourceRMSFractionalChange; - -template<> -InputParameters validParams(); +// Forward Declarations +// class FissionSourceRMSFractionalChange; class FissionSourceRMSFractionalChange : public ZoneElementAverageValue { public: + static InputParameters validParams(); + FissionSourceRMSFractionalChange(const InputParameters & parameters); + virtual Real getValue(); protected: virtual Real computeQpIntegral(); - const MaterialProperty > & _nu_sigma_f; + const MaterialProperty> & _nu_sigma_f; // The values of all of the fluxes std::vector _fluxes; std::vector _fluxes_old; }; -#endif +// #endif diff --git a/include/postprocessors/IntegratedFissionRatePostprocessor.h b/include/postprocessors/IntegratedFissionRatePostprocessor.h index 11f804b..13bab18 100644 --- a/include/postprocessors/IntegratedFissionRatePostprocessor.h +++ b/include/postprocessors/IntegratedFissionRatePostprocessor.h @@ -11,17 +11,14 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef INTEGRATEDFISSIONRATEPOSTPROCESSOR_H -#define INTEGRATEDFISSIONRATEPOSTPROCESSOR_H +#pragma once +// #ifndef INTEGRATEDFISSIONRATEPOSTPROCESSOR_H +// #define INTEGRATEDFISSIONRATEPOSTPROCESSOR_H #include "ZoneElementIntegralPostprocessor.h" -//Forward Declarations -class IntegratedFissionRatePostprocessor; - -template<> -InputParameters validParams(); +// Forward Declarations +// class IntegratedFissionRatePostprocessor; /** * This postprocessor computes the volume of a specified block. @@ -29,6 +26,8 @@ InputParameters validParams(); class IntegratedFissionRatePostprocessor : public ZoneElementIntegralPostprocessor { public: + static InputParameters validParams(); + IntegratedFissionRatePostprocessor(const InputParameters & parameters); protected: @@ -36,10 +35,10 @@ class IntegratedFissionRatePostprocessor : public ZoneElementIntegralPostprocess bool _new; - const MaterialProperty > & _nu_sigma_f; + const MaterialProperty> & _nu_sigma_f; // The values of all of the fluxes std::vector _vals; }; -#endif +// #endif diff --git a/include/postprocessors/KEigenvalue.h b/include/postprocessors/KEigenvalue.h index 2cb901a..2295cb8 100644 --- a/include/postprocessors/KEigenvalue.h +++ b/include/postprocessors/KEigenvalue.h @@ -11,21 +11,24 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ +#pragma once -#ifndef KEIGENVALUE_H -#define KEIGENVALUE_H +// #ifndef KEIGENVALUE_H +// #define KEIGENVALUE_H #include "GeneralPostprocessor.h" -//Forward Declarations -class KEigenvalue; +// Forward Declarations +// class KEigenvalue; -template<> -InputParameters validParams(); +// template<> +// InputParameters validParams(); class KEigenvalue : public GeneralPostprocessor { public: + static InputParameters validParams(); + KEigenvalue(const InputParameters & parameters); virtual void initialize() {} @@ -43,4 +46,4 @@ class KEigenvalue : public GeneralPostprocessor const PostprocessorValue & _old_eigenvalue; }; -#endif //KEIGENVALUE_H +// #endif // KEIGENVALUE_H diff --git a/include/postprocessors/PeakFissionSource.h b/include/postprocessors/PeakFissionSource.h index a5110ab..6e0d554 100644 --- a/include/postprocessors/PeakFissionSource.h +++ b/include/postprocessors/PeakFissionSource.h @@ -11,21 +11,21 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef PEAKFISSIONSOURCE_H -#define PEAKFISSIONSOURCE_H +#pragma once +// #ifndef PEAKFISSIONSOURCE_H +// #define PEAKFISSIONSOURCE_H #include "ZoneElementAverageValue.h" -//Forward Declarations -class PeakFissionSource; +// Forward Declarations +// class PeakFissionSource; -template<> -InputParameters validParams(); class PeakFissionSource : public ZoneElementAverageValue { public: +static InputParameters validParams(); + PeakFissionSource(const InputParameters & parameters); virtual void initialize(); @@ -39,7 +39,7 @@ class PeakFissionSource : public ZoneElementAverageValue const Real & _center; - const MaterialProperty > & _nu_sigma_f; + const MaterialProperty> & _nu_sigma_f; // The values of all of the fluxes std::vector _fluxes; @@ -52,4 +52,4 @@ class PeakFissionSource : public ZoneElementAverageValue Real _max_position; }; -#endif +// #endif diff --git a/include/postprocessors/PostprocessorRelativeChange.h b/include/postprocessors/PostprocessorRelativeChange.h index 44f8771..a132223 100644 --- a/include/postprocessors/PostprocessorRelativeChange.h +++ b/include/postprocessors/PostprocessorRelativeChange.h @@ -11,21 +11,24 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ +#pragma once -#ifndef POSTPROCESSORRELATIVECHANGE_H -#define POSTPROCESSORRELATIVECHANGE_H +// #ifndef POSTPROCESSORRELATIVECHANGE_H +// #define POSTPROCESSORRELATIVECHANGE_H #include "GeneralPostprocessor.h" -//Forward Declarations -class PostprocessorRelativeChange; +// Forward Declarations +// class PostprocessorRelativeChange; -template<> -InputParameters validParams(); +// template<> +// InputParameters validParams(); class PostprocessorRelativeChange : public GeneralPostprocessor { public: + static InputParameters validParams(); + PostprocessorRelativeChange(const InputParameters & parameters); virtual void initialize() {} @@ -34,9 +37,8 @@ class PostprocessorRelativeChange : public GeneralPostprocessor virtual Real getValue(); protected: - const PostprocessorValue & _pp; const PostprocessorValue & _pp_old; }; -#endif //POSTPROCESSORRELATIVECHANGE_H +// #endif // POSTPROCESSORRELATIVECHANGE_H diff --git a/include/postprocessors/TotalFluxRMSFractionalChange.h b/include/postprocessors/TotalFluxRMSFractionalChange.h index 9e7101b..21084c2 100644 --- a/include/postprocessors/TotalFluxRMSFractionalChange.h +++ b/include/postprocessors/TotalFluxRMSFractionalChange.h @@ -11,22 +11,22 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef TOTALFLUXRMSFRACTIONALCHANGE_H -#define TOTALFLUXRMSFRACTIONALCHANGE_H +#pragma once +// #ifndef TOTALFLUXRMSFRACTIONALCHANGE_H +// #define TOTALFLUXRMSFRACTIONALCHANGE_H #include "ElementAverageValue.h" -//Forward Declarations -class TotalFluxRMSFractionalChange; - -template<> -InputParameters validParams(); +// Forward Declarations +// class TotalFluxRMSFractionalChange; class TotalFluxRMSFractionalChange : public ElementAverageValue { public: + static InputParameters validParams(); + TotalFluxRMSFractionalChange(const InputParameters & parameters); + virtual Real getValue(); protected: @@ -36,4 +36,4 @@ class TotalFluxRMSFractionalChange : public ElementAverageValue std::vector _fluxes_old; }; -#endif +// #endif diff --git a/include/postprocessors/ZoneElementAverageValue.h b/include/postprocessors/ZoneElementAverageValue.h index 885cfe9..07b1d12 100644 --- a/include/postprocessors/ZoneElementAverageValue.h +++ b/include/postprocessors/ZoneElementAverageValue.h @@ -11,21 +11,20 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ - -#ifndef ZONEELEMENTAVERAGEVALUE_H -#define ZONEELEMENTAVERAGEVALUE_H +#pragma once +// #ifndef ZONEELEMENTAVERAGEVALUE_H +// #define ZONEELEMENTAVERAGEVALUE_H #include "ZoneElementIntegralPostprocessor.h" -//Forward Declarations -class ZoneElementAverageValue; - -template<> -InputParameters validParams(); +// Forward Declarations +// class ZoneElementAverageValue; class ZoneElementAverageValue : public ZoneElementIntegralPostprocessor { public: + static InputParameters validParams(); + ZoneElementAverageValue(const InputParameters & parameters); virtual void initialize(); @@ -37,4 +36,4 @@ class ZoneElementAverageValue : public ZoneElementIntegralPostprocessor Real _volume; }; -#endif +// #endif diff --git a/include/postprocessors/ZoneElementIntegralPostprocessor.h b/include/postprocessors/ZoneElementIntegralPostprocessor.h index 0db01f4..ad7e972 100644 --- a/include/postprocessors/ZoneElementIntegralPostprocessor.h +++ b/include/postprocessors/ZoneElementIntegralPostprocessor.h @@ -11,21 +11,22 @@ /* */ /* See COPYRIGHT for full restrictions */ /****************************************************************/ +#pragma once -#ifndef ZONEELEMENTINTEGRALPOSTPROCESSOR_H -#define ZONEELEMENTINTEGRALPOSTPROCESSOR_H +// #ifndef ZONEELEMENTINTEGRALPOSTPROCESSOR_H +// #define ZONEELEMENTINTEGRALPOSTPROCESSOR_H #include "ElementPostprocessor.h" //Forward Declarations -class ZoneElementIntegralPostprocessor; +// class ZoneElementIntegralPostprocessor; -template<> -InputParameters validParams(); class ZoneElementIntegralPostprocessor : public ElementPostprocessor { public: +static InputParameters validParams(); + ZoneElementIntegralPostprocessor(const InputParameters & parameters); virtual void initialize(); @@ -45,4 +46,4 @@ class ZoneElementIntegralPostprocessor : public ElementPostprocessor const std::vector & _active_zones; }; -#endif +// #endif diff --git a/include/userobjects/SolutionNormalizer.h b/include/userobjects/SolutionNormalizer.h index 20c69fb..95f9457 100644 --- a/include/userobjects/SolutionNormalizer.h +++ b/include/userobjects/SolutionNormalizer.h @@ -12,31 +12,33 @@ /* See COPYRIGHT for full restrictions */ /****************************************************************/ +#pragma once -#ifndef SOLUTIONNORMALIZER_H -#define SOLUTIONNORMALIZER_H +// #ifndef SOLUTIONNORMALIZER_H +// #define SOLUTIONNORMALIZER_H // Moose #include "GeneralUserObject.h" #include "MooseMesh.h" -//Forward Declarations -class RandomHitUserObject; -class SolutionNormalizer; +// Forward Declarations +// class RandomHitUserObject; +// class SolutionNormalizer; -template<> -InputParameters validParams(); +// template <> +// InputParameters validParams(); -class SolutionNormalizer : - public GeneralUserObject +class SolutionNormalizer : public GeneralUserObject { public: + static InputParameters validParams(); + SolutionNormalizer(const InputParameters & parameters); - virtual ~SolutionNormalizer() {} - virtual void initialize(){} +// virtual ~SolutionNormalizer() {} + virtual void initialize() {} virtual void execute(); - virtual void finalize(){} + virtual void finalize() {} }; -#endif +// #endif diff --git a/lib/libgardensnake-opt.so.0 b/lib/libgardensnake-opt.so.0 new file mode 120000 index 0000000..0ada411 --- /dev/null +++ b/lib/libgardensnake-opt.so.0 @@ -0,0 +1 @@ +libgardensnake-opt.so.0.0.0 \ No newline at end of file diff --git a/lib/libgardensnake-opt.so.0.0.0 b/lib/libgardensnake-opt.so.0.0.0 new file mode 100755 index 0000000..28e7ccf Binary files /dev/null and b/lib/libgardensnake-opt.so.0.0.0 differ diff --git a/problems/problem1/problem1.i b/problems/problem1/problem1.i index d2c7e69..6585d19 100644 --- a/problems/problem1/problem1.i +++ b/problems/problem1/problem1.i @@ -7,108 +7,108 @@ [] [Variables] - [./group_0] + [group_0] order = CONSTANT family = MONOMIAL initial_condition = 1 - [../] - [./group_1] + [] + [group_1] order = CONSTANT family = MONOMIAL initial_condition = 1 # 0.0912871 - [../] + [] [] [AuxVariables] - [./zone] + [zone] order = CONSTANT family = MONOMIAL - [../] + [] [] [Kernels] active = 'scatter_0 scatter_1 fission_0 absorption_0 absorption_1' - [./absorption_0] + [absorption_0] type = Absorption variable = group_0 - [../] - [./fission_0] + [] + [fission_0] type = Fission variable = group_0 fluxes = 'group_0 group_1' k = k - [../] - [./scatter_0] + [] + [scatter_0] type = Scattering variable = group_0 fluxes = 'group_0 group_1' - [../] - [./absorption_1] + [] + [absorption_1] type = Absorption variable = group_1 - [../] - [./scatter_1] + [] + [scatter_1] type = Scattering variable = group_1 fluxes = 'group_0 group_1' - [../] - [./source_0] + [] + [source_0] type = BodyForce variable = group_0 value = 1 - [../] - [./source_1] + [] + [source_1] type = BodyForce variable = group_1 value = 1 - [../] + [] [] [DGKernels] - [./neutron_diff_0] + [neutron_diff_0] type = FVNeutronDiffusion variable = group_0 - [../] - [./neutron_diff_1] + [] + [neutron_diff_1] type = FVNeutronDiffusion variable = group_1 - [../] + [] [] [AuxKernels] - [./zone] + [zone] type = ZoneAux variable = zone zones = 0 zone_edges = '0 300' - [../] + [] [] [BCs] - [./right_0] + [right_0] type = FVVacuumBC variable = group_0 boundary = right - [../] - [./left_0] + [] + [left_0] type = FVVacuumBC variable = group_0 boundary = left - [../] - [./left_1] + [] + [left_1] type = FVVacuumBC variable = group_1 boundary = left - [../] - [./right_1] + [] + [right_1] type = FVVacuumBC variable = group_1 boundary = right - [../] + [] [] [Materials] - [./xs_mat] + [xs_mat] type = XSMaterial block = 0 a1 = '0.0605 0.0741 0.0862 0.0852 0.0200 0.1300 0.0286' @@ -119,78 +119,78 @@ d0 = '1.4300 1.4300 1.4300 1.4300 1.2600 1.0000 1.5500' d1 = '0.3700 0.3700 0.3700 0.3700 0.2700 0.3400 0.2700' zone = zone - [../] + [] [] [Postprocessors] - [./fission_rate] + [fission_rate] type = IntegratedFissionRatePostprocessor execute_on = 'TIMESTEP_END initial' new = true fluxes = 'group_0 group_1' zone = zone active_zones = '0 1 2 3' - [../] - [./k] + [] + [k] type = KEigenvalue execute_on = 'TIMESTEP_END initial' fission_rate = fission_rate fission_rate_old = fission_rate_old - [../] - [./fission_rate_old] + [] + [fission_rate_old] type = IntegratedFissionRatePostprocessor new = false fluxes = 'group_0 group_1' zone = zone active_zones = '0 1 2 3' - [../] - [./fission_change] + [] + [fission_change] type = FissionSourceRMSFractionalChange - variable = group_0 # have to pick one + # variable = group_0 # have to pick one fluxes = 'group_0 group_1' zone = zone active_zones = '0 1 2 3' - [../] - [./flux_change] + [] + [flux_change] type = TotalFluxRMSFractionalChange variable = group_0 # Have to pick one fluxes = 'group_0 group_1' - [../] - [./peak] + [] + [peak] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = NORMALIZED_VALUE fluxes = 'group_0 group_1' center = 150 - [../] - [./peak_position] + [] + [peak_position] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = position fluxes = 'group_0 group_1' center = 150 - [../] + [] [] [UserObjects] - [./normalizer] + [normalizer] type = SolutionNormalizer execute_on = 'timestep_end initial' k = k - [../] - [./terminator] + [] + [terminator] type = Terminator expression = '(fission_change < 1e-7) & (flux_change < 1e-5)' - [../] + [] [] [Preconditioning] - [./smp] + [smp] type = SMP full = true - [../] + [] [] [Executioner] diff --git a/problems/problem2/problem2.i b/problems/problem2/problem2.i index 553c3d2..a075cb5 100644 --- a/problems/problem2/problem2.i +++ b/problems/problem2/problem2.i @@ -7,108 +7,108 @@ [] [Variables] - [./group_0] + [group_0] order = CONSTANT family = MONOMIAL initial_condition = 1 - [../] - [./group_1] + [] + [group_1] order = CONSTANT family = MONOMIAL initial_condition = 1 # 0.0912871 - [../] + [] [] [AuxVariables] - [./zone] + [zone] order = CONSTANT family = MONOMIAL - [../] + [] [] [Kernels] active = 'scatter_0 scatter_1 fission_0 absorption_0 absorption_1' - [./absorption_0] + [absorption_0] type = Absorption variable = group_0 - [../] - [./fission_0] + [] + [fission_0] type = Fission variable = group_0 fluxes = 'group_0 group_1' k = k - [../] - [./scatter_0] + [] + [scatter_0] type = Scattering variable = group_0 fluxes = 'group_0 group_1' - [../] - [./absorption_1] + [] + [absorption_1] type = Absorption variable = group_1 - [../] - [./scatter_1] + [] + [scatter_1] type = Scattering variable = group_1 fluxes = 'group_0 group_1' - [../] - [./source_0] + [] + [source_0] type = BodyForce variable = group_0 value = 1 - [../] - [./source_1] + [] + [source_1] type = BodyForce variable = group_1 value = 1 - [../] + [] [] [DGKernels] - [./neutron_diff_0] + [neutron_diff_0] type = FVNeutronDiffusion variable = group_0 - [../] - [./neutron_diff_1] + [] + [neutron_diff_1] type = FVNeutronDiffusion variable = group_1 - [../] + [] [] [AuxKernels] - [./zone] + [zone] type = ZoneAux variable = zone zones = '4 1 4' zone_edges = '0 25 275 300' - [../] + [] [] [BCs] - [./right_0] + [right_0] type = FVVacuumBC variable = group_0 boundary = right - [../] - [./left_0] + [] + [left_0] type = FVVacuumBC variable = group_0 boundary = left - [../] - [./left_1] + [] + [left_1] type = FVVacuumBC variable = group_1 boundary = left - [../] - [./right_1] + [] + [right_1] type = FVVacuumBC variable = group_1 boundary = right - [../] + [] [] [Materials] - [./xs_mat] + [xs_mat] type = XSMaterial block = 0 a1 = '0.0605 0.0741 0.0862 0.0852 0.0200 0.1300 0.0286' @@ -119,78 +119,78 @@ d0 = '1.4300 1.4300 1.4300 1.4300 1.2600 1.0000 1.5500' d1 = '0.3700 0.3700 0.3700 0.3700 0.2700 0.3400 0.2700' zone = zone - [../] + [] [] [Postprocessors] - [./fission_rate] + [fission_rate] type = IntegratedFissionRatePostprocessor execute_on = 'TIMESTEP_END initial' new = true fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./k] + [] + [k] type = KEigenvalue execute_on = 'TIMESTEP_END initial' fission_rate = fission_rate fission_rate_old = fission_rate_old - [../] - [./fission_rate_old] + [] + [fission_rate_old] type = IntegratedFissionRatePostprocessor new = false fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./fission_change] + [] + [fission_change] type = FissionSourceRMSFractionalChange - variable = group_0 # have to pick one + # variable = group_0 # have to pick one fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./flux_change] + [] + [flux_change] type = TotalFluxRMSFractionalChange variable = group_0 # Have to pick one fluxes = 'group_0 group_1' - [../] - [./peak] + [] + [peak] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = NORMALIZED_VALUE fluxes = 'group_0 group_1' center = 150 - [../] - [./peak_position] + [] + [peak_position] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = position fluxes = 'group_0 group_1' center = 150 - [../] + [] [] [UserObjects] - [./normalizer] + [normalizer] type = SolutionNormalizer execute_on = 'timestep_end initial' k = k - [../] - [./terminator] + [] + [terminator] type = Terminator expression = '(fission_change < 1e-7) & (flux_change < 1e-5)' - [../] + [] [] [Preconditioning] - [./smp] + [smp] type = SMP full = true - [../] + [] [] [Executioner] diff --git a/problems/problem3/problem3.i b/problems/problem3/problem3.i index b632a40..76235bc 100644 --- a/problems/problem3/problem3.i +++ b/problems/problem3/problem3.i @@ -7,108 +7,108 @@ [] [Variables] - [./group_0] + [group_0] order = CONSTANT family = MONOMIAL initial_condition = 1 - [../] - [./group_1] + [] + [group_1] order = CONSTANT family = MONOMIAL initial_condition = 1 # 0.0912871 - [../] + [] [] [AuxVariables] - [./zone] + [zone] order = CONSTANT family = MONOMIAL - [../] + [] [] [Kernels] active = 'scatter_0 scatter_1 fission_0 absorption_0 absorption_1' - [./absorption_0] + [absorption_0] type = Absorption variable = group_0 - [../] - [./fission_0] + [] + [fission_0] type = Fission variable = group_0 fluxes = 'group_0 group_1' k = k - [../] - [./scatter_0] + [] + [scatter_0] type = Scattering variable = group_0 fluxes = 'group_0 group_1' - [../] - [./absorption_1] + [] + [absorption_1] type = Absorption variable = group_1 - [../] - [./scatter_1] + [] + [scatter_1] type = Scattering variable = group_1 fluxes = 'group_0 group_1' - [../] - [./source_0] + [] + [source_0] type = BodyForce variable = group_0 value = 1 - [../] - [./source_1] + [] + [source_1] type = BodyForce variable = group_1 value = 1 - [../] + [] [] [DGKernels] - [./neutron_diff_0] + [neutron_diff_0] type = FVNeutronDiffusion variable = group_0 - [../] - [./neutron_diff_1] + [] + [neutron_diff_1] type = FVNeutronDiffusion variable = group_1 - [../] + [] [] [AuxKernels] - [./zone] + [zone] type = ZoneAux variable = zone zones = '4 1 4' zone_edges = '0 25 275 300' - [../] + [] [] [BCs] - [./right_0] + [right_0] type = FVVacuumBC variable = group_0 boundary = right - [../] - [./left_0] + [] + [left_0] type = FVVacuumBC variable = group_0 boundary = left - [../] - [./left_1] + [] + [left_1] type = FVVacuumBC variable = group_1 boundary = left - [../] - [./right_1] + [] + [right_1] type = FVVacuumBC variable = group_1 boundary = right - [../] + [] [] [Materials] - [./xs_mat] + [xs_mat] type = XSMaterial block = 0 a1 = '0.0605 0.0741 0.0862 0.0852 0.0200 0.1300 0.0286' @@ -119,78 +119,78 @@ d0 = '1.4300 1.4300 1.4300 1.4300 1.2600 1.0000 1.5500' d1 = '0.3700 0.3700 0.3700 0.3700 0.2700 0.3400 0.2700' zone = zone - [../] + [] [] [Postprocessors] - [./fission_rate] + [fission_rate] type = IntegratedFissionRatePostprocessor execute_on = 'TIMESTEP_END initial' new = true fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./k] + [] + [k] type = KEigenvalue execute_on = 'TIMESTEP_END initial' fission_rate = fission_rate fission_rate_old = fission_rate_old - [../] - [./fission_rate_old] + [] + [fission_rate_old] type = IntegratedFissionRatePostprocessor new = false fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./fission_change] + [] + [fission_change] type = FissionSourceRMSFractionalChange - variable = group_0 # have to pick one +# variable = group_0 # have to pick one fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./flux_change] + [] + [flux_change] type = TotalFluxRMSFractionalChange variable = group_0 # Have to pick one fluxes = 'group_0 group_1' - [../] - [./peak] + [] + [peak] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = NORMALIZED_VALUE fluxes = 'group_0 group_1' center = 150 - [../] - [./peak_position] + [] + [peak_position] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = position fluxes = 'group_0 group_1' center = 150 - [../] + [] [] [UserObjects] - [./normalizer] + [normalizer] type = SolutionNormalizer execute_on = 'timestep_end initial' k = k - [../] - [./terminator] + [] + [terminator] type = Terminator expression = '(fission_change < 1e-7) & (flux_change < 1e-5)' - [../] + [] [] [Preconditioning] - [./smp] + [smp] type = SMP full = true - [../] + [] [] [Executioner] diff --git a/problems/problem4/problem4.i b/problems/problem4/problem4.i index 59d5656..7c094bf 100644 --- a/problems/problem4/problem4.i +++ b/problems/problem4/problem4.i @@ -7,109 +7,109 @@ [] [Variables] - [./group_0] + [group_0] order = CONSTANT family = MONOMIAL initial_condition = 1 - [../] - [./group_1] + [] + [group_1] order = CONSTANT family = MONOMIAL initial_condition = 1 # 0.0912871 - [../] + [] [] [AuxVariables] - [./zone] + [zone] order = CONSTANT family = MONOMIAL - [../] + [] [] [Kernels] active = 'scatter_0 scatter_1 fission_0 absorption_0 absorption_1' - [./absorption_0] + [absorption_0] type = Absorption variable = group_0 - [../] - [./fission_0] + [] + [fission_0] type = Fission variable = group_0 fluxes = 'group_0 group_1' k = k - [../] - [./scatter_0] + [] + [scatter_0] type = Scattering variable = group_0 fluxes = 'group_0 group_1' - [../] - [./absorption_1] + [] + [absorption_1] type = Absorption variable = group_1 - [../] - [./scatter_1] + [] + [scatter_1] type = Scattering variable = group_1 fluxes = 'group_0 group_1' - [../] - [./source_0] + [] + [source_0] type = BodyForce variable = group_0 value = 1 - [../] - [./source_1] + [] + [source_1] type = BodyForce variable = group_1 value = 1 - [../] + [] [] [DGKernels] - [./neutron_diff_0] + [neutron_diff_0] type = FVNeutronDiffusion variable = group_0 - [../] - [./neutron_diff_1] + [] + [neutron_diff_1] type = FVNeutronDiffusion variable = group_1 - [../] + [] [] [AuxKernels] - [./zone] + [zone] type = ZoneAux variable = zone zones = '4 3 2 3 4' zone_edges = '0 25 40 260 275 300' execute_on = 'initial' - [../] + [] [] [BCs] - [./right_0] + [right_0] type = FVVacuumBC variable = group_0 boundary = right - [../] - [./left_0] + [] + [left_0] type = FVVacuumBC variable = group_0 boundary = left - [../] - [./left_1] + [] + [left_1] type = FVVacuumBC variable = group_1 boundary = left - [../] - [./right_1] + [] + [right_1] type = FVVacuumBC variable = group_1 boundary = right - [../] + [] [] [Materials] - [./xs_mat] + [xs_mat] type = XSMaterial block = 0 a1 = '0.0605 0.0741 0.0862 0.0852 0.0200 0.1300 0.0286' @@ -120,80 +120,80 @@ d0 = '1.4300 1.4300 1.4300 1.4300 1.2600 1.0000 1.5500' d1 = '0.3700 0.3700 0.3700 0.3700 0.2700 0.3400 0.2700' zone = zone - zones = '4 3 2 3 4' - zone_edges = '0 25 40 260 275 300' - [../] +# zones = '4 3 2 3 4' +# zone_edges = '0 25 40 260 275 300' + [] [] [Postprocessors] - [./fission_rate] + [fission_rate] type = IntegratedFissionRatePostprocessor execute_on = 'TIMESTEP_END initial' new = true fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./k] + [] + [k] type = KEigenvalue execute_on = 'TIMESTEP_END initial' fission_rate = fission_rate fission_rate_old = fission_rate_old - [../] - [./fission_rate_old] + [] + [fission_rate_old] type = IntegratedFissionRatePostprocessor new = false fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./fission_change] + [] + [fission_change] type = FissionSourceRMSFractionalChange - variable = group_0 # have to pick one +# variable = group_0 # have to pick one fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./flux_change] + [] + [flux_change] type = TotalFluxRMSFractionalChange variable = group_0 # Have to pick one fluxes = 'group_0 group_1' - [../] - [./peak] + [] + [peak] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = NORMALIZED_VALUE fluxes = 'group_0 group_1' center = 150 - [../] - [./peak_position] + [] + [peak_position] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = position fluxes = 'group_0 group_1' center = 150 - [../] + [] [] [UserObjects] - [./normalizer] + [normalizer] type = SolutionNormalizer execute_on = 'timestep_end initial' k = k - [../] - [./terminator] + [] + [terminator] type = Terminator expression = '(fission_change < 1e-7) & (flux_change < 1e-5)' - [../] + [] [] [Preconditioning] - [./smp] + [smp] type = SMP full = true - [../] + [] [] [Executioner] diff --git a/problems/problem5/problem5.i b/problems/problem5/problem5.i index 575aa71..1c2592a 100644 --- a/problems/problem5/problem5.i +++ b/problems/problem5/problem5.i @@ -7,108 +7,108 @@ [] [Variables] - [./group_0] + [group_0] order = CONSTANT family = MONOMIAL initial_condition = 1 - [../] - [./group_1] + [] + [group_1] order = CONSTANT family = MONOMIAL initial_condition = 1 # 0.0912871 - [../] + [] [] [AuxVariables] - [./zone] + [zone] order = CONSTANT family = MONOMIAL - [../] + [] [] [Kernels] active = 'scatter_0 scatter_1 fission_0 absorption_0 absorption_1' - [./absorption_0] + [absorption_0] type = Absorption variable = group_0 - [../] - [./fission_0] + [] + [fission_0] type = Fission variable = group_0 fluxes = 'group_0 group_1' k = k - [../] - [./scatter_0] + [] + [scatter_0] type = Scattering variable = group_0 fluxes = 'group_0 group_1' - [../] - [./absorption_1] + [] + [absorption_1] type = Absorption variable = group_1 - [../] - [./scatter_1] + [] + [scatter_1] type = Scattering variable = group_1 fluxes = 'group_0 group_1' - [../] - [./source_0] + [] + [source_0] type = BodyForce variable = group_0 value = 1 - [../] - [./source_1] + [] + [source_1] type = BodyForce variable = group_1 value = 1 - [../] + [] [] [DGKernels] - [./neutron_diff_0] + [neutron_diff_0] type = FVNeutronDiffusion variable = group_0 - [../] - [./neutron_diff_1] + [] + [neutron_diff_1] type = FVNeutronDiffusion variable = group_1 - [../] + [] [] [AuxKernels] - [./zone] + [zone] type = ZoneAux variable = zone zones = '6 5 3 2 3 5 6' zone_edges = '0 23 25 40 260 275 277 300' - [../] + [] [] [BCs] - [./right_0] + [right_0] type = FVVacuumBC variable = group_0 boundary = right - [../] - [./left_0] + [] + [left_0] type = FVVacuumBC variable = group_0 boundary = left - [../] - [./left_1] + [] + [left_1] type = FVVacuumBC variable = group_1 boundary = left - [../] - [./right_1] + [] + [right_1] type = FVVacuumBC variable = group_1 boundary = right - [../] + [] [] [Materials] - [./xs_mat] + [xs_mat] type = XSMaterial block = 0 a1 = '0.0605 0.0741 0.0862 0.0852 0.0200 0.1300 0.0286' @@ -119,78 +119,78 @@ d0 = '1.4300 1.4300 1.4300 1.4300 1.2600 1.0000 1.5500' d1 = '0.3700 0.3700 0.3700 0.3700 0.2700 0.3400 0.2700' zone = zone - [../] + [] [] [Postprocessors] - [./fission_rate] + [fission_rate] type = IntegratedFissionRatePostprocessor execute_on = 'TIMESTEP_END initial' new = true fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./k] + [] + [k] type = KEigenvalue execute_on = 'TIMESTEP_END initial' fission_rate = fission_rate fission_rate_old = fission_rate_old - [../] - [./fission_rate_old] + [] + [fission_rate_old] type = IntegratedFissionRatePostprocessor new = false fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./fission_change] + [] + [fission_change] type = FissionSourceRMSFractionalChange - variable = group_0 # have to pick one +# variable = group_0 # have to pick one fluxes = 'group_0 group_1' - zone = zone + zone = zone active_zones = '0 1 2 3' - [../] - [./flux_change] + [] + [flux_change] type = TotalFluxRMSFractionalChange variable = group_0 # Have to pick one fluxes = 'group_0 group_1' - [../] - [./peak] + [] + [peak] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = NORMALIZED_VALUE fluxes = 'group_0 group_1' center = 150 - [../] - [./peak_position] + [] + [peak_position] type = PeakFissionSource active_zones = '0 1 2 3' zone = zone report = position fluxes = 'group_0 group_1' center = 150 - [../] + [] [] [UserObjects] - [./normalizer] + [normalizer] type = SolutionNormalizer execute_on = 'timestep_end initial' k = k - [../] - [./terminator] + [] + [terminator] type = Terminator expression = '(fission_change < 1e-7) & (flux_change < 1e-5)' - [../] + [] [] [Preconditioning] - [./smp] + [smp] type = SMP full = true - [../] + [] [] [Executioner] diff --git a/src/auxkernels/ZoneAux.C b/src/auxkernels/ZoneAux.C index 3dae8c7..1f68a27 100644 --- a/src/auxkernels/ZoneAux.C +++ b/src/auxkernels/ZoneAux.C @@ -14,25 +14,29 @@ #include "ZoneAux.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", ZoneAux); + +InputParameters +ZoneAux::validParams() { - InputParameters params = validParams(); + // InputParameters params = validParams(); + InputParameters params = AuxKernel::validParams(); - params.addRequiredParam >("zone_edges", "The beginning and ending of each zone"); - params.addRequiredParam >("zones", "Each zone should go with with pair of zone_edges. ie there should be one more zone_edge than zones"); + params.addRequiredParam>("zone_edges", "The beginning and ending of each zone"); + params.addRequiredParam>("zones", + "Each zone should go with with pair of zone_edges. ie " + "there should be one more zone_edge than zones"); return params; } -ZoneAux::ZoneAux(const InputParameters & parameters) : - AuxKernel(parameters), - _zone_edges(getParam >("zone_edges")), - _zone_numbers(getParam >("zones")) +ZoneAux::ZoneAux(const InputParameters & parameters) + : AuxKernel(parameters), + _zone_edges(getParam>("zone_edges")), + _zone_numbers(getParam>("zones")) { } - Real ZoneAux::computeValue() { @@ -41,8 +45,8 @@ ZoneAux::computeValue() // Find the zone we fall in: unsigned int zone_entry = 0; - for (; zone_entry<_zone_edges.size()-1; zone_entry++) - if (_zone_edges[zone_entry] <= x && x <= _zone_edges[zone_entry+1]) + for (; zone_entry < _zone_edges.size() - 1; zone_entry++) + if (_zone_edges[zone_entry] <= x && x <= _zone_edges[zone_entry + 1]) break; return _zone_numbers[zone_entry]; diff --git a/src/base/GardensnakeApp.C b/src/base/GardensnakeApp.C index 2acf8e3..43aa392 100644 --- a/src/base/GardensnakeApp.C +++ b/src/base/GardensnakeApp.C @@ -1,66 +1,74 @@ +//* This file is part of GardenSnake, an open-source +//* application for the simulation of plasmas +//* https://github.com/friedmud/gardensnake +//* +//* GardenSnake is powered by the MOOSE Framework +//* https://www.mooseframework.org +//* +//* Licensed under LGPL 2.1, please see LICENSE for details +//* https://www.gnu.org/licenses/lgpl-2.1.html + #include "GardensnakeApp.h" #include "Moose.h" #include "AppFactory.h" +#include "ModulesApp.h" #include "MooseSyntax.h" // Kernels -#include "Absorption.h" -#include "Scattering.h" -#include "Fission.h" +// #include "Absorption.h" +// #include "Scattering.h" +// #include "Fission.h" // BCs -#include "FVVacuumBC.h" -#include "PenaltyBC.h" +// #include "FVVacuumBC.h" +// #include "PenaltyBC.h" // Materials -#include "XSMaterial.h" +// #include "XSMaterial.h" // AuxKernels -#include "ZoneAux.h" +// #include "ZoneAux.h" // DGKernels -#include "FVNeutronDiffusion.h" +// #include "FVNeutronDiffusion.h" // Postprocessors -#include "IntegratedFissionRatePostprocessor.h" -#include "KEigenvalue.h" -#include "PostprocessorRelativeChange.h" -#include "FissionSourceRMSFractionalChange.h" -#include "TotalFluxRMSFractionalChange.h" -#include "PeakFissionSource.h" +// #include "FissionSourceRMSFractionalChange.h" +// #include "IntegratedFissionRatePostprocessor.h" +// #include "KEigenvalue.h" +// #include "PeakFissionSource.h" +// #include "PostprocessorRelativeChange.h" +// #include "TotalFluxRMSFractionalChange.h" + // UserObjects -#include "SolutionNormalizer.h" +// #include "SolutionNormalizer.h" -template<> -InputParameters validParams() +InputParameters +GardensnakeApp::validParams() { - InputParameters params = validParams(); + InputParameters params = MooseApp::validParams(); params.set("use_legacy_uo_initialization") = false; params.set("use_legacy_uo_aux_computation") = false; params.set("use_legacy_output_syntax") = false; + params.set("use_legacy_material_output") = false; return params; } -GardensnakeApp::GardensnakeApp(InputParameters parameters) : - MooseApp(parameters) -{ - srand(processor_id()); +// When using the new Registry system, this line is required so that +// dependent apps know about the ZapdosApp label. +registerKnownLabel("GardensnakeApp"); - Moose::registerObjects(_factory); - GardensnakeApp::registerObjects(_factory); - - Moose::associateSyntax(_syntax, _action_factory); - GardensnakeApp::associateSyntax(_syntax, _action_factory); -} - -GardensnakeApp::~GardensnakeApp() +GardensnakeApp::GardensnakeApp(InputParameters parameters) : MooseApp(parameters) { + srand(processor_id()); + GardensnakeApp::registerAll(_factory, _action_factory, _syntax); } -extern "C" void GardensnakeApp__registerApps() { GardensnakeApp::registerApps(); } +GardensnakeApp::~GardensnakeApp() {} + void GardensnakeApp::registerApps() { @@ -68,32 +76,120 @@ GardensnakeApp::registerApps() } void -GardensnakeApp::registerObjects(Factory & factory) +GardensnakeApp::registerAll(Factory & f, ActionFactory & af, Syntax & s) { - registerKernel(Absorption); - registerKernel(Scattering); - registerKernel(Fission); +// ModulesApp::registerAllObjects(f, af, s); + ModulesApp::registerAll(f, af, s); + Registry::registerObjectsTo(f, {"GardensnakeApp"}); + Registry::registerActionsTo(af, {"GardensnakeApp"}); + +// registerKernel(Absorption); +// registerKernel(Scattering); +// registerKernel(Fission); + +// registerBoundaryCondition(FVVacuumBC); +// registerBoundaryCondition(PenaltyBC); - registerBoundaryCondition(FVVacuumBC); - registerBoundaryCondition(PenaltyBC); +// registerMaterial(XSMaterial); - registerMaterial(XSMaterial); +// registerAux(ZoneAux); - registerAux(ZoneAux); +// registerDGKernel(FVNeutronDiffusion); - registerDGKernel(FVNeutronDiffusion); +// registerPostprocessor(IntegratedFissionRatePostprocessor); +// registerPostprocessor(KEigenvalue); +// registerPostprocessor(PostprocessorRelativeChange); +// registerPostprocessor(FissionSourceRMSFractionalChange); +// registerPostprocessor(TotalFluxRMSFractionalChange); +// registerPostprocessor(PeakFissionSource); - registerPostprocessor(IntegratedFissionRatePostprocessor); - registerPostprocessor(KEigenvalue); - registerPostprocessor(PostprocessorRelativeChange); - registerPostprocessor(FissionSourceRMSFractionalChange); - registerPostprocessor(TotalFluxRMSFractionalChange); - registerPostprocessor(PeakFissionSource); +// registerUserObject(SolutionNormalizer); - registerUserObject(SolutionNormalizer); + + + /* register objects from dependent applications */ +// SquirrelApp::registerAll(f, af, s); +// CraneApp::registerAll(f, af, s); + + /* register custom execute flags, action syntax, etc. here */ +// s.registerActionSyntax("AddPeriodicControllers", "PeriodicControllers/*"); +// s.registerActionSyntax("AddDriftDiffusionAction", "DriftDiffusionAction/*"); +// s.registerActionSyntax("AddPeriodicRelativeNodalDifference", "PeriodicRelativeNodalDifference/*"); } -void -GardensnakeApp::associateSyntax(Syntax & syntax, ActionFactory & action_factory) + + + +// void +// GardensnakeApp::registerObjects(Factory & factory) +// { + +// } + + +// void +// GardensnakeApp::registerAll(Factory & f, ActionFactory & af, Syntax & syntax) +// { +// // HeatConductionApp::registerAll(f, af, syntax); +// // NavierStokesApp::registerAll(f, af, syntax); +// // MiscApp::registerAll(f, af, syntax); +// Registry::registerObjectsTo(f, {"GardensnakeApp"}); +// Registry::registerActionsTo(af, {"GardensnakeApp"}); + +// registerKernel(Absorption); +// registerKernel(Scattering); +// registerKernel(Fission); + +// registerBoundaryCondition(FVVacuumBC); +// registerBoundaryCondition(PenaltyBC); + +// registerMaterial(XSMaterial); + +// registerAux(ZoneAux); + +// registerDGKernel(FVNeutronDiffusion); + +// registerPostprocessor(IntegratedFissionRatePostprocessor); +// registerPostprocessor(KEigenvalue); +// registerPostprocessor(PostprocessorRelativeChange); +// registerPostprocessor(FissionSourceRMSFractionalChange); +// registerPostprocessor(TotalFluxRMSFractionalChange); +// registerPostprocessor(PeakFissionSource); + +// registerUserObject(SolutionNormalizer); + +// /* register custom execute flags, action syntax, etc. here */ +// } + +// extern "C" void +// GardensnakeApp__registerAll(Factory & f, ActionFactory & af, Syntax & s) +// { +// GardensnakeApp::registerAll(f, af, s); +// } + +// void +// GardensnakeApp::associateSyntax(Syntax & syntax, ActionFactory & action_factory) +// { +// } + +/*************************************************************************************************** + *********************** Dynamic Library Entry Points - DO NOT MODIFY ****************************** + **************************************************************************************************/ +extern "C" void +GardensnakeApp__registerAll(Factory & f, ActionFactory & af, Syntax & s) +{ + GardensnakeApp::registerAll(f, af, s); +} + +extern "C" void +GardensnakeApp__registerApps() { + GardensnakeApp::registerApps(); } + + +// extern "C" void +// GardensnakeApp__registerApps() +// { +// GardensnakeApp::registerApps(); +// } diff --git a/src/base/GardensnakeApp.C.module b/src/base/GardensnakeApp.C.module index ce1f922..1ad218b 100644 --- a/src/base/GardensnakeApp.C.module +++ b/src/base/GardensnakeApp.C.module @@ -2,10 +2,10 @@ #include "Moose.h" #include "AppFactory.h" -template<> -InputParameters validParams() +InputParameters +GardensnakeApp::validParams() { - InputParameters params = validParams(); + InputParameters params = MooseApp::validParams(); params.set("use_legacy_uo_initialization") = false; params.set("use_legacy_uo_aux_computation") = false; diff --git a/src/bcs/FVVacuumBC.C b/src/bcs/FVVacuumBC.C index 933e349..5b74990 100644 --- a/src/bcs/FVVacuumBC.C +++ b/src/bcs/FVVacuumBC.C @@ -14,25 +14,29 @@ #include "FVVacuumBC.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", FVVacuumBC); + +InputParameters +FVVacuumBC::validParams() { - InputParameters params = validParams(); + InputParameters params = IntegratedBC::validParams(); return params; } -FVVacuumBC::FVVacuumBC(const InputParameters & parameters) : - IntegratedBC(parameters), +FVVacuumBC::FVVacuumBC(const InputParameters & parameters) + : IntegratedBC(parameters), _group(_var.number()), - _diffusivity(getMaterialProperty >("diffusivity")) -{} + _diffusivity(getMaterialProperty>("diffusivity")) +{ +} Real FVVacuumBC::computeQpResidual() { Real delta_x = _current_elem->hmax(); - return ((2.0*_diffusivity[_qp][_group]) / delta_x) * ( 1.0 / ( 1.0 + (4.0*_diffusivity[_qp][_group] / delta_x) ) ) * _u[_qp]; + return ((2.0 * _diffusivity[_qp][_group]) / delta_x) * + (1.0 / (1.0 + (4.0 * _diffusivity[_qp][_group] / delta_x))) * _u[_qp]; } Real @@ -40,5 +44,6 @@ FVVacuumBC::computeQpJacobian() { Real delta_x = _current_elem->hmax(); - return ((2.0*_diffusivity[_qp][_group]) / delta_x) * ( 1.0 / ( 1.0 + (4.0*_diffusivity[_qp][_group] / delta_x) ) ); + return ((2.0 * _diffusivity[_qp][_group]) / delta_x) * + (1.0 / (1.0 + (4.0 * _diffusivity[_qp][_group] / delta_x))); } diff --git a/src/bcs/PenaltyBC.C b/src/bcs/PenaltyBC.C index efb46d7..99a70d8 100644 --- a/src/bcs/PenaltyBC.C +++ b/src/bcs/PenaltyBC.C @@ -14,25 +14,26 @@ #include "PenaltyBC.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", PenaltyBC); + +InputParameters +PenaltyBC::validParams() { - InputParameters params = validParams(); + InputParameters params = IntegratedBC::validParams(); params.addParam("value", 0.0, "The value of the gradient on the boundary."); params.addParam("penalty", 1e10, "Penalty used for penalty*(u-value)."); return params; } -PenaltyBC::PenaltyBC(const InputParameters & parameters) : - IntegratedBC(parameters), - _value(getParam("value")), - _penalty(getParam("penalty")) -{} +PenaltyBC::PenaltyBC(const InputParameters & parameters) + : IntegratedBC(parameters), _value(getParam("value")), _penalty(getParam("penalty")) +{ +} Real PenaltyBC::computeQpResidual() { - return _penalty*(_u[_qp]-_value); + return _penalty * (_u[_qp] - _value); } Real diff --git a/src/dgkernels/FVNeutronDiffusion.C b/src/dgkernels/FVNeutronDiffusion.C index e89b5c5..01f10b9 100644 --- a/src/dgkernels/FVNeutronDiffusion.C +++ b/src/dgkernels/FVNeutronDiffusion.C @@ -16,18 +16,20 @@ #include -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", FVNeutronDiffusion); + +InputParameters +FVNeutronDiffusion::validParams() { - InputParameters params = validParams(); + InputParameters params = DGKernel::validParams(); return params; } -FVNeutronDiffusion::FVNeutronDiffusion(const InputParameters & parameters) : - DGKernel(parameters), +FVNeutronDiffusion::FVNeutronDiffusion(const InputParameters & parameters) + : DGKernel(parameters), _group(_var.number()), - _diffusivity(getMaterialProperty >("diffusivity")), - _diffusivity_neighbor(getNeighborMaterialProperty >("diffusivity")) + _diffusivity(getMaterialProperty>("diffusivity")), + _diffusivity_neighbor(getNeighborMaterialProperty>("diffusivity")) { } @@ -39,7 +41,9 @@ FVNeutronDiffusion::computeQpResidual(Moose::DGResidualType type) const double delta_x = _current_elem->hmax(); const double delta_x_neighbor = _neighbor_elem->hmax(); - Real weighted_D = ( (_diffusivity_neighbor[_qp][_group] * _u_neighbor[_qp] + _diffusivity[_qp][_group] * _u[_qp]) / ( _diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group] ) ); + Real weighted_D = ((_diffusivity_neighbor[_qp][_group] * _u_neighbor[_qp] + + _diffusivity[_qp][_group] * _u[_qp]) / + (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group])); switch (type) { @@ -52,7 +56,8 @@ FVNeutronDiffusion::computeQpResidual(Moose::DGResidualType type) } case Moose::Neighbor: { - RealVectorValue grad_u_neighbor((weighted_D - _u_neighbor[_qp]) / (delta_x_neighbor / 2.0), 0, 0); + RealVectorValue grad_u_neighbor( + (weighted_D - _u_neighbor[_qp]) / (delta_x_neighbor / 2.0), 0, 0); r = _diffusivity_neighbor[_qp][_group] * (grad_u_neighbor * -_normals[_qp]); break; @@ -70,12 +75,12 @@ FVNeutronDiffusion::computeQpJacobian(Moose::DGJacobianType type) const double delta_x = _current_elem->hmax(); const double delta_x_neighbor = _neighbor_elem->hmax(); - switch (type) { case Moose::ElementElement: { - Real weighted_D = ( -_diffusivity_neighbor[_qp][_group] / (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group]) ); + Real weighted_D = (-_diffusivity_neighbor[_qp][_group] / + (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group])); RealVectorValue grad_u(weighted_D / (delta_x / 2.0), 0, 0); r = -_diffusivity[_qp][_group] * (grad_u * _normals[_qp]); @@ -85,7 +90,8 @@ FVNeutronDiffusion::computeQpJacobian(Moose::DGJacobianType type) case Moose::ElementNeighbor: { - Real weighted_D = ( _diffusivity_neighbor[_qp][_group] / (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group]) ); + Real weighted_D = (_diffusivity_neighbor[_qp][_group] / + (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group])); RealVectorValue grad_u(weighted_D / (delta_x / 2.0), 0, 0); r = -_diffusivity[_qp][_group] * (grad_u * _normals[_qp]); @@ -95,7 +101,8 @@ FVNeutronDiffusion::computeQpJacobian(Moose::DGJacobianType type) case Moose::NeighborElement: { - Real weighted_D = ( -_diffusivity[_qp][_group] / (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group]) ); + Real weighted_D = (-_diffusivity[_qp][_group] / + (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group])); RealVectorValue grad_u_neighbor(weighted_D / (delta_x_neighbor / 2.0), 0, 0); r = -_diffusivity_neighbor[_qp][_group] * (grad_u_neighbor * -_normals[_qp]); @@ -104,7 +111,8 @@ FVNeutronDiffusion::computeQpJacobian(Moose::DGJacobianType type) case Moose::NeighborNeighbor: { - Real weighted_D = ( _diffusivity[_qp][_group] / (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group]) ); + Real weighted_D = (_diffusivity[_qp][_group] / + (_diffusivity_neighbor[_qp][_group] + _diffusivity[_qp][_group])); RealVectorValue grad_u_neighbor(weighted_D / (delta_x_neighbor / 2.0), 0, 0); r = -_diffusivity_neighbor[_qp][_group] * (grad_u_neighbor * -_normals[_qp]); diff --git a/src/kernels/Absorption.C b/src/kernels/Absorption.C index 0e96dfa..30a3395 100644 --- a/src/kernels/Absorption.C +++ b/src/kernels/Absorption.C @@ -14,28 +14,25 @@ #include "Absorption.h" +registerMooseObject("GardensnakeApp", Absorption); -template<> -InputParameters validParams() + +InputParameters +Absorption::validParams() { - InputParameters params = validParams(); + InputParameters params = Kernel::validParams(); return params; } - -Absorption::Absorption(const InputParameters & parameters) : - Kernel(parameters), +Absorption::Absorption(const InputParameters & parameters) + : Kernel(parameters), _group(_var.number()), - _sigma_a(getMaterialProperty >("sigma_a")) + _sigma_a(getMaterialProperty>("sigma_a")) { - } -Absorption::~Absorption() -{ - -} +// Absorption::~Absorption() {} Real Absorption::computeQpResidual() diff --git a/src/kernels/Fission.C b/src/kernels/Fission.C index b511eaf..0fe9a81 100644 --- a/src/kernels/Fission.C +++ b/src/kernels/Fission.C @@ -14,11 +14,12 @@ #include "Fission.h" +registerMooseObject("GardensnakeApp", Fission); -template<> -InputParameters validParams() +InputParameters +Fission::validParams() { - InputParameters params = validParams(); + InputParameters params = Kernel::validParams(); params.addRequiredCoupledVar("fluxes", "All of the fluxes"); params.addRequiredParam("k", "The eigenvalue for the 1/k"); @@ -26,34 +27,31 @@ InputParameters validParams() return params; } - -Fission::Fission(const InputParameters & parameters) : - Kernel(parameters), +Fission::Fission(const InputParameters & parameters) + : Kernel(parameters), _group(_var.number()), - _nu_sigma_f(getMaterialProperty >("nu_sigma_f")), + _nu_sigma_f(getMaterialProperty>("nu_sigma_f")), _k(getPostprocessorValue("k")) { unsigned int n = coupledComponents("fluxes"); _vals.resize(n); - for (unsigned int i=0; i<_vals.size(); ++i) + for (unsigned int i = 0; i < _vals.size(); ++i) _vals[i] = &coupledValueOld("fluxes", i); } -Fission::~Fission() -{ -} +// Fission::~Fission() {} Real Fission::computeQpResidual() { Real r = 0; - for (unsigned int i=0; i<_vals.size(); i++) + for (unsigned int i = 0; i < _vals.size(); i++) r += _nu_sigma_f[_qp][i] * (*_vals[i])[_qp]; - return -(1.0/_k)*r; + return -(1.0 / _k) * r; } Real @@ -62,7 +60,6 @@ Fission::computeQpJacobian() return 0; } - Real Fission::computeQpOffDiagJacobian(unsigned int jvar) { diff --git a/src/kernels/Scattering.C b/src/kernels/Scattering.C index 5f1f5e8..8eb277e 100644 --- a/src/kernels/Scattering.C +++ b/src/kernels/Scattering.C @@ -15,10 +15,12 @@ #include "Scattering.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", Scattering); + + +InputParameters Scattering::validParams() { - InputParameters params = validParams(); + InputParameters params = Kernel::validParams(); params.addRequiredCoupledVar("fluxes", "All of the fluxes"); @@ -39,10 +41,7 @@ Scattering::Scattering(const InputParameters & parameters) : _vals[i] = &coupledValue("fluxes", i); } -Scattering::~Scattering() -{ - -} +// Scattering::~Scattering() { } Real Scattering::computeQpResidual() diff --git a/src/main.C b/src/main.C index 31d2a2e..0645fa2 100644 --- a/src/main.C +++ b/src/main.C @@ -8,7 +8,8 @@ PerfLog Moose::perf_log("Gardensnake"); // Begin the main program. -int main(int argc, char *argv[]) +int +main(int argc, char * argv[]) { // Initialize MPI, solvers and MOOSE MooseInit init(argc, argv); @@ -17,13 +18,14 @@ int main(int argc, char *argv[]) GardensnakeApp::registerApps(); // This creates dynamic memory that we're responsible for deleting - MooseApp * app = AppFactory::createApp("GardensnakeApp", argc, argv); + // MooseApp * app = AppFactory::createAppShared("GardensnakeApp", argc, argv); + std::shared_ptr app = AppFactory::createAppShared("GardensnakeApp", argc, argv); // Execute the application app->run(); // Free up the memory we created earlier - delete app; + // delete app; return 0; } diff --git a/src/materials/XSMaterial.C b/src/materials/XSMaterial.C index 180254a..7d326d2 100644 --- a/src/materials/XSMaterial.C +++ b/src/materials/XSMaterial.C @@ -14,39 +14,45 @@ #include "XSMaterial.h" -template<> -InputParameters validParams() -{ - InputParameters params = validParams(); - - params.addRequiredParam >("d0", "Diffusion coefficient for each Material for group 0"); - params.addRequiredParam >("d1", "Diffusion coefficient for each Material for group 1"); - params.addRequiredParam >("a0", "Absorption XS for each Material for group 0"); - params.addRequiredParam >("a1", "Absorption XS for each Material for group 1"); - params.addRequiredParam >("s0_1", "Downscatter XS for 0->1"); - params.addRequiredParam >("nf0", "Fission XS for group 0"); - params.addRequiredParam >("nf1", "Fission XS for group 1"); +registerMooseObject("GardensnakeApp", XSMaterial); - params.addRequiredCoupledVar("zone", "A variable holding an integer for each element that specifies which 'zone' that element is part of"); +InputParameters +XSMaterial::validParams() +{ + InputParameters params = Material::validParams(); + + params.addRequiredParam>("d0", + "Diffusion coefficient for each Material for group 0"); + params.addRequiredParam>("d1", + "Diffusion coefficient for each Material for group 1"); + params.addRequiredParam>("a0", "Absorption XS for each Material for group 0"); + params.addRequiredParam>("a1", "Absorption XS for each Material for group 1"); + params.addRequiredParam>("s0_1", "Downscatter XS for 0->1"); + params.addRequiredParam>("nf0", "Fission XS for group 0"); + params.addRequiredParam>("nf1", "Fission XS for group 1"); + + params.addRequiredCoupledVar("zone", + "A variable holding an integer for each element that specifies " + "which 'zone' that element is part of"); return params; } -XSMaterial::XSMaterial(const InputParameters & parameters) : - Material(parameters), +XSMaterial::XSMaterial(const InputParameters & parameters) + : Material(parameters), _current_zone(coupledValue("zone")), - _diffusivity(declareProperty >("diffusivity")), - _sigma_a(declareProperty >("sigma_a")), - _sigma_s(declareProperty > >("sigma_s")), - _nu_sigma_f(declareProperty >("nu_sigma_f")) + _diffusivity(declareProperty>("diffusivity")), + _sigma_a(declareProperty>("sigma_a")), + _sigma_s(declareProperty>>("sigma_s")), + _nu_sigma_f(declareProperty>("nu_sigma_f")) { - const std::vector & d0 = getParam >("d0"); - const std::vector & d1 = getParam >("d1"); - const std::vector & a0 = getParam >("a0"); - const std::vector & a1 = getParam >("a1"); - const std::vector & s0_1 = getParam >("s0_1"); - const std::vector & nf0 = getParam >("nf0"); - const std::vector & nf1 = getParam >("nf1"); + const std::vector & d0 = getParam>("d0"); + const std::vector & d1 = getParam>("d1"); + const std::vector & a0 = getParam>("a0"); + const std::vector & a1 = getParam>("a1"); + const std::vector & s0_1 = getParam>("s0_1"); + const std::vector & nf0 = getParam>("nf0"); + const std::vector & nf1 = getParam>("nf1"); const unsigned int n_zones = d0.size(); @@ -54,7 +60,7 @@ XSMaterial::XSMaterial(const InputParameters & parameters) : // Load up the Zones: - for (unsigned int i=0; i < n_zones; i++) + for (unsigned int i = 0; i < n_zones; i++) { Zone & _zone = _zones[i]; @@ -63,7 +69,7 @@ XSMaterial::XSMaterial(const InputParameters & parameters) : _zone.nu_sigma_f.resize(2); _zone.sigma_s.resize(2); - for (unsigned int j=0; j < 2; j++) + for (unsigned int j = 0; j < 2; j++) _zone.sigma_s[j].resize(2); _zone.diffusivity[0] = d0[i]; @@ -73,7 +79,7 @@ XSMaterial::XSMaterial(const InputParameters & parameters) : _zone.sigma_a[1] = a1[i]; _zone.sigma_s[0][0] = -s0_1[i]; // Loss - _zone.sigma_s[1][0] = s0_1[i]; // Gain + _zone.sigma_s[1][0] = s0_1[i]; // Gain _zone.nu_sigma_f[0] = nf0[i]; _zone.nu_sigma_f[1] = nf1[i]; diff --git a/src/postprocessors/FissionSourceRMSFractionalChange.C b/src/postprocessors/FissionSourceRMSFractionalChange.C index d5a2f5b..20f4db6 100644 --- a/src/postprocessors/FissionSourceRMSFractionalChange.C +++ b/src/postprocessors/FissionSourceRMSFractionalChange.C @@ -14,26 +14,29 @@ #include "FissionSourceRMSFractionalChange.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", FissionSourceRMSFractionalChange); + +InputParameters +FissionSourceRMSFractionalChange::validParams() { - InputParameters params = validParams(); + InputParameters params = ZoneElementAverageValue::validParams(); params.addRequiredCoupledVar("fluxes", "The fluxes"); return params; } -FissionSourceRMSFractionalChange::FissionSourceRMSFractionalChange(const InputParameters & parameters) : - ZoneElementAverageValue(parameters), - _nu_sigma_f(getMaterialProperty >("nu_sigma_f")) +FissionSourceRMSFractionalChange::FissionSourceRMSFractionalChange( + const InputParameters & parameters) + : ZoneElementAverageValue(parameters), + _nu_sigma_f(getMaterialProperty>("nu_sigma_f")) { unsigned int n = coupledComponents("fluxes"); _fluxes.resize(n); _fluxes_old.resize(n); - for (unsigned int i=0; i<_fluxes.size(); ++i) + for (unsigned int i = 0; i < _fluxes.size(); ++i) { _fluxes[i] = &coupledValue("fluxes", i); _fluxes_old[i] = &coupledValueOld("fluxes", i); @@ -46,7 +49,7 @@ FissionSourceRMSFractionalChange::computeQpIntegral() Real fission_rate = 0; Real fission_rate_old = 0; - for (unsigned int i=0; i<_fluxes.size(); i++) + for (unsigned int i = 0; i < _fluxes.size(); i++) { fission_rate += _nu_sigma_f[_qp][i] * (*_fluxes[i])[_qp]; fission_rate_old += _nu_sigma_f[_qp][i] * (*_fluxes_old[i])[_qp]; @@ -57,7 +60,7 @@ FissionSourceRMSFractionalChange::computeQpIntegral() if (isnan(change)) return 0; - return change*change; + return change * change; } Real diff --git a/src/postprocessors/IntegratedFissionRatePostprocessor.C b/src/postprocessors/IntegratedFissionRatePostprocessor.C index 0811318..27bfd87 100644 --- a/src/postprocessors/IntegratedFissionRatePostprocessor.C +++ b/src/postprocessors/IntegratedFissionRatePostprocessor.C @@ -14,28 +14,33 @@ #include "IntegratedFissionRatePostprocessor.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", IntegratedFissionRatePostprocessor); + +InputParameters +IntegratedFissionRatePostprocessor::validParams() { - InputParameters params = validParams(); + InputParameters params = ZoneElementIntegralPostprocessor::validParams(); params.addRequiredCoupledVar("fluxes", "All of the fluxes"); - params.addRequiredParam("new", "Whether or not to compute the new fission rate. ie if 'false' then compute the old fission rate"); + params.addRequiredParam("new", + "Whether or not to compute the new fission rate. ie if 'false' " + "then compute the old fission rate"); return params; } -IntegratedFissionRatePostprocessor::IntegratedFissionRatePostprocessor(const InputParameters & parameters) : - ZoneElementIntegralPostprocessor(parameters), +IntegratedFissionRatePostprocessor::IntegratedFissionRatePostprocessor( + const InputParameters & parameters) + : ZoneElementIntegralPostprocessor(parameters), _new(getParam("new")), - _nu_sigma_f(getMaterialProperty >("nu_sigma_f")) + _nu_sigma_f(getMaterialProperty>("nu_sigma_f")) { unsigned int n = coupledComponents("fluxes"); _vals.resize(n); - for (unsigned int i=0; i<_vals.size(); ++i) + for (unsigned int i = 0; i < _vals.size(); ++i) { if (_new) _vals[i] = &coupledValue("fluxes", i); @@ -49,7 +54,7 @@ IntegratedFissionRatePostprocessor::computeQpIntegral() { Real r = 0; - for (unsigned int i=0; i<_vals.size(); i++) + for (unsigned int i = 0; i < _vals.size(); i++) r += _nu_sigma_f[_qp][i] * (*_vals[i])[_qp]; return r; diff --git a/src/postprocessors/KEigenvalue.C b/src/postprocessors/KEigenvalue.C index 2ddf582..5eb574c 100644 --- a/src/postprocessors/KEigenvalue.C +++ b/src/postprocessors/KEigenvalue.C @@ -15,38 +15,43 @@ #include "KEigenvalue.h" #include "SubProblem.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", KEigenvalue); + +InputParameters +KEigenvalue::validParams() { - InputParameters params = validParams(); + InputParameters params = GeneralPostprocessor::validParams(); - params.addParam("fission_rate", "The Postprocessor that is computing the integrated fission rate"); - params.addParam("fission_rate_old", "The Postprocessor that is computing the integrated fission rate with the old flux"); + params.addParam( + "fission_rate", "The Postprocessor that is computing the integrated fission rate"); + params.addParam( + "fission_rate_old", + "The Postprocessor that is computing the integrated fission rate with the old flux"); return params; } -KEigenvalue::KEigenvalue(const InputParameters & parameters) : - GeneralPostprocessor(parameters), +KEigenvalue::KEigenvalue(const InputParameters & parameters) + : GeneralPostprocessor(parameters), _fission_rate(getPostprocessorValue("fission_rate")), _fission_rate_old(getPostprocessorValue("fission_rate_old")), _old_eigenvalue(getPostprocessorValueOldByName(name())) -{} +{ +} Real KEigenvalue::getValue() { - std::cout<<"Computing Eigenvalue!"< -InputParameters validParams() +registerMooseObject("GardensnakeApp", PeakFissionSource); + +InputParameters +PeakFissionSource::validParams() { - InputParameters params = validParams(); + InputParameters params = ZoneElementAverageValue::validParams(); params.addRequiredCoupledVar("fluxes", "The fluxes"); @@ -30,17 +32,17 @@ InputParameters validParams() return params; } -PeakFissionSource::PeakFissionSource(const InputParameters & parameters) : - ZoneElementAverageValue(parameters), +PeakFissionSource::PeakFissionSource(const InputParameters & parameters) + : ZoneElementAverageValue(parameters), _report(getParam("report")), _center(getParam("center")), - _nu_sigma_f(getMaterialProperty >("nu_sigma_f")) + _nu_sigma_f(getMaterialProperty>("nu_sigma_f")) { unsigned int n = coupledComponents("fluxes"); _fluxes.resize(n); - for (unsigned int i=0; i<_fluxes.size(); ++i) + for (unsigned int i = 0; i < _fluxes.size(); ++i) _fluxes[i] = &coupledValue("fluxes", i); } @@ -57,7 +59,7 @@ PeakFissionSource::computeQpIntegral() { Real fission_rate = 0; - for (unsigned int i=0; i<_fluxes.size(); i++) + for (unsigned int i = 0; i < _fluxes.size(); i++) fission_rate += _nu_sigma_f[_qp][i] * (*_fluxes[i])[_qp]; if (fission_rate > _max_fission_rate) diff --git a/src/postprocessors/PostprocessorRelativeChange.C b/src/postprocessors/PostprocessorRelativeChange.C index b0519dd..bc0453b 100644 --- a/src/postprocessors/PostprocessorRelativeChange.C +++ b/src/postprocessors/PostprocessorRelativeChange.C @@ -15,24 +15,27 @@ #include "PostprocessorRelativeChange.h" #include "SubProblem.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", PostprocessorRelativeChange); + +InputParameters +PostprocessorRelativeChange::validParams() { - InputParameters params = validParams(); + InputParameters params = GeneralPostprocessor::validParams(); params.addParam("pp", "The Postprocessor to compute the relative change of."); return params; } -PostprocessorRelativeChange::PostprocessorRelativeChange(const InputParameters & parameters) : - GeneralPostprocessor(parameters), +PostprocessorRelativeChange::PostprocessorRelativeChange(const InputParameters & parameters) + : GeneralPostprocessor(parameters), _pp(getPostprocessorValue("pp")), _pp_old(getPostprocessorValueOld("pp")) -{} +{ +} Real PostprocessorRelativeChange::getValue() { - return std::abs((_pp - _pp_old)/_pp); + return std::abs((_pp - _pp_old) / _pp); } diff --git a/src/postprocessors/TotalFluxRMSFractionalChange.C b/src/postprocessors/TotalFluxRMSFractionalChange.C index debd231..96abce0 100644 --- a/src/postprocessors/TotalFluxRMSFractionalChange.C +++ b/src/postprocessors/TotalFluxRMSFractionalChange.C @@ -14,25 +14,27 @@ #include "TotalFluxRMSFractionalChange.h" -template<> -InputParameters validParams() +registerMooseObject("GardensnakeApp", TotalFluxRMSFractionalChange); + +InputParameters +TotalFluxRMSFractionalChange::validParams() { - InputParameters params = validParams(); + InputParameters params = ElementAverageValue::validParams(); params.addRequiredCoupledVar("fluxes", "The fluxes"); return params; } -TotalFluxRMSFractionalChange::TotalFluxRMSFractionalChange(const InputParameters & parameters) : - ElementAverageValue(parameters) +TotalFluxRMSFractionalChange::TotalFluxRMSFractionalChange(const InputParameters & parameters) + : ElementAverageValue(parameters) { unsigned int n = coupledComponents("fluxes"); _fluxes.resize(n); _fluxes_old.resize(n); - for (unsigned int i=0; i<_fluxes.size(); ++i) + for (unsigned int i = 0; i < _fluxes.size(); ++i) { _fluxes[i] = &coupledValue("fluxes", i); _fluxes_old[i] = &coupledValueOld("fluxes", i); @@ -45,7 +47,7 @@ TotalFluxRMSFractionalChange::computeQpIntegral() Real total_flux = 0; Real total_flux_old = 0; - for (unsigned int i=0; i<_fluxes.size(); i++) + for (unsigned int i = 0; i < _fluxes.size(); i++) { total_flux += (*_fluxes[i])[_qp]; total_flux_old += (*_fluxes_old[i])[_qp]; @@ -53,7 +55,7 @@ TotalFluxRMSFractionalChange::computeQpIntegral() Real change = (total_flux - total_flux_old) / total_flux; - return change*change; + return change * change; } Real diff --git a/src/postprocessors/ZoneElementAverageValue.C b/src/postprocessors/ZoneElementAverageValue.C index 83dd3f0..c8dfe49 100644 --- a/src/postprocessors/ZoneElementAverageValue.C +++ b/src/postprocessors/ZoneElementAverageValue.C @@ -14,17 +14,19 @@ #include "ZoneElementAverageValue.h" -template<> -InputParameters validParams() +// registerMooseObject("GardensnakeApp", ZoneElementAverageValue); + +InputParameters +ZoneElementAverageValue::validParams() { - InputParameters params = validParams(); + InputParameters params = ZoneElementIntegralPostprocessor::validParams(); return params; } -ZoneElementAverageValue::ZoneElementAverageValue(const InputParameters & parameters) : - ZoneElementIntegralPostprocessor(parameters), - _volume(0) -{} +ZoneElementAverageValue::ZoneElementAverageValue(const InputParameters & parameters) + : ZoneElementIntegralPostprocessor(parameters), _volume(0) +{ +} void ZoneElementAverageValue::initialize() @@ -36,8 +38,10 @@ ZoneElementAverageValue::initialize() void ZoneElementAverageValue::execute() { - // The zero is here because each element only falls in one zone - so it's sufficient to do this check for the first qp - if (std::find(_active_zones.begin(), _active_zones.end(), (unsigned int)_zone[0]) != _active_zones.end()) + // The zero is here because each element only falls in one zone - so it's sufficient to do this + // check for the first qp + if (std::find(_active_zones.begin(), _active_zones.end(), (unsigned int)_zone[0]) != + _active_zones.end()) { ZoneElementIntegralPostprocessor::execute(); _volume += _current_elem_volume; diff --git a/src/postprocessors/ZoneElementIntegralPostprocessor.C b/src/postprocessors/ZoneElementIntegralPostprocessor.C index ae2c19c..e2e037f 100644 --- a/src/postprocessors/ZoneElementIntegralPostprocessor.C +++ b/src/postprocessors/ZoneElementIntegralPostprocessor.C @@ -16,25 +16,30 @@ #include "libmesh/quadrature.h" -template<> -InputParameters validParams() +// registerMooseObject("GardensnakeApp", ZoneElementIntegralPostprocessor); + +InputParameters +ZoneElementIntegralPostprocessor::validParams() { - InputParameters params = validParams(); + InputParameters params = ElementPostprocessor::validParams(); params.addRequiredCoupledVar("zone", "The zone"); - params.addRequiredParam >("active_zones", "The zones where this postprocessor should be active"); + params.addRequiredParam>( + "active_zones", "The zones where this postprocessor should be active"); return params; } -ZoneElementIntegralPostprocessor::ZoneElementIntegralPostprocessor(const InputParameters & parameters) : - ElementPostprocessor(parameters), +ZoneElementIntegralPostprocessor::ZoneElementIntegralPostprocessor( + const InputParameters & parameters) + : ElementPostprocessor(parameters), _qp(0), _integral_value(0), _zone(coupledValue("zone")), - _active_zones(getParam >("active_zones")) -{} + _active_zones(getParam>("active_zones")) +{ +} void ZoneElementIntegralPostprocessor::initialize() @@ -45,8 +50,10 @@ ZoneElementIntegralPostprocessor::initialize() void ZoneElementIntegralPostprocessor::execute() { - // The zero is here because each element only falls in one zone - so it's sufficient to do this check for the first qp - if (std::find(_active_zones.begin(), _active_zones.end(), (unsigned int)_zone[0]) != _active_zones.end()) + // The zero is here because each element only falls in one zone - so it's sufficient to do this + // check for the first qp + if (std::find(_active_zones.begin(), _active_zones.end(), (unsigned int)_zone[0]) != + _active_zones.end()) _integral_value += computeIntegral(); } @@ -60,7 +67,8 @@ ZoneElementIntegralPostprocessor::getValue() void ZoneElementIntegralPostprocessor::threadJoin(const UserObject & y) { - const ZoneElementIntegralPostprocessor & pps = static_cast(y); + const ZoneElementIntegralPostprocessor & pps = + static_cast(y); _integral_value += pps._integral_value; } @@ -69,8 +77,8 @@ ZoneElementIntegralPostprocessor::computeIntegral() { Real sum = 0; - for (_qp=0; _qp<_qrule->n_points(); _qp++) - sum += _JxW[_qp]*_coord[_qp]*computeQpIntegral(); + for (_qp = 0; _qp < _qrule->n_points(); _qp++) + sum += _JxW[_qp] * _coord[_qp] * computeQpIntegral(); return sum; } diff --git a/src/userobjects/SolutionNormalizer.C b/src/userobjects/SolutionNormalizer.C index 60633a1..2df76a6 100644 --- a/src/userobjects/SolutionNormalizer.C +++ b/src/userobjects/SolutionNormalizer.C @@ -13,19 +13,27 @@ /****************************************************************/ #include "SolutionNormalizer.h" +#include "FEProblem.h" +#include "NonlinearSystem.h" -template<> -InputParameters validParams() +// template <> +registerMooseObject("GardensnakeApp", SolutionNormalizer); + +InputParameters +SolutionNormalizer::validParams() { - InputParameters params = validParams(); - params.addParam("k", "This is here to inject a dependency to insure tha tthis runs after the eigenvalue computation"); + InputParameters params = GeneralUserObject::validParams(); + + params.addParam("k", + "This is here to inject a dependency to insure tha this runs " + "after the eigenvalue computation"); return params; } -SolutionNormalizer::SolutionNormalizer(const InputParameters & parameters) : - GeneralUserObject(parameters) +SolutionNormalizer::SolutionNormalizer(const InputParameters & parameters) + : GeneralUserObject(parameters) { // We don't actually need to store it.... just try to get it to create the dependency. getPostprocessorValue("k"); @@ -34,11 +42,11 @@ SolutionNormalizer::SolutionNormalizer(const InputParameters & parameters) : void SolutionNormalizer::execute() { - std::cout<<"Normalizing Solution!"<