From 04ced45d2b30bfd3bfd333a024618afc990739d4 Mon Sep 17 00:00:00 2001
From: Eric Bechet <eric.bechet@ulg.ac.be>
Date: Wed, 28 Apr 2010 16:06:09 +0000
Subject: [PATCH]

---
 Solver/filters.h       | 68 ++++++++++++++++++++++++++++++++++++++++++
 Solver/functionSpace.h |  6 ++--
 2 files changed, 71 insertions(+), 3 deletions(-)
 create mode 100644 Solver/filters.h

diff --git a/Solver/filters.h b/Solver/filters.h
new file mode 100644
index 0000000000..935e4fa662
--- /dev/null
+++ b/Solver/filters.h
@@ -0,0 +1,68 @@
+//
+// Description : Filtered and xFem function space definition
+//
+//
+// Author:  <Eric Bechet>::<Boris Sedji>,  02/2010
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+
+#ifndef _XFEMFS_H_
+#define _XFEMFS_H_
+
+#include "simpleFunction.h"
+#include "dofManager.h"
+
+class FilterNodeEnriched
+{
+
+  private :
+
+    std::set<int> *_TagEnrichedVertex;
+    std::set<int> * _EnrichComp;
+
+  public :
+
+    FilterNodeEnriched(std::set<int > * TagEnrichedVertex , std::set<int> * EnrichComp)
+    {
+      _TagEnrichedVertex = TagEnrichedVertex;
+      _EnrichComp = EnrichComp;
+    }
+
+    virtual bool operator () (Dof & key) const
+    {
+      std::set<int>::iterator it1;
+      std::set<int>::iterator it2;
+      int i1,i2;
+      Dof::getTwoIntsFromType(key.getType(), i1,i2);
+       it2 = _EnrichComp->find(i1);
+      it1 = _TagEnrichedVertex->find(key.getEntity());
+      if (it1!=_TagEnrichedVertex->end() & it2 != _EnrichComp->end())
+      {
+        return true;
+      }
+      else return false;
+    }
+
+    //std::vector<int> * getEnrichComp(){return _EnrichComp;}
+
+//    void SetEnrichedVertex(MElement *elep, std::vector<int> & EnrichedVertex,int &nbdofs)
+//    {
+//      EnrichedVertex.clear();
+//      nbdofs = 0;
+//      for (int i=0 ;i<elep->getNumVertices();i++)
+//      {
+//        std::set<int>::iterator it;
+//        it = _TagEnrichedVertex->find(elep->getVertex(i)->getNum());
+//        if (it!=_TagEnrichedVertex->end())
+//        {
+//            EnrichedVertex.push_back(i);
+//            nbdofs = nbdofs + 1*_EnrichComp->size(); // enriched dof
+//        }
+//      }
+//    }
+};
+
+
+#endif
diff --git a/Solver/functionSpace.h b/Solver/functionSpace.h
index e00614e583..13b7d83f0a 100644
--- a/Solver/functionSpace.h
+++ b/Solver/functionSpace.h
@@ -310,9 +310,9 @@ class CompositeFunctionSpace : public FunctionSpace<T>
   std::vector<FunctionSpace<T>* > _spaces;
  public:
   template <class T1> CompositeFunctionSpace(const T1& t) { _spaces.push_back(new T1(t));}
-  template <class T1, class T2> CompositeFunctionSpace(T1& t1, T2& t2)
-  { _spaces.push_back(&t1);
-    _spaces.push_back(&t2); }
+  template <class T1, class T2> CompositeFunctionSpace(const T1& t1,const T2& t2)
+  { _spaces.push_back(new T1(t1));
+    _spaces.push_back(new T2(t2)); }
   template <class T1, class T2, class T3> CompositeFunctionSpace(const T1& t1, const T2& t2, const T3& t3)
   { _spaces.push_back(new T1(t1));
     _spaces.push_back(new T2(t2));
-- 
GitLab