From 14925158c6a7b471afacf97d0b72b981ba10b0cd Mon Sep 17 00:00:00 2001
From: Jonathan Lambrechts <jonathan.lambrechts@uclouvain.be>
Date: Wed, 28 Apr 2010 20:44:41 +0000
Subject: [PATCH] add dgDofContainer::function

---
 Solver/function.cpp | 7 +++----
 Solver/function.h   | 1 +
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Solver/function.cpp b/Solver/function.cpp
index 154f188e15..a493fa0a91 100644
--- a/Solver/function.cpp
+++ b/Solver/function.cpp
@@ -68,15 +68,13 @@ dataCacheDouble::dataCacheDouble(dataCacheMap *m, function *f):
   for (int i = 0; i < f->_functionReplaces.size(); i++) {
     functionReplaceCaches.push_back (new functionReplaceCache(m, f->_functionReplaces[i], this)); 
   }
+  f->registerInDataCacheMap(m, this);
 }
 
 void dataCacheDouble::resize() {
   _value = fullMatrix<double>(_nRowByPoint==0?1:_nRowByPoint*_cacheMap.getNbEvaluationPoints(),_value.size2());
 }
 void dataCacheDouble::_eval() {
-  /*for(unsigned int i=0;i<_substitutions.size(); i++){
-    _substitutions[i].first->set() = (*_substitutions[i].second)();
-  }*/
   for(unsigned int i=0;i<_dependencies.size(); i++){
     _function->arguments[i].val->setAsProxy((*_dependencies[i])());
   }
@@ -378,7 +376,8 @@ class functionC : public function {
         "\tg++ -shared -fPIC -o $@ $(CXX_FLAGS) $(CXX_DEFINES) $<\n",
         filename.c_str(), "_tmpSrc.cpp");
     fclose(tmpMake);
-    system("make -f _tmpMake");
+    if(system("make -f _tmpMake"))
+      Msg::Error("make command failed\n");
     unlink ("_tmpSrc.cpp");
     unlink ("_tmpMake.cpp");
   }
diff --git a/Solver/function.h b/Solver/function.h
index baa9a630ea..d1ca9706c3 100644
--- a/Solver/function.h
+++ b/Solver/function.h
@@ -46,6 +46,7 @@ class function {
   std::vector<int> _childrenCache;
   std::vector<substitutedFunction> _substitutedFunctions;
   virtual void call (dataCacheMap *m, fullMatrix<double> &res)=0;
+  virtual void registerInDataCacheMap(dataCacheMap *m, dataCacheDouble *d) {}
   std::vector<argument> arguments;
   const void setArgument(fullMatrix<double> &v, const function *f, int iMap = 0) {
     if(f==NULL)
-- 
GitLab