Commit 3680384f by sfritschi

### Modified test to show flux balance statistics

parent 30c36012
 ... ... @@ -30,7 +30,7 @@ PetscErrorCode solve(const PetscScalar *data, const PetscInt *col_indices, PetscMPIInt size, rank; ierr = MPI_Comm_size(PETSC_COMM_WORLD, &size); CHKERRMPI(ierr); ierr = MPI_Comm_rank(PETSC_COMM_WORLD, &rank); CHKERRMPI(ierr); // Calculate local size n_local directly for ALL ranks PetscInt n_local = n_rows / size; const PetscInt remainder = n_rows % size; ... ...
 ... ... @@ -6,10 +6,28 @@ sys.path.append("../") from netflow import * from math import sqrt import numpy as np import matplotlib.pyplot as plt comm = MPI.COMM_WORLD rank = comm.Get_rank() root = 0 def aggregate_flux(p, Q): Qb = netflow.flux_balance(p, Q) flux_mean = 0.; flux_max = 0. # Compute flux balance statistics for _, balance in Qb.items(): flux_current = abs(balance[2]) if flux_current > flux_max: flux_max = flux_current flux_mean += flux_current flux_mean /= len(Qb) return (flux_mean, flux_max) def main(): basenet = None inpores = set() ... ... @@ -28,39 +46,34 @@ def main(): len(inpores), \ len(outpores))) pressuresP, fluxesP = netflow.solve_flow_inout(network=basenet, pin=1e4, \ pout=0.0, inpores=inpores, outpores=outpores, \ solver=netflow.Solver.PETSC, mu=1e-3) pressuresA, fluxesA = netflow.solve_flow_inout(network=basenet, pin=1e4, \ pout=0.0, inpores=inpores, outpores=outpores, \ solver=netflow.Solver.AMG, mu=1e-3) # Compute solution for each solver and compare flux balances mean_fluxes = {} max_fluxes = {} for solver in netflow.Solver: p, Q = netflow.solve_flow_inout(network=basenet, pin=1e4, \ pout=0.0, inpores=inpores, outpores=outpores, \ solver=solver, mu=1e-3) if rank == root: flux_mean, flux_max = aggregate_flux(p, Q) mean_fluxes[solver.name] = flux_mean max_fluxes[solver.name] = flux_max # Post-processing on root only if (rank == root): # Compare resulting pressures: difference = 0. for poreP, valP in pressuresP.items(): for poreA, valA in pressuresA.items(): if (poreP.id == poreA.id): difference += (valP - valA)**2 difference = sqrt(difference / len(pressuresP)) print("RMSE in pore pressures: %e" % difference) labels = list(mean_fluxes.keys()) colors = ['b', 'r', 'g', 'orange'] heights = list(mean_fluxes.values()) Qb = netflow.flux_balance(pressuresP, fluxesP) flux_mean = 0.; flux_max = 0. # Compute flux balance statistics for _, balance in Qb.items(): flux_current = abs(balance[2]) if flux_current > flux_max: flux_max = flux_current flux_mean += flux_current flux_mean /= len(Qb) x = np.arange(len(mean_fluxes)) print("Flux balance statistics Petsc:") print("Mean: %e, Max: %e" % (flux_mean, flux_max)) plt.figure() plt.title(r"Comparison of Flux Balance Statistics of Solvers") plt.xlabel(r"Solver employed") plt.ylabel(r"Mean total pore flux in $[m^3s^{-1}]$") plt.bar(x, heights, tick_label=labels, color=colors) plt.show() plt.close() if __name__ == '__main__': main()

24.9 KB

 ... ... @@ -20,3 +20,5 @@ \abx@aux@defaultrefcontext{0}{MEYER2021103936}{none/global//global/global} \abx@aux@defaultrefcontext{0}{petsc-web-page}{none/global//global/global} \abx@aux@defaultrefcontext{0}{hypre-web-page}{none/global//global/global} \@writefile{lof}{\defcounter {refsection}{0}\relax }\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Pressures $p_{\mathrm {in}}$ and $p_{\mathrm {out}}$ are applied to in-pores and out-pores respectively, driving the network flow. The resulting pressure system is solved with the respective solvers from above and the mean total pore flux is shown in each case.}}{3}\protected@file@percent } \newlabel{fig:balance}{{1}{3}}
 This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2021.4.27) 18 OCT 2021 20:57 This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex 2021.4.27) 18 OCT 2021 22:18 entering extended mode restricted \write18 enabled. %&-line parsing enabled. ... ... @@ -347,31 +347,339 @@ Package: multicol 2019/12/09 v1.8y multicolumn formatting (FMi) \colbreak@box=\box90 \mc@col@check@num=\count375 ) \@quotelevel=\count376 \@quotereset=\count377 (/usr/share/texlive/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex \pgfutil@everybye=\toks15 \pgfutil@tempdima=\dimen144 \pgfutil@tempdimb=\dimen145 (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.t ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def \pgfutil@abb=\box91 (/usr/share/texlive/texmf-dist/tex/latex/ms/everyshi.sty Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS) )) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/pgf.revision.tex) Package: pgfrcs 2020/01/08 v3.1.5b (3.1.5b) )) Package: pgf 2020/01/08 v3.1.5b (3.1.5b) (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR) (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR) (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty Package: trig 2016/01/03 v1.10 sin cos tan (DPC) ) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration ) Package graphics Info: Driver file: pdftex.def on input line 105. (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex )) \Gin@req@height=\dimen146 \Gin@req@width=\dimen147 ) (/usr/share/texlive/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex Package: pgfsys 2020/01/08 v3.1.5b (3.1.5b) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex \pgfkeys@pathtoks=\toks16 \pgfkeys@temptoks=\toks17 (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.t ex \pgfkeys@tmptoks=\toks18 )) \pgf@x=\dimen148 \pgf@y=\dimen149 \pgf@xa=\dimen150 \pgf@ya=\dimen151 \pgf@xb=\dimen152 \pgf@yb=\dimen153 \pgf@xc=\dimen154 \pgf@yc=\dimen155 \pgf@xd=\dimen156 \pgf@yd=\dimen157 \w@pgf@writea=\write4 \r@pgf@reada=\read3 \c@pgf@counta=\count376 \c@pgf@countb=\count377 \c@pgf@countc=\count378 \c@pgf@countd=\count379 \t@pgf@toka=\toks19 \t@pgf@tokb=\toks20 \t@pgf@tokc=\toks21 \pgf@sys@id@count=\count380 (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg File: pgf.cfg 2020/01/08 v3.1.5b (3.1.5b) ) Driver file for pgf: pgfsys-pdftex.def (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def File: pgfsys-pdftex.def 2020/01/08 v3.1.5b (3.1.5b) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.de f File: pgfsys-common-pdf.def 2020/01/08 v3.1.5b (3.1.5b) ))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code. tex File: pgfsyssoftpath.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgfsyssoftpath@smallbuffer@items=\count381 \pgfsyssoftpath@bigbuffer@items=\count382 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code. tex File: pgfsysprotocol.code.tex 2020/01/08 v3.1.5b (3.1.5b) )) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg File: color.cfg 2016/01/02 v1.6 sample color configuration ) Package xcolor Info: Driver file: pdftex.def on input line 225. Package xcolor Info: Model cmy' substituted by cmy0' on input line 1348. Package xcolor Info: Model hsb' substituted by rgb' on input line 1352. Package xcolor Info: Model RGB' extended on input line 1364. Package xcolor Info: Model HTML' substituted by rgb' on input line 1366. Package xcolor Info: Model Hsb' substituted by hsb' on input line 1367. Package xcolor Info: Model tHsb' substituted by hsb' on input line 1368. Package xcolor Info: Model HSB' substituted by hsb' on input line 1369. Package xcolor Info: Model Gray' substituted by gray' on input line 1370. Package xcolor Info: Model wave' substituted by hsb' on input line 1371. ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex Package: pgfcore 2020/01/08 v3.1.5b (3.1.5b) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex \pgfmath@dimen=\dimen158 \pgfmath@count=\count383 \pgfmath@box=\box92 \pgfmath@toks=\toks22 \pgfmath@stack@operand=\toks23 \pgfmath@stack@operation=\toks24 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code .tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonomet ric.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.cod e.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison .code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code .tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code. tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerari thmetics.code.tex))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex \c@pgfmathroundto@lastzeros=\count384 )) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfint.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.te x File: pgfcorepoints.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgf@picminx=\dimen159 \pgf@picmaxx=\dimen160 \pgf@picminy=\dimen161 \pgf@picmaxy=\dimen162 \pgf@pathminx=\dimen163 \pgf@pathmaxx=\dimen164 \pgf@pathminy=\dimen165 \pgf@pathmaxy=\dimen166 \pgf@xx=\dimen167 \pgf@xy=\dimen168 \pgf@yx=\dimen169 \pgf@yy=\dimen170 \pgf@zx=\dimen171 \pgf@zy=\dimen172 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct. code.tex File: pgfcorepathconstruct.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgf@path@lastx=\dimen173 \pgf@path@lasty=\dimen174 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code .tex File: pgfcorepathusage.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgf@shorten@end@additional=\dimen175 \pgf@shorten@start@additional=\dimen176 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.te x File: pgfcorescopes.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgfpic=\box93 \pgf@hbox=\box94 \pgf@layerbox@main=\box95 \pgf@picture@serial@count=\count385 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.c ode.tex File: pgfcoregraphicstate.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgflinewidth=\dimen177 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformation s.code.tex File: pgfcoretransformations.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgf@pt@x=\dimen178 \pgf@pt@y=\dimen179 \pgf@pt@temp=\dimen180 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex File: pgfcorequick.code.tex 2020/01/08 v3.1.5b (3.1.5b) ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.t ex File: pgfcoreobjects.code.tex 2020/01/08 v3.1.5b (3.1.5b) ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing .code.tex File: pgfcorepathprocessing.code.tex 2020/01/08 v3.1.5b (3.1.5b) ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.te x File: pgfcorearrows.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgfarrowsep=\dimen181 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex File: pgfcoreshade.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgf@max=\dimen182 \pgf@sys@shading@range@num=\count386 \pgf@shadingcount=\count387 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex File: pgfcoreimage.code.tex 2020/01/08 v3.1.5b (3.1.5b) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code. tex File: pgfcoreexternal.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgfexternal@startupbox=\box96 )) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.te x File: pgfcorelayers.code.tex 2020/01/08 v3.1.5b (3.1.5b) ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.c ode.tex File: pgfcoretransparency.code.tex 2020/01/08 v3.1.5b (3.1.5b) ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code. tex File: pgfcorepatterns.code.tex 2020/01/08 v3.1.5b (3.1.5b) ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorerdf.code.tex File: pgfcorerdf.code.tex 2020/01/08 v3.1.5b (3.1.5b) ))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex File: pgfmoduleshapes.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgfnodeparttextbox=\box97 ) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex File: pgfmoduleplot.code.tex 2020/01/08 v3.1.5b (3.1.5b) ) (/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65 .sty Package: pgfcomp-version-0-65 2020/01/08 v3.1.5b (3.1.5b) \pgf@nodesepstart=\dimen183 \pgf@nodesepend=\dimen184 ) (/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18 .sty Package: pgfcomp-version-1-18 2020/01/08 v3.1.5b (3.1.5b) )) (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgffor.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/math/pgfmath.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex Package: pgffor 2020/01/08 v3.1.5b (3.1.5b) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex) \pgffor@iter=\dimen185 \pgffor@skip=\dimen186 \pgffor@stack=\toks25 \pgffor@toks=\toks26 )) (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex Package: tikz 2020/01/08 v3.1.5b (3.1.5b) (/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers .code.tex File: pgflibraryplothandlers.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgf@plot@mark@count=\count388 \pgfplotmarksize=\dimen187 ) \tikz@lastx=\dimen188 \tikz@lasty=\dimen189 \tikz@lastxsaved=\dimen190 \tikz@lastysaved=\dimen191 \tikz@lastmovetox=\dimen192 \tikz@lastmovetoy=\dimen193 \tikzleveldistance=\dimen194 \tikzsiblingdistance=\dimen195 \tikz@figbox=\box98 \tikz@figbox@bg=\box99 \tikz@tempbox=\box100 \tikz@tempbox@bg=\box101 \tikztreelevel=\count389 \tikznumberofchildren=\count390 \tikznumberofcurrentchild=\count391 \tikz@fig@count=\count392 (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex File: pgfmodulematrix.code.tex 2020/01/08 v3.1.5b (3.1.5b) \pgfmatrixcurrentrow=\count393 \pgfmatrixcurrentcolumn=\count394 \pgf@matrix@numberofcolumns=\count395 ) \tikz@expandcount=\count396 (/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik zlibrarytopaths.code.tex File: tikzlibrarytopaths.code.tex 2020/01/08 v3.1.5b (3.1.5b) ))) \@quotelevel=\count397 \@quotereset=\count398 (/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def File: l3backend-pdfmode.def 2020-02-03 L3 backend support: PDF mode \l__kernel_color_stack_int=\count378 \l__pdf_internal_box=\box91 \l__kernel_color_stack_int=\count399 \l__pdf_internal_box=\box102 ) (./thesis.aux) \openout1 = thesis.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 16. LaTeX Font Info: ... okay on input line 16. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 17. LaTeX Font Info: ... okay on input line 17. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 17. LaTeX Font Info: ... okay on input line 17. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 17. LaTeX Font Info: ... okay on input line 17. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 17. LaTeX Font Info: ... okay on input line 17. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 17. LaTeX Font Info: ... okay on input line 17. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 17. LaTeX Font Info: ... okay on input line 17. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 17. LaTeX Font Info: ... okay on input line 17. Package biblatex Info: Trying to load language 'english'... Package biblatex Info: ... file 'english.lbx' found. ... ... @@ -387,49 +695,79 @@ Package biblatex Info: Trying to load bibliographic data... Package biblatex Info: ... file 'thesis.bbl' found. (./thesis.bbl) Package biblatex Info: Reference section=0 on input line 16. Package biblatex Info: Reference segment=0 on input line 16. Package biblatex Info: Reference section=0 on input line 17. Package biblatex Info: Reference segment=0 on input line 17. ABD: EveryShipout initializing macros (/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] \scratchcounter=\count400 \scratchdimen=\dimen196 \scratchbox=\box103 \nofMPsegments=\count401 \nofMParguments=\count402 \everyMPshowfont=\toks27 \MPscratchCnt=\count403 \MPscratchDim=\dimen197 \MPnumerator=\count404 \makeMPintoPDFobject=\count405 \everyMPtoPDFconversion=\toks28 ) (/usr/share/texlive/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty Package: epstopdf-base 2020-01-24 v2.11 Base part for package epstopdf Package epstopdf-base Info: Redefining graphics rule for .eps' on input line 4 85. (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv e )) LaTeX Font Info: External font cmex10' loaded for size (Font) <12> on input line 17. (Font) <12> on input line 18. LaTeX Font Info: External font cmex10' loaded for size (Font) <8> on input line 17. (Font) <8> on input line 18. LaTeX Font Info: External font cmex10' loaded for size (Font) <6> on input line 17. [1 (Font) <6> on input line 18. [1 {/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] LaTeX Font Info: External font cmex10' loaded for size (Font) <7> on input line 52. (Font) <7> on input line 53. LaTeX Font Info: External font cmex10' loaded for size (Font) <5> on input line 52. (Font) <5> on input line 53. [2] [3] (./thesis.aux) File: plots/flux_balance.png Graphic file (type png) Package pdftex.def Info: plots/flux_balance.png used on input line 61. (pdftex.def) Requested size: 276.00105pt x 207.01175pt. [3 <./plots/flux_balance.png>] (./thesis.aux) Package logreq Info: Writing requests to 'thesis.run.xml'. \openout1 = `thesis.run.xml'. ) Here is how much of TeX's memory you used: 7966 strings out of 483107 150637 string characters out of 5964630 776517 words of memory out of 5000000 22972 multiletter control sequences out of 15000+600000 18979 strings out of 483107 379453 string characters out of 5964630 978636 words of memory out of 5000000 33735 multiletter control sequences out of 15000+600000 537760 words of font info for 42 fonts, out of 8000000 for 9000 59 hyphenation exceptions out of 8191 36i,7n,45p,1789b,1224s stack positions out of 5000i,500n,10000p,200000b,80000s 60i,7n,60p,1789b,1226s stack positions out of 5000i,500n,10000p,200000b,80000s Output written on thesis.pdf (3 pages, 121713 bytes). re/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb> Output written on thesis.pdf (3 pages, 149813 bytes). PDF statistics: 54 PDF objects out of 1000 (max. 8388607) 38 compressed objects within 1 object stream 64 PDF objects out of 1000 (max. 8388607) 45 compressed objects within 1 object stream 0 named destinations out of 1000 (max. 500000) 1 words of extra memory for PDF output out of 10000 (max. 10000000) 18 words of extra memory for PDF output out of 10000 (max. 10000000)
