From a4d7de8f9ca3213d1af8df01a2e8c8980573c5f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Asia=20J=C4=99drzejewska-Szmek?= <asia@in.waw.pl>
Date: Fri, 20 Jan 2017 15:49:31 -0500
Subject: [PATCH] Difshells and difbuffers initialize close to equilibrium

In DifShell reinit set C (calcium) to Ceq. In DifBuffer reinit
calculate bFree (free buffer) and bBound (bound buffer) to steady
state value. This matches genesis implementation.
---
 moose-core/biophysics/DifBuffer.cpp | 4 ++++
 moose-core/biophysics/DifShell.cpp  | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/moose-core/biophysics/DifBuffer.cpp b/moose-core/biophysics/DifBuffer.cpp
index edf8966e..da0ebf8b 100644
--- a/moose-core/biophysics/DifBuffer.cpp
+++ b/moose-core/biophysics/DifBuffer.cpp
@@ -439,6 +439,10 @@ void DifBuffer::vReinit( const Eref& e, ProcPtr p )
       assert( 0 );
     }
   
+  bFree_ = bTot_/(1+activation_*kf_/kb_);
+  prevFree_ = bFree_;
+  bBound_ = bTot_ - bFree_;
+  prevBound_ = bBound_;
 }
 
 void DifBuffer::vFluxFromIn(const Eref& e,double innerC, double innerThickness)
diff --git a/moose-core/biophysics/DifShell.cpp b/moose-core/biophysics/DifShell.cpp
index d4e37d08..015f6117 100644
--- a/moose-core/biophysics/DifShell.cpp
+++ b/moose-core/biophysics/DifShell.cpp
@@ -323,6 +323,9 @@ void DifShell::vReinit( const Eref& e, ProcPtr p )
     default:
       assert( 0 );
     }
+  C_= Ceq_;
+  prevC_ = Ceq_;
+  concentrationOut()->send( e, C_ );
 }
 
 void DifShell::vProcess( const Eref & e, ProcPtr p )
-- 
GitLab