Commit d71d23a3 authored by Matthew Ellis's avatar Matthew Ellis

Merge remote-tracking branch 'origin/develop' into poly_expansion_methods

parents a3b3f4dd 72fb8269
......@@ -141,3 +141,8 @@ include/base/*Revision.h
# phase_field/tests/solution_rasterizer
out.xyz
# Nek5000 run files
*.sch
SESSION.NAME
nek5000
......@@ -3,7 +3,7 @@
###############################################################################
#
# Optional Environment variables
# MOOSE_DIR - Root directory of the MOOSE project
# MOOSE_DIR - Root directory of the MOOSE project
#
###############################################################################
# Use the MOOSE submodule if it exists and MOOSE_DIR is not set
......@@ -20,14 +20,20 @@ include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk
################################## MODULES ####################################
ALL_MODULES := yes
include $(MOOSE_DIR)/modules/modules.mk
SOLID_MECHANICS := yes
CONTACT := yes
HEAT_CONDUCTION := yes
WATER_STEAM_EOS := yes
MISC := yes
PHASE_FIELD := yes
XFEM := yes
include $(MOOSE_DIR)/modules/modules.mk
###############################################################################
# dep apps
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := MOON
BUILD_EXEC := yes
APPLICATION_NAME := moon
APP_REV_HEADER := $(CURDIR)/include/base/MoonRevision.h
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include $(FRAMEWORK_DIR)/app.mk
......
......@@ -3,16 +3,16 @@
# (c) 2008,2009,2010 UCHICAGO ARGONNE, LLC
# source path
SOURCE_ROOT="$HOME/Nek5000"
SOURCE_ROOT=$(dirname $(dirname $(pwd)))/Nek5000
SOURCE_ROOT_CORE="$SOURCE_ROOT/core"
SOURCE_ROOT_JL="$SOURCE_ROOT/jl"
SOURCE_ROOT_CMT="$SOURCE_ROOT/core/cmt"
# Fortran compiler
F77="mpif77"
F77="mpif77 -Wa,-q -Wl,-no_compact_unwind"
# C compiler
CC="mpicc"
CC="mpicc -Wl,-no_compact_unwind"
# pre-processor symbol list
# (set PPLIST=? to get a list of available symbols)
......@@ -88,5 +88,5 @@ fi
# do some checks and create makefile
source $SOURCE_ROOT_CORE/makenek.inc
# compile
make -j4 -f makefile 2>&1 | tee compiler.out
make -j4 -f makefile.nek nek5000 lib 2>&1 | tee compiler.out
exit 0
......@@ -414,8 +414,8 @@ if [ "$USR_LIB" != "" ]; then
fi
# tweak makefile template
echo "generating makefile ..."
rm -rf makefile 2>/dev/null
echo "generating makefile.nek ..."
rm -rf makefile.nek 2>/dev/null
sed -e "s:^F77[ ]*=.*:F77\:=$F77:" \
-e "s:^CC[ ]*=.*:CC\:=$CC:" \
......@@ -479,7 +479,7 @@ if [ "$IFVISIT" == "true" -o "$IFVISIT" == "yes" ]; then
fi
if [ "$USR" != "" ]; then
echo "###########################################################" >> makefile
echo "###########################################################" >> makefile.nek
echo "include makefile_usr.inc" >> .makefile
fi
......@@ -487,7 +487,7 @@ if [ -f .makefile ]; then
sed -e "1i\\
### makefile automatically created by makenek `date +"%m/%d/%Y %T"` ###" \
-e "s:^CASEDIR[ ]*=.*:CASEDIR\:=${CASEDIR}:" \
-e "s:^CASENAME[ ]*=.*:CASENAME\:=${CASENAME}:" .makefile > makefile
-e "s:^CASENAME[ ]*=.*:CASENAME\:=${CASENAME}:" .makefile > makefile.nek
else
echo "ERROR: Nek Makefile could not be created!"
exit 1
......
This diff is collapsed.
# Assume that NEK_DIR and NEK_CASENAME are defined by parent Makefile
$(NEK_OBJ): run_makenek
#all:: $(NEK_OBJ) $(NEK_LIB) SESSION.NAME
run_makenek:
$(NEK_SOURCE_DIR)/core/makenek $(NEK_CASENAME) $(NEK_SOURCE_DIR)
SESSION.NAME:
echo $(NEK_CASENAME) > SESSION.NAME && echo $(NEK_CASE_DIR) >> SESSION.NAME
.PHONY: run_makenek
$(NEK_LIB): run_makenek
make lib
# This test solves a 1D transient heat equation
# The error is caclulated by comparing to the analytical solution
# The problem setup and analytical solution are taken from "Advanced Engineering
# Mathematics, 10th edition" by Erwin Kreyszig.
# http://www.amazon.com/Advanced-Engineering-Mathematics-Erwin-Kreyszig/dp/0470458364
# It is Example 1 in section 12.6 on page 561
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
xmax = 80
ymax = 80
[]
[Variables]
[./T]
[../]
[]
[Kernels]
[./HeatSource]
type = HeatSource
function = '100*sin(3.14159*x/80)*sin(3.14159*y/80)'
variable = T
[../]
[./HeatDiff]
type = HeatConduction
variable = T
[../]
[./HeatTdot]
type = HeatConductionTimeDerivative
variable = T
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = T
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = T
boundary = right
value = 0
[../]
[./top]
type = DirichletBC
variable = T
boundary = top
value = 0
[../]
[./bottom]
type = DirichletBC
variable = T
boundary = bottom
value = 0
[../]
[]
[Materials]
[./k]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity'
prop_values = '0.95' #copper in cal/(cm sec C)
block = 0
[../]
[./cp]
type = GenericConstantMaterial
prop_names = 'specific_heat'
prop_values = '0.092' #copper in cal/(g C)
block = 0
[../]
[./rho]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = '8.92' #copper in g/(cm^3)
block = 0
[../]
[]
[Postprocessors]
[./error]
type = NodalL2Error
function = '100*sin(3.14159*x/80)*exp(-0.95/(0.092*8.92)*3.14159^2/80^2*t)' #T(x,t) = 100sin(pix/L)exp(-rho/(cp k) pi^2/L^2 t)
variable = T
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
nl_rel_tol = 1e-12
l_tol = 1e-6
dt = 2
end_time = 100
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
print_perf_log = true
[]
# This test solves a 1D transient heat equation
# The error is caclulated by comparing to the analytical solution
# The problem setup and analytical solution are taken from "Advanced Engineering
# Mathematics, 10th edition" by Erwin Kreyszig.
# http://www.amazon.com/Advanced-Engineering-Mathematics-Erwin-Kreyszig/dp/0470458364
# It is Example 1 in section 12.6 on page 561
[Mesh]
type = GeneratedMesh
dim = 2
nx = 40
ny = 40
xmax = 80
ymax = 80
[]
[Variables]
[./T]
[../]
[]
[Kernels]
[./HeatSource]
type = HeatSource
function = '100*sin(3.14159*x/80)*sin(3.14159*y/80)'
variable = T
[../]
[./HeatDiff]
type = HeatConduction
variable = T
[../]
[./HeatTdot]
type = HeatConductionTimeDerivative
variable = T
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = T
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = T
boundary = right
value = 0
[../]
[./top]
type = DirichletBC
variable = T
boundary = top
value = 0
[../]
[./bottom]
type = DirichletBC
variable = T
boundary = bottom
value = 0
[../]
[]
[Materials]
[./k]
type = GenericConstantMaterial
prop_names = 'thermal_conductivity'
prop_values = '0.95' #copper in cal/(cm sec C)
block = 0
[../]
[./cp]
type = GenericConstantMaterial
prop_names = 'specific_heat'
prop_values = '0.092' #copper in cal/(g C)
block = 0
[../]
[./rho]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = '8.92' #copper in g/(cm^3)
block = 0
[../]
[]
[Postprocessors]
[./error]
type = NodalL2Error
function = '100*sin(3.14159*x/80)*exp(-0.95/(0.092*8.92)*3.14159^2/80^2*t)' #T(x,t) = 100sin(pix/L)exp(-rho/(cp k) pi^2/L^2 t)
variable = T
[../]
[]
[Executioner]
type = NekExecutioner
scheme = bdf2
nl_rel_tol = 1e-12
l_tol = 1e-6
dt = 2
end_time = 100
num_steps = 10
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[./TimeStepper]
type = NekTimeStepper
[../]
[]
[Outputs]
exodus = true
print_perf_log = true
[]
......@@ -8,35 +8,48 @@
#
###############################################################################
EXAMPLE_DIR ?= $(shell dirname `pwd`)
MOOSE_DIR ?= $(shell dirname $(EXAMPLE_DIR))/src/moose
MOON_DIR ?= $(shell dirname $(EXAMPLE_DIR))
MOOSE_DIR ?= $(MOON_DIR)/moose
FRAMEWORK_DIR ?= $(MOOSE_DIR)/framework
###############################################################################
TEST := test_ignore
# framework
include $(FRAMEWORK_DIR)/build.mk
include $(FRAMEWORK_DIR)/moose.mk
APPLICATION_NAME := ex01
################################## MODULES ####################################
SOLID_MECHANICS := yes
CONTACT := yes
HEAT_CONDUCTION := yes
WATER_STEAM_EOS := yes
MISC := yes
PHASE_FIELD := yes
XFEM := yes
include $(MOOSE_DIR)/modules/modules.mk
###############################################################################
# dep apps
APPLICATION_DIR := $(shell pwd)/../../
APPLICATION_NAME := ex01
BUILD_EXEC := yes
# nek
NEK_SOURCE_DIR := $(MOON_DIR)/Nek5000
NEK_CASE_DIR := $(CURDIR)
NEK_CASENAME := $(shell basename $(NEK_CASE_DIR))
NEK_OBJ := obj/$(NEK_CASENAME).o
NEK_LIB := $(NEK_CASE_DIR)/libnek5000.a
include $(NEK_SOURCE_DIR)/nek.mk
# moon
APPLICATION_DIR := $(MOON_DIR)
APPLICATION_NAME := moon
DEP_APPS := $(shell $(FRAMEWORK_DIR)/scripts/find_dep_apps.py $(APPLICATION_NAME))
include nek.mk
ADDITIONAL_LIBS := $(nek_LIB) $(nek_OBJ)
include app.mk
include $(FRAMEWORK_DIR)/app.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)
# case
APPLICATION_DIR := $(CURDIR)
APPLICATION_NAME := $(shell basename $(APPLICATION_DIR))
MAIN_DIR := $(MOON_DIR)/src
BUILD_EXEC := yes
EXTERNAL_FLAGS := $(NEK_OBJ) $(NEK_LIB) -Wl,-no_compact_unwind
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
test: all
$(call TEST_exodiff,ex01.i,ex01_out.e)
C Dimension file to be included
C
C HCUBE array dimensions
C
parameter (ldim=3)
parameter (lx1=5,ly1=lx1,lz1=lx1,lelt=480,lelv=lelt)
parameter (lxd=8,lyd=lxd,lzd=lxd)
parameter (lelx=1,lely=1,lelz=1)
parameter (lzl=3 + 2*(ldim-3))
parameter (lx2=lx1-2)
parameter (ly2=ly1-2)
parameter (lz2=lz1-2)
parameter (lx3=lx1)
parameter (ly3=ly1)
parameter (lz3=lz1)
parameter (lp = 32)
parameter (lelg = 500)
c
c parameter (lpelv=lelv,lpelt=lelt,lpert=3) ! perturbation
c parameter (lpx1=lx1,lpy1=ly1,lpz1=lz1) ! array sizes
c parameter (lpx2=lx2,lpy2=ly2,lpz2=lz2)
c
parameter (lpelv=1,lpelt=1,lpert=1) ! perturbation
parameter (lpx1=1,lpy1=1,lpz1=1) ! array sizes
parameter (lpx2=1,lpy2=1,lpz2=1)
c
c parameter (lbelv=lelv,lbelt=lelt) ! MHD
c parameter (lbx1=lx1,lby1=ly1,lbz1=lz1) ! array sizes
c parameter (lbx2=lx2,lby2=ly2,lbz2=lz2)
c
parameter (lbelv=1,lbelt=1) ! MHD
parameter (lbx1=1,lby1=1,lbz1=1) ! array sizes
parameter (lbx2=1,lby2=1,lbz2=1)
C LX1M=LX1 when there are moving meshes; =1 otherwise
parameter (lx1m=lx1,ly1m=ly1,lz1m=lz1)
parameter (ldimt= 4) ! 3 passive scalars + T
parameter (ldimt1=ldimt+1)
parameter (ldimt3=ldimt+3)
c
c Note: In the new code, LELGEC should be about sqrt(LELG)
c
PARAMETER (LELGEC = 1)
PARAMETER (LXYZ2 = 1)
PARAMETER (LXZ21 = 1)
PARAMETER (LMAXV=LX1*LY1*LZ1*LELV)
PARAMETER (LMAXT=LX1*LY1*LZ1*LELT)
PARAMETER (LMAXP=LX2*LY2*LZ2*LELV)
PARAMETER (LXZ=LX1*LZ1)
PARAMETER (LORDER=3)
PARAMETER (MAXOBJ=4,MAXMBR=LELT*6)
PARAMETER (lhis=100) ! # of pts a proc reads from hpts.in
! Note: lhis*np > npoints in hpts.in
C
C Common Block Dimensions
C
PARAMETER (LCTMP0 =2*LX1*LY1*LZ1*LELT)
PARAMETER (LCTMP1 =4*LX1*LY1*LZ1*LELT)
C
C The parameter LVEC controls whether an additional 42 field arrays
C are required for Steady State Solutions. If you are not using
C Steady State, it is recommended that LVEC=1.
C
PARAMETER (LVEC=1)
C
C Uzawa projection array dimensions
C
parameter (mxprev = 40)
parameter (lgmres = 40)
C
C Split projection array dimensions
C
parameter(lmvec = 1)
parameter(lsvec = 1)
parameter(lstore=lmvec*lsvec)
c
c NONCONFORMING STUFF
c
parameter (maxmor = lelt)
C
C Array dimensions
C
COMMON/DIMN/NELV,NELT,NX1,NY1,NZ1,NX2,NY2,NZ2
$,NX3,NY3,NZ3,NDIM,NFIELD,NPERT,NID
$,NXD,NYD,NZD
c automatically added by makenek
parameter(lxo = lx1) ! max output grid size (lxo>=lx1)
c automatically added by makenek
parameter(lpart = 62000) ! max number of particles
c automatically added by makenek
integer ax1,ay1,az1,ax2,ay2,az2
parameter (ax1=1,ay1=1,az1=1,ax2=1,ay2=1,az2=1) ! running averages
c automatically added by makenek
parameter (lxs=1,lys=lxs,lzs=(lxs-1)*(ldim-2)+1) !New Pressure Preconditioner
c automatically added by makenek
parameter (lfdm=0) ! == 1 for fast diagonalization method
c automatically added by makenek
common/IOFLAG/nio ! for logfile verbosity control
c automatically added by makenek
integer toteq
parameter(toteq = 1 ) ! Number of conserved variables
c IFCMT=FALSE then toteq=1
c automatically added by makenek
integer lelcmt
parameter(lelcmt = 1 ) ! # of cmt elements
c IFCMT=FALSE then lelcmt=1
#k!/usr/bin/env bash
NEK_CASENAME="$(basename $(pwd))"
NEK_SOURCE_DIR="$(dirname $(dirname $(pwd)))/Nek5000"
# MOOSE issues a warning if these directories do not exist.
# Creating these dirs will suppress that warning
mkdir -p src
mkdir -p include/base
SCH_FILE="$NEK_CASENAME.sch"
if [ -e $SCH_FILE ]; then
echo "Deleting $SCH_FILE..."
rm -f $SCH_FILE
fi
echo "Creating SESSON.NAME..."
echo "$NEK_CASENAME" > SESSION.NAME && pwd >> SESSION.NAME
echo "Building Nek5000 objects..."
$NEK_SOURCE_DIR/core/makenek $NEK_CASENAME $NEK_SOURCE_DIR
echo "Building libNek5000.a..."
make -f makefile.nek lib
echo "Building MOON driver..."
make
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
# Preconditioned JFNK (default)
type = Transient
num_steps = 20
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# picard_max_its = 30
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./sub]
type = TransientMultiApp
app_type = MoonApp
positions = '0 0 0'
input_files = picard_sub.i
[../]
[]
[Transfers]
[./u_to_sub]
type = MultiAppNearestNodeTransfer
direction = to_multiapp
multi_app = sub
source_variable = u
variable = aux
[../]
[./u_from_sub]
type = MultiAppNearestNodeTransfer
direction = from_multiapp
multi_app = sub
source_variable = u
variable = aux
[../]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./aux]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = TimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
# Preconditioned JFNK (default)
type = Transient
num_steps = 20
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
# picard_max_its = 30
nl_abs_tol = 1e-14
[]
[Outputs]
exodus = true
[]
[MultiApps]
[./sub]
type = TransientMultiApp
app_type = MoonApp
sub_cycling = true
positions = '0 0 0'
input_files = picard_sub_subcycling.i
[../]
[]
[Transfers]