Commit 43169ece authored by Kevin Dugan's avatar Kevin Dugan

Adding in new App files

parent e20037eb
BasedOnStyle: LLVM
TabWidth: 2
ColumnLimit: 100
UseTab: Never
CommentPragmas: '^/'
ReflowComments: true
AlignTrailingComments: true
SpacesBeforeTrailingComments: 1
SpaceBeforeParens: ControlStatements
SpacesInSquareBrackets: false
BreakBeforeBraces: Allman
PointerAlignment: Middle
BinPackParameters: false
BinPackArguments: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
SortIncludes: false
IndentCaseLabels: true
ConstructorInitializerIndentWidth: 2
AlwaysBreakAfterDefinitionReturnType: TopLevel
AlwaysBreakTemplateDeclarations: true
......@@ -7,6 +7,8 @@
*-opt
*-dbg
*-oprof
*-prof
*-devel
*.e
*.nav
*.log
......@@ -16,7 +18,7 @@
*.csv
*.dylib
*.so
*.gitignore*
*.so.*
*.vrb
*.jou
*.pyc
......@@ -35,6 +37,7 @@
*.spl
*.idx
traceout*.txt
temp_print_trace.*
*.xda
*.xda.*
*.xdr
......@@ -64,8 +67,25 @@ traceout*.txt
*.out
*.vtk
*.vtu
*.pvtu
.depend
*.png
*.gif
*.tif
*.jpg
*.tiff
*.ps
*.bmp
*.html
*.xyz
*Revision.h
*.json
*.bak
*.processor.*
.clang_complete
.failed_tests
compile_commands.json
build
# Allow certain files in gold directories
!**/gold/*.e
......@@ -73,9 +93,17 @@ traceout*.txt
!**/gold/*.csv
!**/gold/*.vtk
!**/gold/*.vtu
!**/gold/*.pvtu
peacock_run_tmp.i
yaml_dump*
test/tests/outputs/format/dump.i
# Generated header file
MooseRevision.h
# Precompiled headers
moose/include/base/Precompiled.h.gch
# test garbagge
*.FAILED.txt
......@@ -92,12 +120,14 @@ yaml_dump*
.*.swp
.*.swo
framework/contrib/exodiff/exodiff
# Mac garbage
.DS_Store
*.dSYM
# Unit testing stuff
moose_unit/test_results.xml
# Unit testing stuffbmoose_unit/test_results.xml
!unit/data/csv/*.csv
# gcov code coverage files
*.gcno
......@@ -136,20 +166,44 @@ framework/contrib/asio/
*.cpa-*
*.cpr-*
# Revision files
include/base/*Revision.h
# phase_field/tests/solution_rasterizer
out.xyz
# Nek5000 run files
*.sch
SESSION.NAME
nek5000
# Autconf artifacts
aclocal.m4
autom4te.cache/**
config.log
config.status
install-sh
# JIT and automatic differentiation cache files
.jitcache/
.jitdir/
tmp_jit_*
# Do not store ipython notebook checkpoints
*-checkpoint.ipynb*
# MooseDocs
site
!**/doc/content/**/*.md
!**/doc/content/**/*.jpg
!**/doc/content/**/*.jpeg
!**/doc/content/**/*.gif
!**/doc/content/**/*.png
!**/doc/content/**/*.svg
!**/doc/content/**/*.ogg
!**/doc/content/**/*.webm
!**/doc/content/**/*.mp4
!**/doc/content/**/*.css
!**/doc/content/**/*.js
!**/doc/content/**/*.bib
!**/doc/content/**/*.woff
!**/doc/content/**/*.woff2
# Chigger
!python/chigger/tests/**/gold/*.png
!python/chigger/tests/input/*.e*
!python/chigger/logos/*.png
!python/chigger/contrib/*.xml
# Peacock
python/peacock/tests/exodus_tab/TestOutputPlugin_repr.py
python/peacock/tests/input_tab/InputFileEditor/fsp_test.i
python/peacock/tests/postprocessor_tab/TestPostprocessorPluginManager_test_script.py
!python/peacock/tests/**/gold/*.png
!python/peacock/icons/**/*.*
!python/peacock/tests/**/input/*.*
This diff is collapsed.
###############################################################################
################### MOOSE Application Standard Makefile #######################
###############################################################################
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
#
###############################################################################
# Use the MOOSE submodule if it exists and MOOSE_DIR is not set
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 ####################################
# To use certain physics included with MOOSE, set variables below to
# yes as needed. Or set ALL_MODULES to yes to turn on everything (overrides
# other set variables).
ALL_MODULES := no
CHEMICAL_REACTIONS := no
CONTACT := no
FLUID_PROPERTIES := no
HEAT_CONDUCTION := no
MISC := no
NAVIER_STOKES := no
PHASE_FIELD := no
RDG := no
RICHARDS := no
SOLID_MECHANICS := no
STOCHASTIC_TOOLS := no
TENSOR_MECHANICS := no
WATER_STEAM_EOS := no
XFEM := no
POROUS_FLOW := no
include $(MOOSE_DIR)/modules/modules.mk
###############################################################################
# dep apps
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := giraffe
BUILD_EXEC := yes
GEN_REVISION := no
include $(FRAMEWORK_DIR)/app.mk
###############################################################################
# Additional special case targets should be added here
Giraffe
=====
"Fork Giraffe" to create a new MOOSE-based application.
For more information see: [http://mooseframework.org/create-an-app/](http://mooseframework.org/create-an-app/)
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#ifndef GIRAFFEAPP_H
#define GIRAFFEAPP_H
#include "MooseApp.h"
class GiraffeApp;
template <>
InputParameters validParams<GiraffeApp>();
class GiraffeApp : public MooseApp
{
public:
GiraffeApp(InputParameters parameters);
virtual ~GiraffeApp();
static void registerApps();
static void registerObjects(Factory & factory);
static void registerObjectDepends(Factory & factory);
static void associateSyntax(Syntax & syntax, ActionFactory & action_factory);
static void associateSyntaxDepends(Syntax & syntax, ActionFactory & action_factory);
static void registerExecFlags(Factory & factory);
};
#endif /* GIRAFFEAPP_H */
#!/usr/bin/env python
import sys, os
MOOSE_DIR = os.path.abspath(os.environ.get('MOOSE_DIR', os.path.join(os.path.dirname(__file__), '..', 'moose')))
if os.path.exists(os.path.abspath(os.path.join('moose', 'framework', 'Makefile'))):
MOOSE_DIR = os.path.abspath('moose')
MOOSE_DIR = os.environ.get('MOOSE_DIR', MOOSE_DIR)
sys.path.append(os.path.join(MOOSE_DIR, 'python'))
from TestHarness import TestHarness
TestHarness.buildAndRun(sys.argv, None, MOOSE_DIR)
#!/bin/bash
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../"
hookfile="$REPO_DIR/.git/hooks/pre-commit"
if [[ -f $hookfile ]]; then
echo "'$hookfile' already exists - aborting" 1>&2
exit 1
fi
echo '#!/bin/bash
patch=$(git clang-format --diff -- $(git diff --staged --name-only -- src include tests unit))
if [[ "$patch" =~ "no modified files to format" || "$patch" =~ "clang-format did not modify any files" ]]; then
echo "" > /dev/null
else
echo ""
echo "Your code is not properly formatted." >&2
echo "Run 'git clang-format' to resolve the following issues:" >&2
echo ""
echo "$patch"
exit 1
fi
' > $hookfile
chmod a+x $hookfile
#include "GiraffeApp.h"
#include "Moose.h"
#include "AppFactory.h"
#include "ModulesApp.h"
#include "MooseSyntax.h"
template <>
InputParameters
validParams<GiraffeApp>()
{
InputParameters params = validParams<MooseApp>();
return params;
}
GiraffeApp::GiraffeApp(InputParameters parameters) : MooseApp(parameters)
{
Moose::registerObjects(_factory);
ModulesApp::registerObjects(_factory);
GiraffeApp::registerObjects(_factory);
Moose::associateSyntax(_syntax, _action_factory);
ModulesApp::associateSyntax(_syntax, _action_factory);
GiraffeApp::associateSyntax(_syntax, _action_factory);
Moose::registerExecFlags(_factory);
ModulesApp::registerExecFlags(_factory);
GiraffeApp::registerExecFlags(_factory);
}
GiraffeApp::~GiraffeApp() {}
void
GiraffeApp::registerApps()
{
registerApp(GiraffeApp);
}
void
GiraffeApp::registerObjects(Factory & factory)
{
Registry::registerObjectsTo(factory, {"GiraffeApp"});
}
void
GiraffeApp::associateSyntax(Syntax & /*syntax*/, ActionFactory & action_factory)
{
Registry::registerActionsTo(action_factory, {"GiraffeApp"});
/* Uncomment Syntax parameter and register your new production objects here! */
}
void
GiraffeApp::registerObjectDepends(Factory & /*factory*/)
{
}
void
GiraffeApp::associateSyntaxDepends(Syntax & /*syntax*/, ActionFactory & /*action_factory*/)
{
}
void
GiraffeApp::registerExecFlags(Factory & /*factory*/)
{
/* Uncomment Factory parameter and register your new execution flags here! */
}
/***************************************************************************************************
*********************** Dynamic Library Entry Points - DO NOT MODIFY ******************************
**************************************************************************************************/
extern "C" void
GiraffeApp__registerApps()
{
GiraffeApp::registerApps();
}
extern "C" void
GiraffeApp__registerObjects(Factory & factory)
{
GiraffeApp::registerObjects(factory);
}
extern "C" void
GiraffeApp__associateSyntax(Syntax & syntax, ActionFactory & action_factory)
{
GiraffeApp::associateSyntax(syntax, action_factory);
}
extern "C" void
GiraffeApp__registerExecFlags(Factory & factory)
{
GiraffeApp::registerExecFlags(factory);
}
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#include "GiraffeTestApp.h"
#include "MooseInit.h"
#include "Moose.h"
#include "MooseApp.h"
#include "AppFactory.h"
// Create a performance log
PerfLog Moose::perf_log("Giraffe");
// Begin the main program.
int
main(int argc, char * argv[])
{
// Initialize MPI, solvers and MOOSE
MooseInit init(argc, argv);
// Register this application's MooseApp and any it depends on
GiraffeTestApp::registerApps();
// Create an instance of the application and store it in a smart pointer for easy cleanup
std::shared_ptr<MooseApp> app = AppFactory::createAppShared("GiraffeTestApp", argc, argv);
// Execute the application
app->run();
return 0;
}
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#ifndef GIRAFFETESTAPP_H
#define GIRAFFETESTAPP_H
#include "MooseApp.h"
class GiraffeTestApp;
template <>
InputParameters validParams<GiraffeTestApp>();
class GiraffeTestApp : public MooseApp
{
public:
GiraffeTestApp(InputParameters parameters);
virtual ~GiraffeTestApp();
static void registerApps();
static void registerObjects(Factory & factory);
static void associateSyntax(Syntax & syntax, ActionFactory & action_factory);
static void registerExecFlags(Factory & factory);
};
#endif /* GIRAFFETESTAPP_H */
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#include "GiraffeTestApp.h"
#include "GiraffeApp.h"
#include "Moose.h"
#include "AppFactory.h"
#include "MooseSyntax.h"
#include "ModulesApp.h"
template <>
InputParameters
validParams<GiraffeTestApp>()
{
InputParameters params = validParams<GiraffeApp>();
return params;
}
GiraffeTestApp::GiraffeTestApp(InputParameters parameters) : MooseApp(parameters)
{
Moose::registerObjects(_factory);
ModulesApp::registerObjects(_factory);
GiraffeApp::registerObjectDepends(_factory);
GiraffeApp::registerObjects(_factory);
Moose::associateSyntax(_syntax, _action_factory);
ModulesApp::associateSyntax(_syntax, _action_factory);
GiraffeApp::associateSyntaxDepends(_syntax, _action_factory);
GiraffeApp::associateSyntax(_syntax, _action_factory);
Moose::registerExecFlags(_factory);
ModulesApp::registerExecFlags(_factory);
GiraffeApp::registerExecFlags(_factory);
bool use_test_objs = getParam<bool>("allow_test_objects");
if (use_test_objs)
{
GiraffeTestApp::registerObjects(_factory);
GiraffeTestApp::associateSyntax(_syntax, _action_factory);
GiraffeTestApp::registerExecFlags(_factory);
}
}
GiraffeTestApp::~GiraffeTestApp() {}
void
GiraffeTestApp::registerApps()
{
registerApp(GiraffeApp);
registerApp(GiraffeTestApp);
}
void
GiraffeTestApp::registerObjects(Factory & /*factory*/)
{
/* Uncomment Factory parameter and register your new test objects here! */
}
void
GiraffeTestApp::associateSyntax(Syntax & /*syntax*/, ActionFactory & /*action_factory*/)
{
/* Uncomment Syntax and ActionFactory parameters and register your new test objects here! */
}
void
GiraffeTestApp::registerExecFlags(Factory & /*factory*/)
{
/* Uncomment Factory parameter and register your new execute flags here! */
}
/***************************************************************************************************
*********************** Dynamic Library Entry Points - DO NOT MODIFY ******************************
**************************************************************************************************/
// External entry point for dynamic application loading
extern "C" void
GiraffeTestApp__registerApps()
{
GiraffeTestApp::registerApps();
}
// External entry point for dynamic object registration
extern "C" void
GiraffeTestApp__registerObjects(Factory & factory)
{
GiraffeTestApp::registerObjects(factory);
}
// External entry point for dynamic syntax association
extern "C" void
GiraffeTestApp__associateSyntax(Syntax & syntax, ActionFactory & action_factory)
{
GiraffeTestApp::associateSyntax(syntax, action_factory);
}
// External entry point for dynamic execute flag loading
extern "C" void
GiraffeTestApp__registerExecFlags(Factory & factory)
{
GiraffeTestApp::registerExecFlags(factory);
}
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Tests]
[./test]
type = 'Exodiff'
input = 'simple_diffusion.i'
exodiff = 'simple_diffusion_out.e'
[../]
[]
app_name = giraffe
allow_warnings = false
allow_unused = false
allow_override = false
###############################################################################
################### MOOSE Application Standard Makefile #######################
###############################################################################
#
# Required Environment variables (one of the following)
# PACKAGES_DIR - Location of the MOOSE redistributable package
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
# FRAMEWORK_DIR - Location of the MOOSE framework
#
###############################################################################
# Use the MOOSE submodule if it exists and MOOSE_DIR is not set
MOOSE_SUBMODULE := $(CURDIR)/../moose
ifneq ($(wildcard $(MOOSE_SUBMODULE)/framework/Makefile),)
MOOSE_DIR ?= $(MOOSE_SUBMODULE)
else
MOOSE_DIR ?= $(shell dirname `pwd`)/../moose
endif
FRAMEWORK_DIR ?= $(MOOSE_DIR)/framework
###############################################################################
# framework
include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk
################################## MODULES ####################################
# set desired physics modules equal to 'yes' to enable them
CHEMICAL_REACTIONS := no
CONTACT := no
FLUID_PROPERTIES := no
HEAT_CONDUCTION := no
MISC := no
NAVIER_STOKES := no
PHASE_FIELD := no
RDG := no
RICHARDS := no
SOLID_MECHANICS := no
STOCHASTIC_TOOLS := no
TENSOR_MECHANICS := no
WATER_STEAM_EOS := no
XFEM := no
POROUS_FLOW := no
LEVEL_SET := no
include $(MOOSE_DIR)/modules/modules.mk
###############################################################################
# Extra stuff for GTEST
ADDITIONAL_INCLUDES := -I$(FRAMEWORK_DIR)/contrib/gtest
ADDITIONAL_LIBS := $(FRAMEWORK_DIR)/contrib/gtest/libgtest.la
# dep apps
CURRENT_DIR := $(shell pwd)
APPLICATION_DIR := $(CURRENT_DIR)/..
APPLICATION_NAME := giraffe
include $(FRAMEWORK_DIR)/app.mk
APPLICATION_DIR := $(CURRENT_DIR)
APPLICATION_NAME := giraffe-unit
BUILD_EXEC := yes
DEP_APPS ?= $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include $(FRAMEWORK_DIR)/app.mk
# Find all the Giraffe unit test source files and include their dependencies.
giraffe_unit_srcfiles := $(shell find $(CURRENT_DIR)/src -name "*.C")
giraffe_unit_deps := $(patsubst %.C, %.$(obj-suffix).d, $(giraffe_unit_srcfiles))
-include $(giraffe_unit_deps)
###############################################################################
# Additional special case targets should be added here
#!/bin/bash
APPLICATION_NAME=giraffe
# If $METHOD is not set, use opt
if [ -z $METHOD ]; then
export METHOD=opt
fi
if [ -e ./unit/$APPLICATION_NAME-unit-$METHOD ]
then
./unit/$APPLICATION_NAME-unit-$METHOD
elif [ -e ./$APPLICATION_NAME-unit-$METHOD ]
then
./$APPLICATION_NAME-unit-$METHOD
else
echo "Executable missing!"
exit 1
fi
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#include "gtest/gtest.h"
TEST(MySampleTests, descriptiveTestName)