Commit 7365c202 authored by Ron Rahaman's avatar Ron Rahaman

Merge branch 'updatedApp' into 'develop'

Updated app

See merge request !9
parents 51647a0e a8dad671
Pipeline #3424 passed with stages
in 19 minutes and 34 seconds
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,53 @@ 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
# 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/*.*
# Giraffe/Nek5000
autom4te.cache/
config.guess
config.sub
configure
install-sh
config.status
giraffe.mk
......@@ -29,8 +29,7 @@ configure_giraffe_job:
MOOSE_JOBS: 32
script:
- ./bootstrap || echo
- cd examples/integration_example/
- ../../configure
- ./configure
build_giraffe_job:
stage: build_giraffe
......@@ -42,7 +41,6 @@ build_giraffe_job:
LIBMESH_DIR: "$CI_PROJECT_DIR/moose/libmesh/installed"
MOOSE_JOBS: 32
script:
- cd examples/integration_example/
- make -j8
run_giraffe_serial_job:
......
###############################################################################
# GIRAFFE MAKEFILE
################### MOOSE Application Standard Makefile #######################
###############################################################################
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
# FRAMEWORK_DIR - Location of the MOOSE framework
# MOOSE_DIR - Root directory of the MOOSE project
#
###############################################################################
GIRAFFE_DIR := @abs_srcdir@
MOOSE_DIR := @MOOSE_DIR@
FRAMEWORK_DIR := @MOOSE_DIR@/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
FRAMEWORK_DIR := $(MOOSE_DIR)/framework
include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk
################################## MODULES ####################################
SOLID_MECHANICS := no
CONTACT := no
HEAT_CONDUCTION := yes
WATER_STEAM_EOS := no
MISC := no
PHASE_FIELD := no
XFEM := no
include $(MOOSE_DIR)/modules/modules.mk
# 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
################################## GIRAFFE ####################################
CHEMICAL_REACTIONS := no
CONTACT := no
FLUID_PROPERTIES := no
HEAT_CONDUCTION := yes
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
###############################################################################
# nek
include giraffe.mk
APPLICATION_DIR := $(GIRAFFE_DIR)
# dep apps
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := giraffe
MAIN_DIR := $(APPLICATION_DIR)/src
BUILD_EXEC := yes
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py integration_example)
GEN_REVISION := no
include $(FRAMEWORK_DIR)/app.mk
###############################################################################
......
......@@ -27,29 +27,28 @@ Building Example Problems
### Basic compilation
Giraffe must be separately compiled for each specific problem, since Nek5000 uses static memory allocations that are specific to the problem setup. To build an example problem:
1. In the top-level Giraffe, directory use the `bootstrap` script to generate a `configure` script.
2. In the subdirectory for the example problem, run the `configure` script.
3. In the subdirctory for the example problem, run `make`.
1. In the top-level Giraffe directory, use the `bootstrap` script to generate a `configure` script.
2. In the top-level Giraffe directory, run the `configure` script to generate Makefiles. **Note: specify the problem by setting GIRAFFE_EXAMPLE. If unspecified by user, GIRAFFE_EXAMPLE points to** `<GiraffeRoot>/examples/integration_example`.
3. In the top-level Giraffe directory, run `make`.
The complete steps for the `integration_example` problem are:
``` Shell
$ cd giraffe
$ ./bootstrap
$ cd examples/integration_example
$ ../../configure
$ ./configure GIRAFFE_EXAMPLE=path/to/example
$ make
```
A successful compilation will create libraries and executables in the top-level Giraffe directory (in this case, `giraffe/lib/lib-giraffe-opt.so` and `giraffe/giraffe-opt`). **Note that, even though the libraries and executables are problem specific, they are not output to the problem's director.**
The user may also specify the `METHOD` variable to build different versions of Giraffe, i.e. `opt`, `dbg`, or `oprof`. A successful compilation will create libraries and executables in the top-level Giraffe directory (in this case, `giraffe/lib/lib-giraffe-opt.so` and `giraffe/giraffe-opt`). **Note that, even though the libraries and executables are problem specific, they are not output to the problem's directory.**
### Additional compilation options
To perform custom compilations, the `configure` script may be run with additional options. Run `./configure --help` to see a complete list of the available options and variables. Some of the most useful are:
* `CASENAME`: Specfies the basename of the Nek5000 `.usr` file. For example, if you were compiling with `integration_example.usr`, then you would specify `CASENAME="integration_example"`. The default value of `CASENAME` is the name of the example subdirectory.
* `CASENAME`: Specfies the basename of the Nek5000 `.usr` file. For example, if you were compiling with `integration_example.usr`, then you would specify `CASENAME="integration_example"`. The default value of `CASENAME` is the name of the example subdirectory.
* `MOOSE_DIR`: Inherited from the environment. If it is specified here, it will override the environment's value.
* `LIBMESH_DIR`: Inherited from the environment. If it is specified here, it will override the environment's value.
For the majority of situations, it is not recommended to directly specify compilers and compiler/linker flags to configure script (`CC`, `CFLAGS`, `LDFLAGS`, etc). This is because, by default, the compilers and flags are detected from the libmesh installation, which ensures a consistent compilation of Giraffe.
For the majority of situations, it is not recommended to directly specify compilers and compiler/linker flags to configure script (`CC`, `CFLAGS`, `LDFLAGS`, etc). This is because, by default, the compilers and flags are detected from the libmesh installation, which ensures a consistent compilation of Giraffe.
### Running Example Problems
......@@ -65,11 +64,11 @@ $ cd examples/integration example/
$ ../../giraffe-opt -i coefficient_integration.i
```
Upon repeated runs, Nek5000 may raise an error if an output `.sch` file is present. If so, delete the `.sch` file and rerun Giraffe.
Upon repeated runs, Nek5000 may raise an error if an output `.sch` file is present. If so, delete the `.sch` file and rerun Giraffe.
Developing Giraffe
------------------
Giraffe is ensured to be compatable with the current [MOOSE master branch](https://github.com/idaholab/moose/tree/master). However, Giraffee is **not** necessarily compatable with a current or previous version [Nek5000 master branc](https://github.com/Nek5000/Nek5000/tree/master). Hence, Giraffe includes Nek5000 as a Git **subtree** rather than a submodule.
Giraffe is ensured to be compatable with the current [MOOSE master branch](https://github.com/idaholab/moose/tree/master). However, Giraffee is **not** necessarily compatable with a current or previous version [Nek5000 master branc](https://github.com/Nek5000/Nek5000/tree/master). Hence, Giraffe includes Nek5000 as a Git **subtree** rather than a submodule.
The use of a subtree means that developers may freely modify Nek5000 as if it were a normal part of the Giraffe repo. For routine commits, pushes, and pulls to the Giraffe repository, no extra Git commands are necessary for changing `giraffe/Nek5000`. With some additional Git commands, developers may also merge upstream changes from [https://github.com/Nek5000/Nek5000](https://github.com/Nek5000/Nek5000) into `giraffe/Nek5000`. Finally, developers may also request to merge changes from `giraffe/Nek5000` to [https://github.com/Nek5000/Nek5000](https://github.com/Nek5000/Nek5000). This [blog post](http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/) from Atlassian gives a brief rundown of these operations.
@CASENAME@
@abs_builddir@
@GIRAFFE_EXAMPLE_ABS@
# == Source and destination directories ============================================================
VPATH := @srcdir@/Nek5000/core:@srcdir@/Nek5000/core/cmt:@srcdir@/Nek5000/core/3rd_party:@srcdir@/Nek5000/jl:@srcdir@/src_nek
srcdir := @srcdir@
builddir := @builddir@
nek_objdir := @builddir@/nek_obj
nek_includedir := @builddir@/include
VPATH := @abs_srcdir@/Nek5000/core:@abs_srcdir@/Nek5000/core/cmt:@abs_srcdir@/Nek5000/core/3rd_party:@abs_srcdir@/Nek5000/jl:@abs_srcdir@/src_nek
srcdir := @abs_srcdir@
GIRAFFE_EXAMPLE ?= @abs_srcdir@/examples/integration_example
builddir := $(GIRAFFE_EXAMPLE)
nek_objdir := $(GIRAFFE_EXAMPLE)/nek_obj
nek_includedir := $(GIRAFFE_EXAMPLE)/include
# == Discovered by autoconf script
CASENAME := @CASENAME@
nek_CFLAGS := @CFLAGS@
CASENAME ?= $(shell basename $(GIRAFFE_EXAMPLE))
nek_CFLAGS := $(libmesh_CFLAGS)
nek_INCLUDES := -I$(builddir) -I$(nek_includedir) -I$(srcdir)/Nek5000/core -I$(srcdir)/Nek5000/core/cmt -I$(srcdir)/Nek5000/core/3rd_party -I$(srcdir)/Nek5000/jl -I$(srcdir)/src_nek
nek_CPPFLAGS := @CPPFLAGS@ @DEFS@ @nek_DEFS@ $(nek_INCLUDES)
nek_CPPFLAGS := $(libmesh_CPPFLAGS) @DEFS@ @nek_DEFS@ $(nek_INCLUDES)
nek_LDFLAGS := @LDFLAGS@
nek_LIBS := @LIBS@
nek_LIBS := $(libmesh_LIBS)
nek_FFLAGS := @FFLAGS@ @FCFLAGS_f@ $(subst -D, @FC_DEFINE@, @DEFS@ @nek_DEFS@) $(nek_INCLUDES)
nek_FLIBS := @FLIBS@
......@@ -32,7 +33,9 @@ nek_core_f_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), \
subs1 subs2 genbox gmres hsmg convect induct perturb navier5 \
navier6 navier7 navier8 fast3d fasts calcz postpro \
cvode_driver vprops qthermal cvode_aux makeq_aux papi nek_in_situ \
readat_new nek_moose @CASENAME@))
readat_new nek_moose))
nek_case_f_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), $(CASENAME)))
nek_math_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), math))
nek_blas_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_blas_obj@)) # blas.o | null
......@@ -43,7 +46,8 @@ nek_mxm_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_m
nek_neknek_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), @nek_neknek_obj@)) # singlmesh.o | multimesh.o
nek_flib_obj := $(nek_core_f_obj) $(nek_math_obj) $(nek_blas_obj) $(nek_cmt_obj) \
$(nek_lapack_obj) $(nek_mpi_obj) $(nek_mxm_obj) $(nek_neknek_obj)
$(nek_lapack_obj) $(nek_mpi_obj) $(nek_mxm_obj) $(nek_neknek_obj) \
$(nek_case_f_obj)
# == C objects =====================================================================================
nek_core_c_obj := $(addprefix $(nek_objdir)/, $(addsuffix .$(obj-suffix), \
......@@ -58,39 +62,41 @@ jl_cgs_obj := $(addprefix $(nek_objdir)/, $(patsubst %, $(jl_prefix)%.$(obj-
nek_clib_obj := $(nek_core_c_obj) $(jl_core_obj) $(jl_interp_obj) $(jl_cgs_obj)
# == MOOSE app flags and objects ==================================================================
# Recursive definition (= rather than :=) is probably the right usage, since they're probably
# defined here after they're referenced by MOOSE makefile
ADDITIONAL_CPPFLAGS = @CPPFLAGS@ @DEFS@ # Used by pattern rules in moose/framework/build.mk
ADDITIONAL_INCLUDES = $(nek_INCLUDES) # Used by pattern rules in moose/framework/build.mk (through app_INCLUDES)
ADDITIONAL_LIBS = $(nek_LIBS) $(nek_FLIBS) # Used during linking in moose/framework/app.mk
ADDITIONAL_APP_OBJECTS = $(nek_flib_obj) $(nek_clib_obj) # Added to dependencies in moose/framework/app.mk
ADDITIONAL_CPPFLAGS := $(ADDITIONAL_CPPFLAGS) $(libmesh_CPPFLAGS) @DEFS@ # Used by pattern rules in moose/framework/build.mk
ADDITIONAL_INCLUDES := $(ADDITIONAL_INCLUDES) $(nek_INCLUDES) # Used by pattern rules in moose/framework/build.mk (through app_INCLUDES)
ADDITIONAL_LIBS := $(ADDITIONAL_LIBS) $(nek_LIBS) $(nek_FLIBS) # Used during linking in moose/framework/app.mk
ADDITIONAL_APP_OBJECTS := $(ADDITIONAL_APP_OBJECTS) $(nek_flib_obj) $(nek_clib_obj) # Added to dependencies in moose/framework/app.mk
# == Rules =========================================================================================
nek5000: $(nek_drive_obj) $(nek_flib_obj) $(nek_clib_obj)
@echo "Linking Executable "$@"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=link \
$(libmesh_F77) $(libmesh_FFLAGS) -o $@ $^ $(libmesh_LIBS) $(libmesh_LDFLAGS) $(nek_LIBS) $(nek_LDFLAGS) $(nek_FLIBS)
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=link --quiet \
$(libmesh_F77) $(libmesh_FFLAGS) -o $@ $^ $(libmesh_LIBS) $(libmesh_LDFLAGS) $(nek_LIBS) $(nek_LDFLAGS) $(nek_FLIBS)
$(nek_case_f_obj): $(nek_objdir)/%.$(obj-suffix): $(GIRAFFE_EXAMPLE)/%.f $(GIRAFFE_EXAMPLE)/SIZE | $(nek_objdir)
@echo "Nek5000 Compiling Fortran (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile --quiet \
$(libmesh_F77) $(nek_FFLAGS) $(nek_real8_flags) -c $< -o $@
$(nek_drive_obj) $(nek_core_f_obj) $(nek_cmt_obj) $(nek_math_obj) $(nek_mxm_obj): $(nek_objdir)/%.$(obj-suffix): %.f SIZE | $(nek_objdir)
$(nek_drive_obj) $(nek_core_f_obj) $(nek_cmt_obj) $(nek_math_obj) $(nek_mxm_obj): $(nek_objdir)/%.$(obj-suffix): %.f $(GIRAFFE_EXAMPLE)/SIZE | $(nek_objdir)
@echo "Nek5000 Compiling Fortran (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile \
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile --quiet \
$(libmesh_F77) $(nek_FFLAGS) $(nek_real8_flags) -c $< -o $@
$(nek_mpi_obj) $(nek_neknek_obj): $(nek_objdir)/%.$(obj-suffix): %.f SIZE mpiheader | $(nek_objdir)
$(nek_mpi_obj) $(nek_neknek_obj): $(nek_objdir)/%.$(obj-suffix): %.f $(GIRAFFE_EXAMPLE)/SIZE mpiheader | $(nek_objdir)
@echo "Nek5000 Compiling Fortran (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile \
@$(libmesh_LIBTOOL) --tag=F77 $(LIBTOOLFLAGS) --mode=compile --quiet \
$(libmesh_F77) $(nek_FFLAGS) $(nek_real8_flags) -c $< -o $@
$(nek_core_c_obj): $(nek_objdir)/%.$(obj-suffix): %.c | $(nek_objdir)
@echo "Nek5000 Compiling C (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile \
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile --quiet \
$(libmesh_CC) $(nek_CPPFLAGS) $(nek_CFLAGS) -MMD -MP -MF $@.d -MT $@ -c $< -o $@
$(jl_core_obj) $(jl_interp_obj) $(jl_cgs_obj): $(nek_objdir)/$(jl_prefix)%.$(obj-suffix): %.c | $(nek_objdir)
@echo "Nek5000 Compiling C (in "$(METHOD)" mode) "$<"..."
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile \
@$(libmesh_LIBTOOL) --tag=CC $(LIBTOOLFLAGS) --mode=compile --quiet \
$(libmesh_CC) $(nek_CPPFLAGS) $(nek_CFLAGS) -MMD -MP -MF $@.d -MT $@ -c $< -o $@
mpiheader: | $(nek_includedir)
......
This diff is collapsed.
# This file contains common MOOSE application settings
# Note: MOOSE applications are assumed to reside in peer directories relative to MOOSE and its modules.
# This can be overridden by using the MOOSE_DIR environment variable
# list of application-wide excluded source files
excluded_srcfiles :=
#
# Save off parameters for possible app.mk recursion
#
STACK ?= stack
STACK := $(STACK).X
$APPLICATION_DIR$(STACK) := $(APPLICATION_DIR)
$APPLICATION_NAME$(STACK) := $(APPLICATION_NAME)
$DEPEND_MODULES$(STACK) := $(DEPEND_MODULES)
$BUILD_EXEC$(STACK) := $(BUILD_EXEC)
$DEP_APPS$(STACK) := $(DEP_APPS)
-include $(APPLICATION_DIR)/$(APPLICATION_NAME).mk
#
# Restore parameters
#
APPLICATION_DIR := $($APPLICATION_DIR$(STACK))
APPLICATION_NAME := $($APPLICATION_NAME$(STACK))
DEPEND_MODULES := $($DEPEND_MODULES$(STACK))
BUILD_EXEC := $($BUILD_EXEC$(STACK))
DEP_APPS := $($DEP_APPS$(STACK))
STACK := $(basename $(STACK))
##############################################################################
######################### Application Variables ##############################
##############################################################################
#
# source files
SRC_DIRS := $(APPLICATION_DIR)/src
PLUGIN_DIR := $(APPLICATION_DIR)/plugins
excluded_srcfiles += main.C
find_excludes := $(foreach i, $(excluded_srcfiles), -not -name $(i))
srcfiles := $(shell find $(SRC_DIRS) -name "*.C" $(find_excludes))
csrcfiles := $(shell find $(SRC_DIRS) -name "*.c")
fsrcfiles := $(shell find $(SRC_DIRS) -name "*.f")
f90srcfiles := $(shell find $(SRC_DIRS) -name "*.f90")
# object files
objects := $(patsubst %.C, %.$(obj-suffix), $(srcfiles))
cobjects := $(patsubst %.c, %.$(obj-suffix), $(csrcfiles))
fobjects := $(patsubst %.f, %.$(obj-suffix), $(fsrcfiles))
f90objects := $(patsubst %.f90, %.$(obj-suffix), $(f90srcfiles))
app_objects := $(objects) $(cobjects) $(fobjects) $(f90objects) $(ADDITIONAL_APP_OBJECTS)
# plugin files
plugfiles := $(shell find $(PLUGIN_DIR) -name "*.C" 2>/dev/null)
cplugfiles := $(shell find $(PLUGIN_DIR) -name "*.c" 2>/dev/null)
fplugfiles := $(shell find $(PLUGIN_DIR) -name "*.f" 2>/dev/null)
f90plugfiles:= $(shell find $(PLUGIN_DIR) -name "*.f90" 2>/dev/null)
# plugins
plugins := $(patsubst %.C, %-$(METHOD).plugin, $(plugfiles))
plugins += $(patsubst %.c, %-$(METHOD).plugin, $(cplugfiles))
plugins += $(patsubst %.f, %-$(METHOD).plugin, $(fplugfiles))
plugins += $(patsubst %.f90, %-$(METHOD).plugin, $(f90plugfiles))
# main
main_src := $(APPLICATION_DIR)/src/main.C # Main must be located here!
main_object := $(patsubst %.C, %.$(obj-suffix), $(main_src))
# dependency files
app_deps := $(patsubst %.C, %.$(obj-suffix).d, $(srcfiles)) \
$(patsubst %.c, %.$(obj-suffix).d, $(csrcfiles)) \
$(patsubst %.C, %.$(obj-suffix).d, $(main_src)) \
$(ADDITIONAL_APP_DEPS)
depend_dirs := $(foreach i, $(DEPEND_MODULES), $(MOOSE_DIR)/modules/$(i)/include)
depend_dirs += $(APPLICATION_DIR)/include
# header files
include_dirs := $(shell find $(depend_dirs) -type d | grep -v "\.svn")
app_INCLUDE := $(foreach i, $(include_dirs), -I$(i)) $(ADDITIONAL_INCLUDES)
# clang static analyzer files
app_analyzer := $(patsubst %.C, %.plist.$(obj-suffix), $(srcfiles))
# library
app_LIB := $(APPLICATION_DIR)/lib/lib$(APPLICATION_NAME)-$(METHOD).la
# application
app_EXEC := $(APPLICATION_DIR)/$(APPLICATION_NAME)-$(METHOD)
# revision header
CAMEL_CASE_NAME := $(shell echo $(APPLICATION_NAME) | perl -pe 's/(?:^|_)([a-z])/\u$$1/g')
app_BASE_DIR ?= base/
app_HEADER := $(APPLICATION_DIR)/include/$(app_BASE_DIR)$(CAMEL_CASE_NAME)Revision.h
# depend modules
depend_libs := $(foreach i, $(DEPEND_MODULES), $(MOOSE_DIR)/modules/$(i)/lib/lib$(i)-$(METHOD).la)
##################################################################################################
# If we are NOT building a module, then make sure the dependency libs are updated to reflect
# all real dependencies
##################################################################################################
ifeq (,$(findstring $(APPLICATION_NAME), $(MODULE_NAMES)))
depend_libs := $(depend_libs) $(app_LIBS)
endif
# Here we'll filter out MOOSE libs since we'll assume our application already has MOOSE compiled in
depend_libs := $(filter-out $(moose_LIBS),$(depend_libs))
# Create -L/-l versions of the depend libs
depend_libs_flags := $(foreach i, $(depend_libs), -L$(dir $(i)) -l$(shell echo $(notdir $(i)) | perl -pe 's/^lib(.*?)\.la/$$1/'))
# If building shared libs, make the plugins a dependency, otherwise don't.
ifeq ($(libmesh_shared),yes)
app_plugin_deps := $(plugins)
else
app_plugin_deps :=
endif
app_LIBS := $(app_LIB) $(app_LIBS)
app_LIBS_other := $(filter-out $(app_LIB),$(app_LIBS))
app_HEADERS := $(app_HEADER) $(app_HEADERS)
app_INCLUDES += $(app_INCLUDE)
app_DIRS += $(APPLICATION_DIR)
# WARNING: the += operator does NOT work here!
ADDITIONAL_CPPFLAGS := $(ADDITIONAL_CPPFLAGS) -D$(shell echo $(APPLICATION_NAME) | perl -pe 'y/a-z/A-Z/' | perl -pe 's/-//g')_ENABLED
# dependencies
-include $(app_deps)
# Rest the DEPEND_MODULES variable in case this file is sourced again
DEPEND_MODULES :=
###############################################################################
# Build Rules:
#
###############################################################################
ifeq ($(BUILD_EXEC),yes)
all:: $(app_EXEC)
endif
$(app_objects): $(app_HEADER)
# Target-specific Variable Values (See GNU-make manual)
$(app_HEADER): curr_dir := $(APPLICATION_DIR)
$(app_HEADER): curr_app := $(APPLICATION_NAME)
$(app_HEADER):
@echo "MOOSE Generating Header "$@"..."
$(shell $(FRAMEWORK_DIR)/scripts/get_repo_revision.py $(curr_dir) $@ $(curr_app))
# Target-specific Variable Values (See GNU-make manual)
$(app_LIB): curr_objs := $(app_objects)
$(app_LIB): curr_dir := $(APPLICATION_DIR)
$(app_LIB): curr_deps := $(depend_libs)
$(app_LIB): curr_libs := $(depend_libs_flags)
$(app_LIB): $(app_objects) $(app_plugin_deps) $(app_HEADER) $(depend_libs)
@echo "Linking Library "$@"..."
@$(libmesh_LIBTOOL) --tag=CXX $(LIBTOOLFLAGS) --mode=link --quiet \
$(libmesh_CXX) $(libmesh_CXXFLAGS) -o $@ $(curr_objs) $(libmesh_LDFLAGS) $(EXTERNAL_FLAGS) -rpath $(curr_dir)/lib $(curr_libs)
@$(libmesh_LIBTOOL) --mode=install --quiet install -c $@ $(curr_dir)/lib
$(app_EXEC): $(app_LIBS) $(mesh_library) $(main_object)
@echo "Linking Executable "$@"..."
@echo "$(libmesh_LIBTOOL) --tag=CXX $(LIBTOOLFLAGS) --mode=link --quiet $(libmesh_CXX) -Wl,-no_compact_unwind $(libmesh_CXXFLAGS) -o $@ $(main_object) $(nek_LIB) $(nek_OBJ) $(app_LIBS) $(libmesh_LIBS) $(libmesh_LDFLAGS) $(EXTERNAL_FLAGS) $(ADDITIONAL_LIBS)"
@$(libmesh_LIBTOOL) --tag=CXX $(LIBTOOLFLAGS) --mode=link --quiet $(libmesh_CXX) -Wl,-no_compact_unwind $(libmesh_CXXFLAGS) -o $@ $(main_object) $(nek_LIB) $(nek_OBJ) $(app_LIBS) $(libmesh_LIBS) $(libmesh_LDFLAGS) $(EXTERNAL_FLAGS) $(ADDITIONAL_LIBS)
# Clang static analyzer
sa:: $(app_analyzer)
#ifndef NEKINTERFACE_H
#define NEKINTERFACE_H
// String length for file paths in Nek5000
#define PATHLEN 132
// Nek Fortran interface
extern "C" {
// CFILES common block
extern struct {
char \
reafle[PATHLEN], \
fldfle[PATHLEN], \
dmpfle[PATHLEN], \
hisfle[PATHLEN], \
schfle[PATHLEN], \
orefle[PATHLEN], \
nrefle[PATHLEN];
} cfiles_;
// DIMN common block
extern struct {
int \
nelv, \
nelt, \
nx1, \
ny1, \
nz1, \
nx2, \
ny2, \
nz2, \
nx3, \
ny3, \
nz3, \
ndim, \
nfield,\
npert, \
nid, \
nxd, \
nyd, \
nzd;
} dimn_;
// DIMN common block
extern struct {
double flux_moose, temp_nek;
} test_passing_;
// subroutine nek_init(intracomm)
void nek_init_(int &);
}
#endif /* NEKINTERFACE_H */
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/
#ifndef ADDSLAVEFLUXVECTORACTION_H
#define ADDSLAVEFLUXVECTORACTION_H
#include "MooseObjectAction.h"
#include <string>
class AddSlaveFluxVectorAction : public Action
{
public:
AddSlaveFluxVectorAction(const InputParameters & params);
virtual void act();
};
template<>