Commit 1848802c authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Merge branch 'diffusion' of ssh://geraldine.fjfi.cvut.cz:2222/local/projects/tnl/tnl into diffusion

Conflicts:
	src/implementation/functions/tnlExpBumpFunction_impl.h
parents 382ad350 eb29b04a
Loading
Loading
Loading
Loading
+18 −7
Original line number Diff line number Diff line
@@ -5,26 +5,37 @@
			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.2134791445" moduleId="org.eclipse.cdt.core.settings" name="Default">
				<externalSettings/>
				<extensions>
					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
					<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
					<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
					<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
					<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
					<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
					<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
				</extensions>
			</storageModule>
			<storageModule moduleId="cdtBuildSystem" version="4.0.0">
				<configuration buildProperties="" id="cdt.managedbuild.toolchain.gnu.base.2134791445" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
				<configuration buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.2134791445" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
					<folderInfo id="cdt.managedbuild.toolchain.gnu.base.2134791445.1799170915" name="/" resourcePath="">
						<toolChain id="cdt.managedbuild.toolchain.gnu.base.1762402759" name="cdt.managedbuild.toolchain.gnu.base" superClass="cdt.managedbuild.toolchain.gnu.base">
							<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.840154721" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
							<builder id="cdt.managedbuild.target.gnu.builder.base.573876641" managedBuildOn="false" name="Gnu Make Builder.Default" superClass="cdt.managedbuild.target.gnu.builder.base"/>
							<builder id="cdt.managedbuild.target.gnu.builder.base.573876641" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
							<tool id="cdt.managedbuild.tool.gnu.archiver.base.958650307" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1237330740" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base"/>
							<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.315517693" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base"/>
							<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1237330740" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
								<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1856262209" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
							</tool>
							<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.315517693" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
								<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.950045328" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
							</tool>
							<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1786292703" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1133414639" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base"/>
							<tool id="cdt.managedbuild.tool.gnu.assembler.base.336757143" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base"/>
							<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1133414639" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
								<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.692614544" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
									<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
									<additionalInput kind="additionalinput" paths="$(LIBS)"/>
								</inputType>
							</tool>
							<tool id="cdt.managedbuild.tool.gnu.assembler.base.336757143" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
								<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1329383797" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
							</tool>
						</toolChain>
					</folderInfo>
				</configuration>
+6 −5
Original line number Diff line number Diff line
@@ -105,11 +105,11 @@ endif()
####
# Check for MPI
#
find_package( MPI )
if( MPI_CXX_FOUND )
    set( BUILD_MPI TRUE )
    message( "MPI headers found -- ${MPI_CXX_INCLUDE_PATH}")
endif()
#find_package( MPI )
#if( MPI_CXX_FOUND )
#    set( BUILD_MPI TRUE )
#    message( "MPI headers found -- ${MPI_CXX_INCLUDE_PATH}")
#endif()

####
# Check for some system header
@@ -227,6 +227,7 @@ INSTALL( FILES ${PROJECT_BUILD_PATH}/tnlConfig.h DESTINATION include/tnl-${tnlVe

#Nastavime cesty k hlavickovym souborum a knihovnam
INCLUDE_DIRECTORIES( src )
INCLUDE_DIRECTORIES( tests )
INCLUDE_DIRECTORIES( ${PROJECT_BUILD_PATH} )
LINK_DIRECTORIES( ${LIBRARY_OUTPUT_PATH} )

+14 −24
Original line number Diff line number Diff line
set( tnl_heat_equation_SOURCES
               tnlZeroRightHandSide_impl.h
               tnlZeroRightHandSide.h
               tnlTimeFunction_impl.h
               tnlTimeFunction.h
     tnlHeatEquationEocRhs.h
               tnlRightHandSide_impl.h
               tnlRightHandSide.h
               tnlNeumannBoundaryConditions_impl.h
               tnlNeumannBoundaryConditions.h
               tnlDirichletBoundaryConditions_impl.h
               tnlDirichletBoundaryConditions.h
               tnlAnalyticSolution_impl.h
               tnlAnalyticSolution.h
               main.cpp
               tnl-heat-equation.cpp
               tnl-heat-equation-eoc.cpp
               heatEquationSolver_impl.h
               heatEquationSolver.h
               heatEquationSetter_impl.h
               heatEquationSetter.h
               heatEquationConfig.h )
               heatEquationEocRhs.h )
               
ADD_EXECUTABLE(tnl-heat-equation${debugExt} ${tnl_heat_equation_SOURCES})
target_link_libraries (tnl-heat-equation${debugExt} tnl${debugExt}-${tnlVersion} )
#ADD_EXECUTABLE(tnl-heat-equation${debugExt} tnl-heat-equation.cpp)
#target_link_libraries (tnl-heat-equation${debugExt} tnl${debugExt}-${tnlVersion} )

INSTALL( TARGETS tnl-heat-equation${debugExt}
ADD_EXECUTABLE(tnl-heat-equation-eoc-test${debugExt} tnl-heat-equation-eoc.cpp)
target_link_libraries (tnl-heat-equation-eoc-test${debugExt} tnl${debugExt}-${tnlVersion} )

INSTALL( TARGETS #tnl-heat-equation${debugExt}
                 tnl-heat-equation-eoc-test${debugExt}
         RUNTIME DESTINATION bin
         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE )
        
INSTALL( FILES #Makefile
               run-init-mesh
               run-heat-equation-testy-laplace-konvergence
               run-heat-equation-testy-konvergence
               run-heat-equation
               heat-equation.cfg.desc
					debugging_parameters
					EOCtest
					EOCtest-adaptivity-cycle

INSTALL( FILES tnl-run-heat-equation-eoc-test
               tnl-run-heat-equation
         DESTINATION share/tnl-${tnlVersion}/examples/heat-equation )

examples/heat-equation/EOCtest

deleted100755 → 0
+0 −185
Original line number Diff line number Diff line
#!/bin/bash

LD_LIBRARY_PATH=/home/szekely/local/lib
export LD_LIBRARY_PATH

dimension=2
proportions=1
initDofSize=8
analyticFunction="sin-wave"
timeFunction="cosinus"
snapshotPeriod=0.05
finalTime=1
mersonAdaptivity=1.0e-5
numberOfIterations=8
#{8..1024dofs}
scale=2
origin=0

amplitude=1.0
waveLength=1.0
waveLengthX=1.0
waveLengthY=1.0
waveLengthZ=1.0
wavesNumber=0.0
wavesNumberX=0.0
wavesNumberY=0.0
wavesNumberZ=0.0
phase=0.0
phaseX=0.0
phaseY=0.0
phaseZ=0.0
sigma=1.0

dofs=${initDofSize}

for ((i=1;i<=${numberOfIterations};i++))
do

tnl-grid-setup --dimensions ${dimension} \
               --proportions-x ${proportions} \
               --proportions-y ${proportions} \
               --proportions-z ${proportions} \
               --origin-x ${origin} \
               --origin-y ${origin} \
               --origin-z ${origin} \
               --size-x ${dofs} \
               --size-y ${dofs} \
               --size-z ${dofs} \

tnl-discrete --mesh mesh.tnl \
             --function ${analyticFunction} \
             --output-file u-ini.tnl \
             --amplitude ${amplitude} \
             --wave-length ${waveLength} \
             --wave-length-x ${waveLengthX} \
             --wave-length-y ${waveLengthY} \
             --wave-length-z ${waveLengthZ} \
             --waves-number ${wavesNumber} \
             --waves-number-x ${wavesNumberX} \
             --waves-number-y ${wavesNumberY} \
             --waves-number-z ${wavesNumberZ} \
             --phase ${phase} \
             --phase-x ${phaseX} \
             --phase-y ${phaseY} \
             --phase-z ${phaseZ} \
             --sigma ${sigma} \

./heat-equation_AV --dimensions ${dimension} \
                --time-discretisation explicit \
                --discrete-solver merson \
		--merson-adaptivity ${mersonAdaptivity}\
                --time-function ${timeFunction}\
                --analytic-space-function ${analyticFunction}\
                --amplitude ${amplitude} \
                --wave-length ${waveLength} \
                --wave-length-x ${waveLengthX} \
                --wave-length-y ${waveLengthY} \
                --wave-length-z ${waveLengthZ} \
                --waves-number ${wavesNumber} \
                --waves-number-x ${wavesNumberX} \
                --waves-number-y ${wavesNumberY} \
                --waves-number-z ${wavesNumberZ} \
                --phase ${phase} \
                --phase-x ${phaseX} \
                --phase-y ${phaseY} \
                --phase-z ${phaseZ} \
                --sigma ${sigma} \
                --sigma ${sigma} \
                --snapshot-period ${snapshotPeriod} \
                --final-time ${finalTime} \
                --solution-convergence-test 1 \

rm u-ini.tnl

tnl-diff --mesh mesh.tnl \
         --input-files numericalSolution-*.tnl analyticSolution-*.tnl \
         --mode halves \
         --output-file ${dofs} \

rm *.tnl

dofs=$((${scale} * $dofs))

done

file="EOC-${analyticFunction}-${timeFunction}-${dimension}D-${finalTime}T-adaptivity${mersonAdaptivity}"

rm ${file}
echo -e "#\tL1 diff.\t\tEOC\t\tL2 diff.\t\tEOC\t\tLmax diff.\t\tEOC" >> ${file}

echo -e -n "${initDofSize}\t" >> ${file}
nactenyRadek=$( tail -1 ${initDofSize})
for zaznam  in ${nactenyRadek}
do

hodnota=$(echo $zaznam | sed 's/e/\*10\^/' | bc -l)
if [[ ${hodnota} =~ ^\. ]]; then
echo -e -n "0${hodnota}\t\t   \t\t" >> ${file}
else
echo -e -n "${hodnota}\t\t   \t\t" >> ${file}
fi

done
echo -e -n "\n" >> ${file}


${radek} >>  ${file}

soubor1=$((${initDofSize}/${scale}))
soubor2=${initDofSize}

for ((i=1;i<${numberOfIterations};i++))
do

soubor1=$((2 * $soubor1))
soubor2=$((2 * $soubor2))

IFS=' ' read -a posledniRadek1 <<< $(tail -1 $soubor1)
IFS=' ' read -a posledniRadek2 <<< $(tail -1 $soubor2)
#{pres specialni promenou IFS utvorime pole z retezce}

echo -e -n "${soubor2}\t" >> ${file}

for j in {0..2}
do

echo -e -n "${posledniRadek2[j]}\t\t" >> ${file}

prevedenyVyraz=$(echo "l((${posledniRadek2[$j]})/(${posledniRadek1[$j]}))/l(0.5)" | sed 's/e/\*10\^/g')
hodnota=$(echo "${prevedenyVyraz}" | bc -l)
hodnota=$(echo "scale=3; ${hodnota}/1" | bc)
#hodnota =$(echo "${prevedenyVyraz}" | bc -l)
#{g v retezci aby nahradilo vsechny vyskyty v souboru}
if [[ ${hodnota} =~ ^\. ]]; then
echo -e -n "0${hodnota}\t\t" >> ${file}
else
if [[ ${hodnota} =~ ^\-\. ]]; then
pom=$(echo "${hodnota}" | sed 's/-\./-0\./')
echo -e -n "${pom}\t\t" >> ${file}
else
echo -e -n "${hodnota}\t\t" >> ${file}
fi
fi

done

echo -e -n "\n" >> ${file}

done

echo -e -n "\n\n\n" >> ${file}

echo -e "PARAMETERS:\n" >> ${file}
echo -e " dimensions = ${dimension}\n proportions = ${proportions}\n analytic function = ${analyticFunction}\n time function = ${timeFunction}\n snapshot period = ${snapshotPeriod}\n final time = ${finalTime}\n adaptivity = ${mersonAdaptivity}\n origin = ${origin}\n\n" >> ${file}
echo -e " amplitude = ${amplitude}\n wave length = ${waveLength}\n wave length x = ${waveLengthX}\n wave length y = ${waveLengthY}\n wave length z = ${waveLengthZ=1.0}\n wave number = ${wavesNumber}\n waves number x = ${wavesNumberX}\n waves number y = ${wavesNumberY}\n waves number z = ${wavesNumberZ}\n phase = ${phase}\n phase x = ${phaseX}\n phase y = ${phaseY}\n phase z = ${phaseZ}\n sigma = ${sigma}" >> ${file}


soubor=$((${initDofSize}/${scale}))
for ((i=1;i<=${numberOfIterations};i++))
do

soubor=$((${soubor}*${scale}))
rm ${soubor}

done 
+0 −194
Original line number Diff line number Diff line
#!/bin/bash

LD_LIBRARY_PATH=/home/szekely/local/lib
export LD_LIBRARY_PATH

dimension=2
proportions=1
initDofSize=8
analyticFunction="exp-bump"
timeFunction="cosinus"
snapshotPeriod=0.01
finalTime=0.1
initMersonAdaptivity=1.0e-7
numberOfAdaptivityIter=2
adaptivityDiff=100
numberOfIterations=8
#{8..1024dofs}
scale=2
origin=0

amplitude=1.0
waveLength=1.0
waveLengthX=1.0
waveLengthY=1.0
waveLengthZ=1.0
wavesNumber=0.0
wavesNumberX=0.0
wavesNumberY=0.0
wavesNumberZ=0.0
phase=0.0
phaseX=0.0
phaseY=0.0
phaseZ=0.0
sigma=1.0

dofs=${initDofSize}
mersonAdaptivity=${initMersonAdaptivity}

for ((k=1;k<=${numberOfAdaptivityIter};k++))
do
for ((i=1;i<=${numberOfIterations};i++))
do

tnl-grid-setup --dimensions ${dimension} \
               --proportions-x ${proportions} \
               --proportions-y ${proportions} \
               --proportions-z ${proportions} \
               --origin-x ${origin} \
               --origin-y ${origin} \
               --origin-z ${origin} \
               --size-x ${dofs} \
               --size-y ${dofs} \
               --size-z ${dofs} \

tnl-discrete --mesh mesh.tnl \
             --function ${analyticFunction} \
             --output-file u-ini.tnl \
             --amplitude ${amplitude} \
             --wave-length ${waveLength} \
             --wave-length-x ${waveLengthX} \
             --wave-length-y ${waveLengthY} \
             --wave-length-z ${waveLengthZ} \
             --waves-number ${wavesNumber} \
             --waves-number-x ${wavesNumberX} \
             --waves-number-y ${wavesNumberY} \
             --waves-number-z ${wavesNumberZ} \
             --phase ${phase} \
             --phase-x ${phaseX} \
             --phase-y ${phaseY} \
             --phase-z ${phaseZ} \
             --sigma ${sigma} \

./heat-equation_AV --dimensions ${dimension} \
                --time-discretisation explicit \
                --discrete-solver merson \
		--merson-adaptivity ${mersonAdaptivity}\
                --time-function ${timeFunction}\
                --analytic-space-function ${analyticFunction}\
                --amplitude ${amplitude} \
                --wave-length ${waveLength} \
                --wave-length-x ${waveLengthX} \
                --wave-length-y ${waveLengthY} \
                --wave-length-z ${waveLengthZ} \
                --waves-number ${wavesNumber} \
                --waves-number-x ${wavesNumberX} \
                --waves-number-y ${wavesNumberY} \
                --waves-number-z ${wavesNumberZ} \
                --phase ${phase} \
                --phase-x ${phaseX} \
                --phase-y ${phaseY} \
                --phase-z ${phaseZ} \
                --sigma ${sigma} \
                --sigma ${sigma} \
                --snapshot-period ${snapshotPeriod} \
                --final-time ${finalTime} \
                --solution-convergence-test 1 \

rm u-ini.tnl

tnl-diff --mesh mesh.tnl \
         --input-files numericalSolution-*.tnl analyticSolution-*.tnl \
         --mode halves \
         --output-file ${dofs} \

rm *.tnl

dofs=$((${scale} * $dofs))

done

file="EOC-${analyticFunction}-${timeFunction}-${dimension}D-${finalTime}T-adaptivity${mersonAdaptivity}"

rm ${file}
echo -e "#\tL1 diff.\t\tEOC\t\tL2 diff.\t\tEOC\t\tLmax diff.\t\tEOC" >> ${file}

echo -e -n "${initDofSize}\t" >> ${file}
nactenyRadek=$( tail -1 ${initDofSize})
for zaznam  in ${nactenyRadek}
do

hodnota=$(echo $zaznam | sed 's/e/\*10\^/' | bc -l)
if [[ ${hodnota} =~ ^\. ]]; then
echo -e -n "0${hodnota}\t\t   \t\t" >> ${file}
else
echo -e -n "${hodnota}\t\t   \t\t" >> ${file}
fi

done
echo -e -n "\n" >> ${file}


${radek} >>  ${file}

soubor1=$((${initDofSize}/${scale}))
soubor2=${initDofSize}

for ((i=1;i<${numberOfIterations};i++))
do

soubor1=$((2 * $soubor1))
soubor2=$((2 * $soubor2))

IFS=' ' read -a posledniRadek1 <<< $(tail -1 $soubor1)
IFS=' ' read -a posledniRadek2 <<< $(tail -1 $soubor2)
#{pres specialni promenou IFS utvorime pole z retezce}

echo -e -n "${soubor2}\t" >> ${file}

for j in {0..2}
do

echo -e -n "${posledniRadek2[j]}\t\t" >> ${file}

prevedenyVyraz=$(echo "l((${posledniRadek2[$j]})/(${posledniRadek1[$j]}))/l(0.5)" | sed 's/e/\*10\^/g')
hodnota=$(echo "${prevedenyVyraz}" | bc -l)
hodnota=$(echo "scale=3; ${hodnota}/1" | bc)
#hodnota =$(echo "${prevedenyVyraz}" | bc -l)
#{g v retezci aby nahradilo vsechny vyskyty v souboru}
if [[ ${hodnota} =~ ^\. ]]; then
echo -e -n "0${hodnota}\t\t" >> ${file}
else
if [[ ${hodnota} =~ ^\-\. ]]; then
pom=$(echo "${hodnota}" | sed 's/-\./-0\./')
echo -e -n "${pom}\t\t" >> ${file}
else
echo -e -n "${hodnota}\t\t" >> ${file}
fi
fi

done

echo -e -n "\n" >> ${file}

done

echo -e -n "\n\n\n" >> ${file}

echo -e "PARAMETERS:\n" >> ${file}
echo -e " dimensions = ${dimension}\n proportions = ${proportions}\n analytic function = ${analyticFunction}\n time function = ${timeFunction}\n snapshot period = ${snapshotPeriod}\n final time = ${finalTime}\n adaptivity = ${mersonAdaptivity}\n origin = ${origin}\n\n" >> ${file}
echo -e " amplitude = ${amplitude}\n wave length = ${waveLength}\n wave length x = ${waveLengthX}\n wave length y = ${waveLengthY}\n wave length z = ${waveLengthZ=1.0}\n wave number = ${wavesNumber}\n waves number x = ${wavesNumberX}\n waves number y = ${wavesNumberY}\n waves number z = ${wavesNumberZ}\n phase = ${phase}\n phase x = ${phaseX}\n phase y = ${phaseY}\n phase z = ${phaseZ}\n sigma = ${sigma}" >> ${file}


soubor=$((${initDofSize}/${scale}))
for ((i=1;i<=${numberOfIterations};i++))
do

soubor=$((${soubor}*${scale}))
rm ${soubor}

done 

mersonAdaptivity=$(echo "(${mersonAdaptivity})/(${adaptivityDiff})" | sed 's/e/\*10\^/g' | bc -l)

done
Loading