Commit 5f41cb50 authored by Valentin Vallaeys's avatar Valentin Vallaeys
Browse files

timer: add info + split moving mesh and 2D

parent 37e0af5c
Pipeline #1299 passed with stage
in 28 minutes and 31 seconds
......@@ -237,6 +237,7 @@ class Loop:
self._ncExport = []
self._restart_dir = None
self._restart_ind = -1
self._timer = False
def export_uv(self, vect=True):
self._export_uv = True
......@@ -259,6 +260,9 @@ class Loop:
def restart(self, directory, index):
self._restart_dir = directory
self._restart_ind = index
def set_timer(self):
self._timer = True
def setup(self):
slim3d_private.slim3d_setup(self)
......@@ -361,6 +365,9 @@ class Loop:
def loop(self):
if not self._timeIntegrator:
self.setup()
if self._timer:
timer = dgpy.dgTimer.root()
timer.start()
while self.get_time() < self.final_time:
self.advance_one_time_step()
self.check_sanity()
......@@ -370,6 +377,8 @@ class Loop:
self.export_full()
self.check_tracer_consistency()
self.print_iter_info()
if self._timer:
timer.printFull()
self.terminate()
......
......@@ -911,6 +911,7 @@ void slim3dTimeIntegratorPC::advanceOneTimeStep()
timer.start();
static dgTimer &timer2d = timer.child("2d");
static dgTimer &timer3d = timer.child("3d");
static dgTimer &timerMM = timer.child("Moving mesh");
static dgTimer &timerUV = timer3d.child("UV");
static dgTimer &timerUVimp = timerUV.child("UVimp");
static dgTimer &timerUVdep = timerUV.child("UV dependencies");
......@@ -1175,7 +1176,9 @@ void slim3dTimeIntegratorPC::advanceOneTimeStep()
}
etaDof2d_tav_new->scatter();
uvAvDof2d_tav_new->scatter();
timer2d.stop();
// update geometry to eta^{n+1}
timerMM.start();
if ( _solver->getUseConservativeALE() ) {
if (uvDof_new) uvDof_new->multiplyByMassMatrix();
if (SDof_new) SDof_new->multiplyByMassMatrix();
......@@ -1183,11 +1186,15 @@ void slim3dTimeIntegratorPC::advanceOneTimeStep()
if (sedDof_new.size() != 0)
for(int iSedEq = 0; iSedEq < _solver->getNumSedEq(); ++iSedEq) sedDof_new[iSedEq]->multiplyByMassMatrix();
}
timerMM.stop();
timer2d.start();
d->etaDof2d->copy(*etaDof2d_tav_new);
f->eta2dFunc->compute(*d->etaDof2d->getFunction());
d->uvAvDof2d->copy(*uvAvDof2d_tav_newHalf);
f->uvAv2dFunc->compute(*d->uvAvDof2d->getFunction());
f->uvAvGrad2dFunc->compute(*d->uvAvDof2d->getFunctionGradient());
timer2d.stop();
timerMM.start();
etaDependencies(etaDof2d_tav_new);
if ( _solver->getUseConservativeALE() ) {
if (uvDof_new) uvDof_new->multiplyByInvMassMatrix();
......@@ -1201,7 +1208,7 @@ void slim3dTimeIntegratorPC::advanceOneTimeStep()
if (sedDof_new.size() !=0 && s->getFlagSedLimiter())
for(int iSedEq = 0; iSedEq < _solver->getNumSedEq(); ++iSedEq) s->sedLimiter->apply(sedDof_new[iSedEq]);
}
timer2d.stop();
timerMM.stop();
if(s->getSolve3d()){
timer3d.start();
......
Supports Markdown
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