Commit 16c7fbf9 authored by Ron Rahaman's avatar Ron Rahaman

Added ex01_inputfile to top-level examples

parent 96eb53be
###############################################################################
################### MOOSE Application Standard Makefile #######################
###############################################################################
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
# FRAMEWORK_DIR - Location of the MOOSE framework
#
###############################################################################
EXAMPLE_DIR ?= $(shell dirname `pwd`)
MOOSE_DIR ?= $(shell dirname $(EXAMPLE_DIR))/src/moose
FRAMEWORK_DIR ?= $(MOOSE_DIR)/framework
###############################################################################
TEST := test_ignore
# framework
include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk
APPLICATION_NAME := ex01
# dep apps
APPLICATION_DIR := $(shell pwd)
APPLICATION_NAME := ex01
BUILD_EXEC := yes
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include $(FRAMEWORK_DIR)/app.mk
include ../test.mk
# Include dependency files for this example
ex_srcfiles := $(shell find $(APPLICATION_DIR) -name "*.C")
ex_deps := $(patsubst %.C, %.$(obj-suffix).d, $(ex_srcfiles))
-include $(ex_deps)
###############################################################################
# Additional special case targets should be added here
test: all
$(call TEST_exodiff,ex01.i,ex01_out.e)
[Mesh]
file = square.e
uniform_refine = 4
[]
# Note: This output block is out of its normal place (should be at the bottom)
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
# Note: The executioner is out of its normal place (should be just about the output block)
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Variables]
active = 'diffused' # Note the active list here
[./diffused]
order = FIRST
family = LAGRANGE
[../]
# This variable is not active in the list above
# therefore it is not used in the simulation
[./convected]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = diffused
[../]
[]
# This example applies DirichletBCs to all four sides of our square domain
[BCs]
[./left]
type = DirichletBC
variable = diffused
boundary = '1'
value = 0
[../]
[./right]
type = DirichletBC
variable = diffused
boundary = '2'
value = 1
[../]
[]
[Mesh]
file = mug.e
[]
[Variables]
[./diffused]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = Diffusion
variable = diffused
[../]
[]
[BCs]
[./bottom]
type = DirichletBC
variable = diffused
boundary = 'bottom'
value = 1
[../]
[./top]
type = DirichletBC
variable = diffused
boundary = 'top'
value = 0
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
This example has no header files. This directory
is just included for consistency with the other
examples.
\ No newline at end of file
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef EXAMPLEAPP_H
#define EXAMPLEAPP_H
#include "MooseApp.h"
class ExampleApp;
template<>
InputParameters validParams<ExampleApp>();
class ExampleApp : public MooseApp
{
public:
ExampleApp(InputParameters parameters);
virtual ~ExampleApp();
static void registerApps();
static void registerObjects(Factory & factory);
static void associateSyntax(Syntax& syntax, ActionFactory & action_factory);
};
#endif /* EXAMPLEAPP_H */
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#include "ExampleApp.h"
#include "Moose.h"
#include "Factory.h"
#include "AppFactory.h"
#include "MooseSyntax.h"
template<>
InputParameters validParams<ExampleApp>()
{
InputParameters params = validParams<MooseApp>();
params.set<bool>("use_legacy_uo_initialization") = false;
params.set<bool>("use_legacy_uo_aux_computation") = false;
return params;
}
ExampleApp::ExampleApp(InputParameters parameters) :
MooseApp(parameters)
{
srand(processor_id());
Moose::registerObjects(_factory);
ExampleApp::registerObjects(_factory);
Moose::associateSyntax(_syntax, _action_factory);
ExampleApp::associateSyntax(_syntax, _action_factory);
}
ExampleApp::~ExampleApp()
{
}
void
ExampleApp::registerObjects(Factory & /*factory*/)
{
}
void
ExampleApp::registerApps()
{
registerApp(ExampleApp);
}
void
ExampleApp::associateSyntax(Syntax& /*syntax*/, ActionFactory & /*action_factory*/)
{
}
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
/**
* Example 1: Input File - The smallest MOOSE based application possible. It solves
* a simple 2D diffusion problem with Dirichlet boundary conditions using built-in
* objects from MOOSE.
*/
#include "ExampleApp.h"
//Moose Includes
#include "MooseInit.h"
#include "Moose.h"
#include "MooseApp.h"
#include "AppFactory.h"
// Create a performance log
PerfLog Moose::perf_log("Example");
// 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
ExampleApp::registerApps();
// This creates dynamic memory that we're responsible for deleting
MooseApp * app = AppFactory::createApp("ExampleApp", argc, argv);
// Execute the application
app->run();
// Free up the memory we created earlier
delete app;
return 0;
}
TEST_exodiff = \
@./$(APPLICATION_NAME)-$(METHOD) -i $(1) > /dev/null 2>&1 && \
$(FRAMEWORK_DIR)/contrib/exodiff/exodiff -quiet -F 1e-8 -t 5.5E-6 $(2) gold/$(2) | grep -qi "files are the same" && \
echo $(APPLICATION_NAME) ... OK || \
(echo $(APPLICATION_NAME) ... FAILED && exit 1)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment