Skip to content
Snippets Groups Projects
Commit e84a81d4 authored by Peter Bastian's avatar Peter Bastian
Browse files

first version (instead of import ...)

[[Imported from SVN: r2]]
parent 83b234d5
No related branches found
No related tags found
No related merge requests found
hier soll stehen wie man mit configure und automake installiert
TODO 0 → 100644
- automake einbauen
- doxygen configuration files
- Installation doku in docs
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef __MATVEC_HH__
#define __MATVEC_HH__
namespace Dune {
/** @defgroup Common Dune Common Module
This module contains classes for general usage in dune, such as e.g.
(small) dense matrices and vectors or containers.
@{
*/
//************************************************************************
/*!
Generic vector class for short vectors in d dimensions. Used e.g. for global or local coordinates.
*/
template<int n, class T = double>
class Vec {
public:
//! Constructor making uninizialized vector
Vec() {}
//! Constructor making vector from built-in array
Vec (T* y) {for(int i=0; i<n; i++) x[i]=y[i];}
//! Constructor making vector with one coordinate set, others zeroed
Vec (int k, T t)
{
for (int i=0; i<n; i++) x[i] = 0, x[k] = t;
}
//! Constructor making vector with identical coordinates
Vec (T t)
{
for (int i=0; i<n; i++) x[i] = t;
}
//! operator () for read/write access to element of the vector
T& operator() (int i) {return x[i];}
//! operator+ adds two vectors
Vec<n,T> operator+ (const Vec<n,T>& b)
{
Vec<n,T> z; for (int i=0; i<n; i++) z.x[i] = x[i]+b.x[i];return z;
}
//! operator- binary minus
Vec<n,T> operator- (const Vec<n,T>& b)
{
Vec<n,T> z; for (int i=0; i<n; i++) z.x[i] = x[i]-b.x[i];return z;
}
//! scalar product of two vectors with operator*
T operator* (const Vec<n,T>& b)
{
T s=0; for (int i=0; i<n; i++) s += x[i]*b.x[i];return s;
}
//! multiplication of vector with scalar
T operator* (T k)
{
Vec<n,T> z; for (int i=0; i<n; i++) z.x[i] = k*x[i];return s;
}
private:
//! built-in array to hold the data.
T x[n];
};
//! multiplication of scalar with vector
template<int n, class T>
Vec<n,T> operator* (T k, Vec<n,T> b)
{
Vec<n,T> z; for (int i=0; i<n; i++) z(i) = k*b(i);return z;
}
//! unary minus
template<int n, class T>
Vec<n,T> operator- (Vec<n,T> b)
{
Vec<n,T> z; for (int i=0; i<n; i++) z(i) = -b(i);return z;
}
//************************************************************************
/*!
Generic vector class for short vectors in d dimensions. Used e.g. for global or local coordinates.
*/
template<int n, int m, class T = double>
class Mat {
public:
//! Constructor making uninizialized matrix
Mat() {}
//! operator () for read/write access to element in matrix
T& operator() (int i, int j) {return a[j](i);}
//! operator () for read/write access to column vector
Vec<n,T>& operator() (int j) {return a[j];}
//! matrix/vector multiplication
Vec<n,T> operator* (const Vec<m,T>& x)
{
Vec<n,T> z(0.0);
for (j=0; j<m; j++)
for (i=0; i<n; i++) z(i) += a[j](i)*x(j);
return z;
}
private:
//! built-in array to hold the data
Vec<n,T> a[m];
};
/** @} */
}
#endif
indent rules
include file pfade
This diff is collapsed.
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef __GRID_HH__
#define __GRID_HH__
namespace Dune {
/** @defgroup GridCommon Dune Grid Module
The Dune Grid module defines a general interface to a hierarchical finite element mesh.
The interface is independent of dimension and element type. Various implementations
of this interface exits:
- Structured Grid (SGrid) : A structured mesh in d dimensions consisting of "cubes". The number
of elements per dimension is variable.
- Albert Grid (AlbertGrid) : Provides the simplicial meshes of the finite element tool box ALBERT
written by Kunibert Siebert and Alfred Schmidt.
- UG Grid (UGGrid) : Provides the meshes of the finite element toolbox UG.
- Structured Parallel Grid (SPGrid) : Provides a distributed structured mesh.
This Module contains only the description of compounds that are common to all implementations
of the grid interface.
For a detailed description of the interface itself please see the documentation
of the "Structured Grid Module". Since Dune uses the Engine concept there is no abstract definition
of the interface. As with STL containers, all implementations must implement the
same classes with exactly the same members to be used in generic algorithms.
Class Diagramm: Image inclusion see doxygen doc at page 92.
@{
*/
//************************************************************************
/*! \enum ElementType
Enum that declares identifiers for different element types. This
list can be extended in the future. Not all meshes need to implement
all element types.
*/
enum ElementType {unknown,line, triangle, quadrilateral, tetrahedron, pyramid, prism, hexahedron,
iso_triangle, iso_quadrilateral};
/** @} */
}
#endif
This diff is collapsed.
// NOTE: The current revision of this file was left untouched when the DUNE source files were reindented!
// NOTE: It contained invalid syntax that could not be processed by uncrustify.
#ifndef __NUMBERING_CC__
#define __NUMBERING_CC__
namespace Dune {
template<int dim>
inline void LexOrder<dim>::init (Tupel<int,dim>& _N)
{
// store argument
N=_N;
// build P array
P[0] = 1;
for (int i=1; i<=dim; i++) P[i] = P[i-1]*N[i-1];
}
template<int dim>
inline int LexOrder<dim>::tupels ()
{
return P[dim];
}
template<int dim>
inline int LexOrder<dim>::n (Tupel<int,dim>& z)
{
int r=0;
for (int i=0; i<dim; i++) r += z[i]*P[i];
return r;
}
template<int dim>
inline Tupel<int,dim> LexOrder<dim>::z (int n)
{
Tupel<int,dim> z;
for (int i=0; i<dim; i++)
{
z[i] = n%N[i];
n = n/N[i];
}
return z;
}
//************************************************************************
template<int dim>
inline void JoinOrder<dim>::init (Tupel<int,dim>& _N)
{
// store argument
N=_N;
// build P array
offset[0] = 0;
for (int i=1; i<=dim; i++) offset[i] = offset[i-1]+N[i-1];
}
template<int dim>
inline int JoinOrder<dim>::size ()
{
return offset[dim];
}
template<int dim>
inline int JoinOrder<dim>::n (int subset, int index)
{
return index+offset[subset];
}
template<int dim>
inline int JoinOrder<dim>::index (int n)
{
for (int i=0; i<dim; i++)
if (N[i]!=0)
{
if (n<N[i]) return n;
n -= N[i];
}
return n; // oops, error !
}
template<int dim>
inline int JoinOrder<dim>::subset (int n)
{
for (int i=0; i<dim; i++)
if (N[i]!=0)
{
if (n<N[i]) return i;
n -= N[i];
}
return 0; // oops, error !
}
//************************************************************************
template<int dim>
CubeMapper<dim>::CubeMapper (Tupel<int,dim>& _N)
{
// store argument
N=_N;
// preprocess binary partitions
for (int i=0; i<=dim; i++) ne[i] = 0;
for (int b=0; b<power2(dim); b++) // loop over all binary partitions
{
int mask=1;
Tupel<int,dim> t;
for (int i=0; i<dim; i++)
{
if (b&mask)
{
// bit i is even
t[i] = N[i]+1;
}
else
{
// bit i is odd
t[i] = N[i];
}
mask *= 2;
}
lex[b].init(t); // set up lex ordering of tupels
nb[b] = lex[b].tupels();
cb[b] = ones(b);
ne[cb[b]] += nb[b];
}
// preprocess lex ordering for each codimension
for (int c=0; c<=dim; c++)
{
Tupel<int,1<<dim> t;
for (int b=0; b<power2(dim); b++) // loop over all binary partitions
if (ones(b)==c)
{
// partition b is part of codim c
t[b] = nb[b];
}
else
{
// partition does not contribute to codim c
t[b] = 0;
}
join[c].init(t); // set join mapper
}
cout << "CubeMapper [" ;
for (int i=0; i<dim; i++)
cout << N[i] << " ";
cout << "]" << endl;
for (int i=0; i<=dim; i++)
cout << " " << ne[i] << " elements of codim " << i
<< " in dimension " << dim << endl;
}
template<int dim>
inline int CubeMapper<dim>::elements (int codim)
{
return ne[codim];
}
template<int dim>
inline int CubeMapper<dim>::codim (Tupel<int,dim>& z)
{
int r=0;
for (int i=0; i<dim; i++)
if (z[i]%2==0) r++; // count even components
return r;
}
template<int dim>
inline int CubeMapper<dim>::n (Tupel<int,dim>& z)
{
int p = partition(z); // get partition
Tupel<int,dim> r=reduce(z); // get reduced coordinate
// treat easy cases first
if (p==0 || p==power2(dim)-1)
{
// all components are either odd or even
return lex[p].n(r);
}
// general case
return join[ones(p)].n(p,lex[p].n(r));
}
template<int dim>
inline Tupel<int,dim> CubeMapper<dim>::z (int i, int codim)
{
Tupel<int,dim> r;
// easy cases first
if (codim==0)
{
r = lex[0].z(i);
return expand(r,0);
}
if (codim==dim)
{
r = lex[power2(dim)-1].z(i);
return expand(r,power2(dim)-1);
}
// general case
int p = join[codim].subset(i);
int n = join[codim].index(i);
r = lex[p].z(n);
return expand(r,p);
}
template<int dim>
inline int CubeMapper<dim>::ones (int b)
{
int r = 0;
int mask = 1;
for (int i=0; i<dim; i++)
{
if (b&mask) r++;
mask *=2 ;
}
return r;
}
template<int dim>
inline int CubeMapper<dim>::partition (Tupel<int,dim>& z)
{
int r = 0;
int mask = 1;
for (int i=0; i<dim; i++)
{
if (z[i]%2==0) r += mask;
mask *=2 ;
}
return r;
}
template<int dim>
inline Tupel<int,dim> CubeMapper<dim>::reduce (Tupel<int,dim>& z)
{
Tupel<int,dim> r;
for (int i=0; i<dim; i++)
if (z[i]%2==0)
r[i] = z[i]/2; // even component
else
r[i] = (z[i]-1)/2; // odd component
return r;
}
template<int dim>
inline Tupel<int,dim> CubeMapper<dim>::expand (Tupel<int,dim>& r, int b)
{
Tupel<int,dim> z;
int mask = 1;
for (int i=0; i<dim; i++)
if (b&mask)
z[i] = r[i]*2; // even component
else
z[i] = 2*r[i]+1); // odd component
return r;
}
}
#endif
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef __NUMBERING_HH__
#define __NUMBERING_HH__
namespace Dune {
//! class holding d-dimensional array of type T
template<class T, int d>
class Tupel {
public:
//! make empty tupel
Tupel() {}
//! read/write components
int& operator[] (int i) {return x[i];}
private:
int x[d];
};
//! generate lexicographic ordering in a cube of dimension dim with arbitry size per direction
template<int dim>
class LexOrder {
public:
//! preprocess ordering
void init (Tupel<int,dim>& _N);
//! get total number of tupels
int tupels ();
//! compute number from a given tupel
int n (Tupel<int,dim>& z);
//! compute tupel from number 0 <= n < tupels()
Tupel<int,dim> z (int n);
private:
Tupel<int,dim> N; // number of elements per direction
int P[dim+1]; // P[i] = Prod_{i=0}^{i} N[i];
};
//! generate consecutive numbering of dim sets of size N_i
template<int dim>
class JoinOrder {
public:
//! preprocess ordering
void init (Tupel<int,dim>& _N);
//! get total number of elements in all sets
int size ();
//! compute number from subset and index
int n (int subset, int index);
//! compute subset from number
int subset (int n);
//! compute index in subset from number
int index (int n);
private:
Tupel<int,dim> N; // number of elements per direction
int offset[dim+1]; // P[i] = Sum_{i=0}^{i} N[i];
};
//! associate a unique consecutive index to all entities of a given codimension in a d-dimension cube
template<int dim>
class CubeMapper {
public:
//! construct with number of elements (of codim 0) in each direction
CubeMapper (Tupel<int,dim>& _N);
//! get number of elements in each codimension
int elements (int codim);
//! compute codim from coordinate
int codim (Tupel<int,dim>& z);
/*! compute number from coordinate 0 <= n < elements(codim(z))
general implementation is O(2^dim)
*/
int n (Tupel<int,dim>& z);
//! compute coordinates from number and codimension
Tupel<int,dim> z (int i, int codim);
private:
Tupel<int,dim> N; // number of elements per direction
int ne[dim+1]; // number of elements per codimension
int nb[1<<dim]; // number of elements per binary partition
int cb[1<<dim]; // codimension of binary partition
LexOrder<dim> lex[1<<dim]; // lex ordering within binary partition
JoinOrder<1<<dim> join[dim+1]; // join subsets of codimension
int power2 (int i) {return 1<<i;}
int ones (int b); // count number of bits set in binary rep of b
int partition (Tupel<int,dim>& z); // get binary representation of partition
Tupel<int,dim> reduce (Tupel<int,dim>& z);
Tupel<int,dim> expand (Tupel<int,dim>& r, int b);
};
} // end namespace
#include "numbering.cc"
#endif
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef __SGRID_CC__
#define __SGRID_CC__
namespace Dune {
#include <assert.h>
//************************************************************************
// INLINE METHOD IMPLEMENTATIONS FOR SGRID
//************************************************************************
//************************************************************************
// the reference elements as global variables
SElement<1,1> SGridrefelem1D(Vec<1>(0,0.0),Vec<1>(0,1.0));
SElement<2,2> SGridrefelem2D(Vec<2>(0,0.0),Vec<2>(0,1.0),Vec<2>(1,1.0));
SElement<3,3> SGridrefelem3D(Vec<3>(0,0.0),Vec<3>(0,1.0),Vec<3>(1,1.0),Vec<3>(2,1.0));
template<int dimworld>
inline SElement<1,dimworld>::SElement (const Vec<dimworld>& s_, const Vec<dimworld>& r0)
{
// copy arguments
s = s_;
A(0) = r0;
// make corners
c[0] = s;
c[1] = s+A(0);
}
template<int dimworld>
inline SElement<2,dimworld>::SElement (const Vec<dimworld>& s_, const Vec<dimworld>& r0, const Vec<dimworld>& r1)
{
// copy arguments
s = s_;
A(0) = r0;
A(1) = r1;
// make corners
c[0] = s;
c[1] = s+A(0);
c[2] = s+A(0)+A(1);
c[3] = s+A(1);
}
template<int dimworld>
inline SElement<3,dimworld>::SElement (const Vec<dimworld>& s_, const Vec<dimworld>& r0,
const Vec<dimworld>& r1, const Vec<dimworld>& r2)
{
// copy arguments
s = s_;
A(0) = r0;
A(1) = r1;
A(2) = r2;
// make corners
c[0] = s;
c[1] = s+A(0);
c[2] = s+A(0)+A(1);
c[3] = s+A(1);
c[4] = s+A(2);
c[5] = s+A(0)+A(2);
c[6] = s+A(0)+A(1)+A(2);
c[7] = s+A(1)+A(2);
}
template<int dimworld>
inline SElement<1,dimworld>::SElement (const Vec<dimworld>& s_, Vec<dimworld> r_[1])
{
// copy arguments
s = s_;
A(0) = r_[0];
// make corners
c[0] = s;
c[1] = s+A(0);
}
template<int dimworld>
inline SElement<2,dimworld>::SElement (const Vec<dimworld>& s_, Vec<dimworld> r_[2])
{
// copy arguments
s = s_;
A(0) = r_[0];
A(1) = r_[1];
// make corners
c[0] = s;
c[1] = s+A(0);
c[2] = s+A(0)+A(1);
c[3] = s+A(1);
}
template<int dimworld>
inline SElement<3,dimworld>::SElement (const Vec<dimworld>& s_, Vec<dimworld> r_[3])
{
// copy arguments
s = s_;
A(0) = r_[0];
A(1) = r_[1];
A(2) = r_[2];
// make corners
c[0] = s;
c[1] = s+A(0);
c[2] = s+A(0)+A(1);
c[3] = s+A(1);
c[4] = s+A(2);
c[5] = s+A(0)+A(2);
c[6] = s+A(0)+A(1)+A(2);
c[7] = s+A(1)+A(2);
}
template<int dim, int dimworld>
inline ElementType SElement<dim,dimworld>::type ()
{
switch (dim)
{
case 1 : return line;
case 2 : return quadrilateral;
case 3 : return hexahedron;
default : return unknown;
}
}
template<int dim, int dimworld>
inline int SElement<dim,dimworld>::corners ()
{
return 1<<dim;
}
template<int dim, int dimworld>
inline Vec<dimworld>& SElement<dim,dimworld>::operator[] (int i)
{
return c[i];
}
template<int dim, int dimworld>
inline SElement<dim,dim>& SElement<dim,dimworld>::refelem ()
{
return SElement<dim,dim>(); // this should not happen
}
template<int dimworld>
inline SElement<1,1>& SElement<1,dimworld>::refelem ()
{
return SGridrefelem1D;
}
template<int dimworld>
inline SElement<2,2>& SElement<2,dimworld>::refelem ()
{
return SGridrefelem2D;
}
template<int dimworld>
inline SElement<3,3>& SElement<3,dimworld>::refelem ()
{
return SGridrefelem3D;
}
template<int dim, int dimworld>
inline Vec<dimworld> SElement<dim,dimworld>::global (Vec<dim> local)
{
return A*local;
}
template<int dim, int dimworld>
inline Vec<dim> SElement<dim,dimworld>::local (Vec<dimworld> global)
{
Vec<dim> l; // result
Vec<dimworld> rhs = global-s;
for (int k=0; k<dim; k++)
l(k) = (rhs*A(k)) / (A(k)*A(k));
return l;
}
//************************************************************************
// inline methods for SEntity
// general
template<int codim, int dim, int dimworld>
inline int SEntity<codim,dim,dimworld>::level ()
{
return 0;
}
template<int codim, int dim, int dimworld>
inline int SEntity<codim,dim,dimworld>::index ()
{
return 0;
}
template<int codim, int dim, int dimworld>
inline SElement<dim-codim,dimworld> SEntity<codim,dim,dimworld>::geometry ()
{
return 0;
}
// codim 0
template<int dim, int dimworld> template<int cc>
inline int SEntity<0,dim,dimworld>::count ()
{
return 0;
}
template<int dim, int dimworld> template<int cc>
inline SLevelIterator<cc,dim,dimworld> SEntity<0,dim,dimworld>::entity (int i)
{
return SLevelIterator<cc,dim,dimworld>();
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>::NeighborIterator SEntity<0,dim,dimworld>::nbegin ()
{
return SEntity<0,dim,dimworld>::NeighborIterator();
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>::NeighborIterator SEntity<0,dim,dimworld>::nend ()
{
return SEntity<0,dim,dimworld>::NeighborIterator();
}
template<int dim, int dimworld>
inline SLevelIterator<0,dim,dimworld> SEntity<0,dim,dimworld>::father ()
{
return SLevelIterator<0,dim,dimworld>();
}
template<int dim, int dimworld>
inline SElement<dim,dim> SEntity<0,dim,dimworld>::father_relative_local ()
{
return SElement<dim,dim>();
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>::HierarchicIterator SEntity<0,dim,dimworld>::hbegin (int maxlevel)
{
return SEntity<0,dim,dimworld>::HierarchicIterator();
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>::HierarchicIterator SEntity<0,dim,dimworld>::hend (int maxlevel)
{
return SEntity<0,dim,dimworld>::HierarchicIterator();
}
// codim dim
template<int dim, int dimworld>
inline SLevelIterator<0,dim,dimworld> SEntity<dim,dim,dimworld>::father ()
{
return SLevelIterator<0,dim,dimworld>();
}
template<int dim, int dimworld>
inline Vec<dim> SEntity<dim,dim,dimworld>::local ()
{
return Vec<dim>();
}
//************************************************************************
// inline methods for HierarchicIterator
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>::HierarchicIterator SEntity<0,dim,dimworld>::HierarchicIterator::operator++ ()
{
return SEntity<0,dim,dimworld>::HierarchicIterator();
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>::HierarchicIterator SEntity<0,dim,dimworld>::HierarchicIterator::operator++ (int i)
{
return SEntity<0,dim,dimworld>::HierarchicIterator();
}
template<int dim, int dimworld>
inline bool SEntity<0,dim,dimworld>::HierarchicIterator::operator== (const SEntity<0,dim,dimworld>::HierarchicIterator& i) const
{
return true;
}
template<int dim, int dimworld>
inline bool SEntity<0,dim,dimworld>::HierarchicIterator::operator!= (const SEntity<0,dim,dimworld>::HierarchicIterator& i) const
{
return false;
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>& SEntity<0,dim,dimworld>::HierarchicIterator::operator* ()
{
return virtual_element;
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>* SEntity<0,dim,dimworld>::HierarchicIterator::operator-> ()
{
return &virtual_element;
}
//************************************************************************
// inline methods for NeighborIterator
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>::NeighborIterator SEntity<0,dim,dimworld>::NeighborIterator::operator++ ()
{
return SEntity<0,dim,dimworld>::NeighborIterator();
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>::NeighborIterator SEntity<0,dim,dimworld>::NeighborIterator::operator++ (int i)
{
return SEntity<0,dim,dimworld>::NeighborIterator();
}
template<int dim, int dimworld>
inline bool SEntity<0,dim,dimworld>::NeighborIterator::operator== (const SEntity<0,dim,dimworld>::NeighborIterator& i) const
{
return true;
}
template<int dim, int dimworld>
inline bool SEntity<0,dim,dimworld>::NeighborIterator::operator!= (const SEntity<0,dim,dimworld>::NeighborIterator& i) const
{
return false;
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>& SEntity<0,dim,dimworld>::NeighborIterator::operator* ()
{
return virtual_element;
}
template<int dim, int dimworld>
inline SEntity<0,dim,dimworld>* SEntity<0,dim,dimworld>::NeighborIterator::operator-> ()
{
return &virtual_element;
}
template<int dim, int dimworld>
inline SElement<dim-1,dim> SEntity<0,dim,dimworld>::NeighborIterator::intersection_self_local ()
{
return SElement<dim-1,dim>();
}
template<int dim, int dimworld>
inline SElement<dim-1,dimworld> SEntity<0,dim,dimworld>::NeighborIterator::intersection_self_global ()
{
return SElement<dim-1,dimworld>();
}
template<int dim, int dimworld>
inline int SEntity<0,dim,dimworld>::NeighborIterator::number_in_self ()
{
return 0;
}
template<int dim, int dimworld>
inline SElement<dim-1,dim> SEntity<0,dim,dimworld>::NeighborIterator::intersection_neighbor_local ()
{
return SElement<dim-1,dim>();
}
template<int dim, int dimworld>
inline SElement<dim-1,dimworld> SEntity<0,dim,dimworld>::NeighborIterator::intersection_neighbor_global ()
{
return SElement<dim-1,dimworld>();
}
template<int dim, int dimworld>
inline int SEntity<0,dim,dimworld>::NeighborIterator::number_in_neighbor ()
{
return 0;
}
//************************************************************************
// inline methods for SLevelIterator
template<int codim, int dim, int dimworld>
inline SLevelIterator<codim,dim,dimworld> SLevelIterator<codim,dim,dimworld>::operator++ ()
{
return SLevelIterator<codim,dim,dimworld>();
}
template<int codim, int dim, int dimworld>
inline SLevelIterator<codim,dim,dimworld> SLevelIterator<codim,dim,dimworld>::operator++ (int i)
{
return SLevelIterator<codim,dim,dimworld>();
}
template<int codim, int dim, int dimworld>
inline bool SLevelIterator<codim,dim,dimworld>::operator== (const SLevelIterator<codim,dim,dimworld>& i) const
{
return true;
}
template<int codim, int dim, int dimworld>
inline bool SLevelIterator<codim,dim,dimworld>::operator!= (const SLevelIterator<codim,dim,dimworld>& i) const
{
return false;
}
template<int codim, int dim, int dimworld>
inline SEntity<codim,dim,dimworld>& SLevelIterator<codim,dim,dimworld>::operator* ()
{
return virtual_element;
}
template<int codim, int dim, int dimworld>
inline SEntity<codim,dim,dimworld>* SLevelIterator<codim,dim,dimworld>::operator-> ()
{
return &virtual_element;
}
//************************************************************************
// inline methods for SGrid
template<int dim, int dimworld>
inline SGrid<dim,dimworld>::SGrid (double H_, int N0_, int L_)
{
H = H_; N0 = N0_; L = L_;
}
template<int dim, int dimworld>
inline int SGrid<dim,dimworld>::maxlevel ()
{
return L-1;
}
template <int dim, int dimworld> template <int codim>
inline SLevelIterator<codim,dim,dimworld> SGrid<dim,dimworld>::lbegin (int level)
{
return SLevelIterator<codim,dim,dimworld>();
}
template <int dim, int dimworld> template <int codim>
inline SLevelIterator<codim,dim,dimworld> SGrid<dim,dimworld>::lend (int level)
{
return SLevelIterator<codim,dim,dimworld>();
}
template<int dim, int dimworld>
inline int SGrid<dim,dimworld>::size (int level, int codim)
{
return 1;
}
} // end namespace
#endif
#FIG 3.2
Landscape
Center
Metric
A4
100.00
Single
-2
1200 2
6 3780 450 7155 2925
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
3825 495 7110 495 7110 2880 3825 2880 3825 495
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
3825 945 7110 945
4 0 0 50 0 0 12 0.0000 2 165 1950 4095 810 SElement<dim,dimworld>\001
4 0 0 50 0 0 12 0.0000 2 180 2100 4005 1350 - geometric part of an entity\001
4 0 0 50 0 0 12 0.0000 2 180 1245 4005 1575 - is a polyhedron\001
4 0 0 50 0 0 12 0.0000 2 135 2910 4005 1800 - knows transformation from reference\001
4 0 0 50 0 0 12 0.0000 2 180 915 4005 2025 polyhedron\001
4 0 0 50 0 0 12 0.0000 2 180 2520 4005 2250 - provides local to global mapping\001
4 0 0 50 0 0 12 0.0000 2 180 2520 4005 2475 - provides global to local mapping\001
4 0 0 50 0 0 12 0.0000 2 180 3030 4005 2700 - provides Jacobian, inverse and determ.\001
-6
6 4455 4410 5895 4995
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
4500 4815 5850 4815
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
4500 4455 5850 4455 5850 4950 4500 4950 4500 4455
4 0 0 50 0 0 12 0.0000 2 165 1155 4590 4725 Element<d,dd>\001
-6
6 4455 5220 6075 5805
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
4500 5625 6030 5625
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
4500 5265 6030 5265 6030 5760 4500 5760 4500 5265
4 0 0 50 0 0 12 0.0000 2 135 1365 4590 5535 HierarchicIterator\001
-6
6 6165 5220 7695 5805
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
6210 5625 7650 5625
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
6210 5265 7650 5265 7650 5760 6210 5760 6210 5265
4 0 0 50 0 0 12 0.0000 2 180 1260 6300 5535 NeighborIterator\001
-6
6 6075 4410 7740 4950
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
6120 4770 7695 4770
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
6120 4455 7695 4455 7695 4905 6120 4905 6120 4455
4 0 0 50 0 0 12 0.0000 2 135 1380 6210 4680 LevelIterator<cc>\001
-6
6 8055 1305 11430 2925
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
8100 1800 11385 1800
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
8100 1350 11385 1350 11385 2880 8100 2880 8100 1350
4 0 0 50 0 0 12 0.0000 2 135 2415 8280 2295 - allows iteration of entities of a\001
4 0 0 50 0 0 12 0.0000 2 180 2205 8280 2520 given codimension and level\001
4 0 0 50 0 0 12 0.0000 2 180 2235 8280 2745 - provides access to en entity\001
4 0 0 50 0 0 12 0.0000 2 165 2805 8280 1665 SLevelIterator<codim,dim,dimworld>\001
-6
6 1845 4410 3420 4995
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
1890 4815 3375 4815
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
1890 4455 3375 4455 3375 4950 1890 4950 1890 4455
4 0 0 50 0 0 12 0.0000 2 165 1155 1980 4725 Element<d,dd>\001
-6
6 8235 4455 9630 5040
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
8280 4860 9585 4860
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
8280 4500 9585 4500 9585 4995 8280 4995 8280 4500
4 0 0 50 0 0 12 0.0000 2 165 1155 8370 4770 Element<d,dd>\001
-6
6 9765 4455 11385 5040
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
9810 4860 11340 4860
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
9810 4500 11340 4500 11340 4995 9810 4995 9810 4500
4 0 0 50 0 0 12 0.0000 2 135 1380 9900 4770 LevelIterator<cc>\001
-6
6 3240 7065 10170 9180
6 7695 7785 9630 8370
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
7740 8145 9585 8145
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
7740 7830 9585 7830 9585 8325 7740 8325 7740 7830
4 0 0 50 0 0 12 0.0000 2 135 1650 7785 8055 LevelIterator<codim>\001
-6
6 3915 7785 5850 8370
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
3960 8145 5805 8145
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
3960 7830 5805 7830 5805 8325 3960 8325 3960 7830
4 0 0 50 0 0 12 0.0000 2 180 1125 4005 8055 Entity<codim>\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
3285 7515 10125 7515
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
3285 7110 10125 7110 10125 9135 3285 9135 3285 7110
4 0 0 50 0 0 12 0.0000 2 165 1650 5760 7380 SGrid<dim,dimworld>\001
4 0 0 50 0 0 12 0.0000 2 180 2145 3510 8910 - a container for grid entities\001
-6
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
585 3825 4050 3825 4050 5490 585 5490 585 3825
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
585 4185 4050 4185
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
4365 4185 7830 4185
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
4365 3825 7830 3825 7830 5985 4365 5985 4365 3825
2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
4635 2880 4365 3150 4905 3150 4635 2880
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
3195 4455 3195 3510 8865 3510 8865 4500
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
5490 3510 5490 4455
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
4590 3150 4590 3510
2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
9900 2880 9630 3150 10170 3150 9900 2880
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
8145 4230 11610 4230
2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
8145 3870 11610 3870 11610 5805 8145 5805 8145 3870
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
6885 4455 6885 3375 10530 3375 10530 4500
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
9900 3150 9900 3375
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 6
9405 7830 9405 6795 11925 6795 11925 3375 10440 3375 10350 3375
2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
1620 5490 1350 5760 1890 5760 1620 5490
2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
5265 5985 4995 6255 5535 6255 5265 5985
2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
9000 5805 8730 6075 9270 6075 9000 5805
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
1620 5760 1620 6615 9000 6615 9000 6075
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
5265 6255 5265 6615
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
4680 6615 4680 7830
4 0 0 50 0 0 12 0.0000 2 180 2280 765 4050 SEntity<codim,dim,dimworld>\001
4 0 0 50 0 0 12 0.0000 2 180 1920 4545 4050 SEntity<0,dim,dimworld>\001
4 0 0 50 0 0 12 0.0000 2 180 2100 8280 4095 SEntity<dim,dim,dimworld>\001
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment