ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
stretchZone Class Reference

managing a stretched zone in Cartesian meshes More...

#include <stretchZone.h>

Public Member Functions

 stretchZone (double startAt, double endtAt, double factor, double refCellSize, std::string refCellPos)
 Stretched zone constructor.
virtual ~stretchZone ()
int stretching (std::vector< double > &dX, std::vector< double > &posX)
const int & getNumberCells () const

Static Public Member Functions

static int verifyStretching (std::vector< stretchZone > &tabStretch, const double l, std::string fileName="")

Private Member Functions

int32_t safe_round_to_int32 (double x) const
void factorCorrection (double l)

Private Attributes

double m_startAt
 zone starting position along corresponding axis
double m_endAt
 zone ending position along corresponding axis
double m_factor
 stretching factor (1. is no stretching)
double m_refCellSize
 size of reference cell
int m_numberCells
 number of cells in the stretched zone
std::string m_refCellPos
 position of reference cell (start or end)

Detailed Description

managing a stretched zone in Cartesian meshes

Constructor & Destructor Documentation

◆ stretchZone()

stretchZone::stretchZone ( double startAt,
double endtAt,
double factor,
double refCellSize,
std::string refCellPos )

Stretched zone constructor.

Stretched zone constructor: compute number of cells from mesh stretching area size,

Parameters
startAtposition of beginning of mesh stretching area
endAtposition of end of mesh stretching area
factormesh stretching factor: 1. means no stretching, value lower than 1. means mesh shrinking
refCellSizesize of reference cell to which mesh stretching factor is applied
refCellPosposition of the reference cell ('end' or 'start')

Recall:

  • geometric sequence is defined by:
    • \( u_{n+1} = u_n * q \)
    • \( u_n = u_0 * q^n \)
  • the sum is given by: \( sum_{k = 0}^{n} u_k = u_0 (1 - q^{n+1}) / (1 - q) \)
  • If we note l the length of the stretching area, we want:
    • \( u_0 = l = S_0 \) when we have only 1 cell in the stretching area.
    • i.e., \( Nc = n+1 \), with Nc the number of cells in the stretching area.
    • and \( l = S_{Nc-1} \).

In consequence, we have \( Nc = \frac{ ln(1-(1-q)*l/u_0) }{ ln(q) } \).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~stretchZone()

stretchZone::~stretchZone ( )
virtual

Member Function Documentation

◆ factorCorrection()

void stretchZone::factorCorrection ( double l)
private
Here is the caller graph for this function:

◆ getNumberCells()

const int & stretchZone::getNumberCells ( ) const
inline

◆ safe_round_to_int32()

int32_t stretchZone::safe_round_to_int32 ( double x) const
private
Here is the caller graph for this function:

◆ stretching()

int stretchZone::stretching ( std::vector< double > & dX,
std::vector< double > & posX )

◆ verifyStretching()

int stretchZone::verifyStretching ( std::vector< stretchZone > & tabStretch,
const double l,
std::string fileName = "" )
static
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_endAt

double stretchZone::m_endAt
private

zone ending position along corresponding axis

◆ m_factor

double stretchZone::m_factor
private

stretching factor (1. is no stretching)

◆ m_numberCells

int stretchZone::m_numberCells
private

number of cells in the stretched zone

◆ m_refCellPos

std::string stretchZone::m_refCellPos
private

position of reference cell (start or end)

◆ m_refCellSize

double stretchZone::m_refCellSize
private

size of reference cell

◆ m_startAt

double stretchZone::m_startAt
private

zone starting position along corresponding axis


The documentation for this class was generated from the following files:
  • /home/runner/work/ECOGEN/ECOGEN/doc_sources/src/Meshes/stretchZone.h
  • /home/runner/work/ECOGEN/ECOGEN/doc_sources/src/Meshes/stretchZone.cpp