No preview for this file type
No preview for this file type
 ... ... @@ -7,6 +7,7 @@ % packages \usepackage[backend=biber, sorting=none]{biblatex} \usepackage{multicol} % multicolumn environment \usepackage{tikz} % figures % references \addbibresource{bib/RandomGenerationFlowNetworks.bib} ... ... @@ -45,16 +46,23 @@ \section{Parallel Flow Solver} \subsection{PETSc Interface} \hspace{0.5cm}In order to interface the chosen C API of PETSc with the \emph{netflow} Python module, we rely on Cython to wrap the C source, that is subsequently compiled with all required compilation and linking flags of PETSc. This allows us to invoke a \verb|solve_py| function from Python delegating the relevant parameters, namely the system matrix and right-hand-side vector, to C code. \hspace{0.5cm}In order to interface the chosen C API of PETSc with the \emph{netflow} Python module, we rely on Cython to wrap the C source in Python, that is subsequently compiled with all required compilation and linking flags of PETSc. This allows us to invoke a \verb|solve_py| function from Python delegating the relevant parameters, namely the system matrix and right-hand-side vector, to C code. \subsection{Solver} \hspace{0.5cm}The actual solver written in C then utilizes PETSc to iteratively approximate the solution of the system in parallel with the available MPI processes. To avoid data duplication of the fairly large and sparse system matrix, it is only assembled on the root rank and then communicated in parts to the corresponding ranks through PETSc's \verb|Assembly| routines. The iterative method chosen to solve the pressure system, arising from the flow network, is GMRES together with a left algebraic multi-grid preconditioner supplied via hypre \cite{hypre-web-page}. \subsection{Results} \hspace{0.5cm}In order to assess the quality of the pressure-solution obtained by this solver, we study the fluxes induced by the pore pressures for a given base network containing 2636 pores. In particular, we look at the sum of all in- and out-going fluxes per pore, obtained from the function \verb|flux_balance|, and aggregated over all pores of the network. As expected from the conservation of mass, the mean is close to $0$ ($\approx 10^{-10}$) and the maximum is $\approx 10^{-7}$, which is in complete agreement with existing single-core solvers implemented in \emph{netflow}. \hspace{0.5cm}In order to assess the quality of the pressure-solution obtained by this solver, we study the fluxes induced by the pore pressures for a given base network comprised of 2636 pores. In particular, we look at the sum of all in- and out-going fluxes per pore, obtained from the function \verb|flux_balance|, and aggregated over all pores of the network. As expected from the conservation of mass, the mean is close to $0$ ($\approx 10^{-10}$) and the maximum is $\approx 10^{-7}$, which is in complete agreement with existing single-core solvers implemented in \emph{netflow}, see Figure ~\ref{fig:balance}. \end{multicols} \newpage \begin{figure}[h] \centering \includegraphics[width=0.8\textwidth]{plots/flux_balance.png} \caption{Pressures $p_{\mathrm{in}}$ and $p_{\mathrm{out}}$ are applied to in-pores and out-pores respectively, driving the network flow. The resulting pressure system is solved with the respective solvers from above and the mean total pore flux is shown in each case.} \label{fig:balance} \end{figure} \centering \printbibliography \end{document} \ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!