ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
stretchZone.h
Go to the documentation of this file.
1//
2// ,---. ,--, .---. ,--, ,---. .-. .-.
3// | .-' .' .') / .-. ) .' .' | .-' | \| |
4// | `-. | |(_) | | |(_) | | __ | `-. | | |
5// | .-' \ \ | | | | \ \ ( _) | .-' | |\ |
6// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)|
7// /( __.' \____\ )---' )\____/ /( __.' /( (_)
8// (__) (_) (__) (__) (__)
9// Official webSite: https://code-mphi.github.io/ECOGEN/
10//
11// This file is part of ECOGEN.
12//
13// ECOGEN is the legal property of its developers, whose names
14// are listed in the copyright file included with this source
15// distribution.
16//
17// ECOGEN is free software: you can redistribute it and/or modify
18// it under the terms of the GNU General Public License as published
19// by the Free Software Foundation, either version 3 of the License,
20// or (at your option) any later version.
21//
22// ECOGEN is distributed in the hope that it will be useful,
23// but WITHOUT ANY WARRANTY; without even the implied warranty of
24// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25// GNU General Public License for more details.
26//
27// You should have received a copy of the GNU General Public License
28// along with ECOGEN (file LICENSE).
29// If not, see <http://www.gnu.org/licenses/>.
30
31#ifndef STRETCHZONE_H
32#define STRETCHZONE_H
33
34#include <vector>
35#include <string>
36
39
41{
42 public:
44 //
46 // size of reference cell and progression factor applied to reference cell.
47 // Store data needed to apply stretching later.
51 // and value greater than 1. mesh coarsening.
54 stretchZone(double startAt, double endtAt, double factor, double refCellSize, std::string refCellPos);
55 virtual ~stretchZone();
56
57 int stretching(std::vector<double>& dX, std::vector<double>& posX);
58
59 static int verifyStretching(std::vector<stretchZone>& tabStretch, const double l, std::string fileName = "");
60
61 // Accessors
62 const int& getNumberCells() const { return m_numberCells; };
63
64 private:
65 double m_startAt;
66 double m_endAt;
67 double m_factor;
70 std::string m_refCellPos;
71
72 int32_t safe_round_to_int32(double x) const;
73 void factorCorrection(double l);
74};
75
76#endif // STRETCHZONE_H
double m_startAt
zone starting position along corresponding axis
Definition stretchZone.h:65
stretchZone(double startAt, double endtAt, double factor, double refCellSize, std::string refCellPos)
Stretched zone constructor.
Definition stretchZone.cpp:42
std::string m_refCellPos
position of reference cell (start or end)
Definition stretchZone.h:70
const int & getNumberCells() const
Definition stretchZone.h:62
int m_numberCells
number of cells in the stretched zone
Definition stretchZone.h:69
int stretching(std::vector< double > &dX, std::vector< double > &posX)
Definition stretchZone.cpp:191
static int verifyStretching(std::vector< stretchZone > &tabStretch, const double l, std::string fileName="")
Definition stretchZone.cpp:238
double m_refCellSize
size of reference cell
Definition stretchZone.h:68
double m_factor
stretching factor (1. is no stretching)
Definition stretchZone.h:67
virtual ~stretchZone()
Definition stretchZone.cpp:120
int32_t safe_round_to_int32(double x) const
Definition stretchZone.cpp:124
double m_endAt
zone ending position along corresponding axis
Definition stretchZone.h:66
void factorCorrection(double l)
Definition stretchZone.cpp:141