~ubuntu-branches/ubuntu/vivid/dune-grid/vivid

« back to all changes in this revision

Viewing changes to dune/grid/geometrygrid.hh

  • Committer: Package Import Robot
  • Author(s): Ansgar Burchardt
  • Date: 2014-02-14 10:49:16 UTC
  • mfrom: (1.3.1) (5.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20140214104916-2clchnny3eu7ks4w
Tags: 2.3.0-2
InstallĀ /usr/share/dune-grid.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 
2
// vi: set et ts=4 sw=2 sts=2:
1
3
#include <dune/grid/geometrygrid/grid.hh>
2
4
#include <dune/grid/geometrygrid/persistentcontainer.hh>
3
5
 
85
87
 *    }
86
88
 *  };
87
89
 *  \endcode
88
 
 *  
 
90
 *
89
91
 *  If you want to prescribe your geometry by a set of coordinates you have to write
90
92
 *  a deformation class and have it derive from Dune::DiscreteCoordFunction.
91
93
 *  An example is given by the following code snippet.  Central to the class are the
94
96
 *  computes the position of this corner.  It is trivial to implement this using the
95
97
 *  first evaluate method, and I don't know why it isn't done by default.
96
98
 *  \code
97
 
template <class GridView>
98
 
class DeformationFunction
 
99
   template <class GridView>
 
100
   class DeformationFunction
99
101
    : public Dune :: DiscreteCoordFunction< double, dim, DeformationFunction<GridView> >
100
 
{
 
102
   {
101
103
    typedef DeformationFunction<GridView> This;
102
104
    typedef Dune :: DiscreteCoordFunction< double, dim, This > Base;
103
105
 
104
 
  public:
 
106
   public:
105
107
 
106
108
    DeformationFunction(const GridView& gridView,
107
109
                        const double* deformedPosition)
133
135
            y[i] = deformedPosition_[idx*dim + i];
134
136
    }
135
137
 
136
 
private:
 
138
   private:
137
139
 
138
140
    GridView gridView_;
139
141
 
140
142
    const double* deformedPosition_;
141
143
 
142
 
};
 
144
   };
143
145
 *  \endcode
144
146
 *
145
147
 *