4 vector<double> &lengths)
8 lengths.resize(static_cast<size_t>(n));
9 for(
int i=0;i<npoints;++i)
13 int nedges=
static_cast<int>(edgesold.size());
14 int nedgesnew=
static_cast<int>(edgesnew.size());
15 for(
int j=0;j<nedges;++j)
17 Edge const& edge=tessold.
GetEdge(edgesold[static_cast<size_t>(j)]);
22 if((n0<i&&n0>=0)||(n1<i&&n1>=0))
24 for(
int k=0;k<nedgesnew;++k)
26 Edge const& edgenew=tessnew.
GetEdge(edgesnew[static_cast<size_t>((k+j)%nedgesnew)]);
36 lengths[
static_cast<size_t>(edgesold[
static_cast<size_t>(j)])]=0.5*(edge.
GetLength()+edgenew.
GetLength());
42 lengths[
static_cast<size_t>(edgesold[
static_cast<size_t>(j)])]=0.5*edge.
GetLength();
52 lengths.resize(static_cast<size_t>(n));
53 for(
int i=0;i<npoints;++i)
58 int nedges=
static_cast<int>(edgesold.size());
59 int nedgesnew=
static_cast<int>(edgesnew.size());
60 int nedgesmid=
static_cast<int>(edgesmid.size());
61 for(
int j=0;j<nedgesmid;++j)
63 Edge const& edge=tessmid.
GetEdge(edgesmid[static_cast<size_t>(j)]);
67 if((n0<i&&n0>=0)||(n1<i&&n1>=0))
69 lengths[
static_cast<size_t>(edgesmid[
static_cast<size_t>(j)])]=0.5*edge.
GetLength();
70 for(
int k=0;k<nedgesnew;++k)
72 Edge const& edgenew=tessnew.
GetEdge(edgesnew[static_cast<size_t>((k+j)%nedgesnew)]);
82 lengths[
static_cast<size_t>(edgesmid[
static_cast<size_t>(j)])]+=0.25*edgenew.
GetLength();
86 for(
int k=0;k<nedges;++k)
88 Edge const& edgeold=tessold.
GetEdge(edgesold[static_cast<size_t>((k+j)%nedges)]);
98 lengths[
static_cast<size_t>(edgesmid[
static_cast<size_t>(j)])]+=0.25*edgeold.
GetLength();
Abstract class for tessellation.
virtual int GetPointNo(void) const =0
Get Total number of mesh generating points.
virtual int GetOriginalIndex(int point) const
Returns the original index of the duplicated point.
Interface between two cells.
virtual Edge const & GetEdge(int index) const =0
Returns edge (interface between cells)
void CorrectEdgeLength(Tessellation const &tessold, Tessellation const &tessnew, vector< double > &lengths)
Corrects the length of the edges to be second order in time.
virtual int GetTotalSidesNumber(void) const =0
Returns the total number of faces.
std::pair< int, int > neighbors
Neighboring cells.
Attempts to improve the accuracy of the simulation by taking into accout the change in the length of ...
virtual vector< int > const & GetCellEdges(int index) const =0
Returns the indexes of a cell's edges.
double GetLength(void) const
Returns the length of the edge.