vtf-logo

shells/driverCC/SEdgeFunctors.h

Go to the documentation of this file.
00001 // -*- C++ -*- 
00002 //
00003 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00004 //
00005 //                                   Fehmi Cirak
00006 //                        California Institute of Technology
00007 //                           (C) 2004 All Rights Reserved
00008 //
00009 // <LicenseText>
00010 //
00011 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00012 //
00013 #ifndef SEDGEFUNCTORS_H
00014 #define SEDGEFUNCTORS_H
00015 #include "../fem/definitions.h"
00016 #include "../fem/sedge.h"
00017 
00018 #include <functional>
00019 #include <vector>
00020 #include <cassert>
00021 
00022 
00023 namespace shells {    
00024     class SEdgeCoupling;
00025     class SEdgeCouplingFragmented;
00026     template<typename Inserter>
00027     struct SEdgeVertices;
00028 }
00029 
00030 
00031 class shells::SEdgeCoupling : 
00032     public std::unary_function<shells::SEdgeS *, void> {
00033     // collect the vertices in the one ring of elements attached to the edge
00034 public:
00035     SEdgeCoupling(std::vector<shells::SVertexS*>& vertices):_vertices(vertices){}
00036 
00037     void operator()(const shells::SEdgeS * const edge) const;
00038 
00039 private:
00040     std::vector<shells::SVertexS *>&     _vertices;
00041 };
00042 
00043 
00044 
00045 class shells::SEdgeCouplingFragmented : 
00046     public std::unary_function<shells::SEdgeS *, void> {
00047     // collect the vertices in the one ring of elements attached to the edge
00048 public:
00049     SEdgeCouplingFragmented(std::vector<shells::SVertexS*>& vertices):_vertices(vertices){}
00050 
00051     void operator()(const shells::SEdgeS * const edge) const;
00052 
00053 private:
00054     std::vector<shells::SVertexS *>&     _vertices;
00055 };
00056 
00057 
00058 
00059 namespace shells {    
00060 
00061 template<typename Inserter>
00062 struct SEdgeVertices  : 
00063     public std::binary_function<shells::SEdge *, Inserter, void> {
00064 public:
00065     // insert the two pointers to the edge vertices into inserter
00066     
00067     void operator()(shells::SEdge *edge, Inserter ins) const 
00068         {
00069             *ins++ = edge->m_a;
00070             *ins++ = edge->m_b;
00071 
00072             if (edge->m_a != edge->m_a2) *ins++ = edge->m_a2;
00073             if (edge->m_b != edge->m_b2) *ins++ = edge->m_b2;
00074         }
00075 };
00076 
00077 } // namespace shells
00078 
00079 #endif

Generated on Fri Aug 24 13:00:24 2007 for SFC Thin-Shell Finite Element Solver by  doxygen 1.4.7