26 #ifndef HGRIDOPTIMIZER_H
27 #define HGRIDOPTIMIZER_H
47 void initialisePolyFunc(
double omega, std::vector<double>& coeff,
unsigned int numberOfCells,
int verbosity);
82 double pdfIntCell(
double start,
double end,
unsigned int i,
int p);
87 double pdfInt(
double start,
double end,
int power);
142 void calcDfDx(std::vector<double>& hGridCellSizes, std::vector<double>& dfdx,
HGridMethod method,
int verbosity);
147 double checkLimit(std::vector<double>& hGridCellSizes, std::vector<double>& dfdx,
int verbosity);
152 void applyStep(std::vector<double>& hGridCellSizes, std::vector<double>& dfdx,
double stepsize,
int verbosity);
157 double goldenSectionSearch(std::vector<double>& startHGridCellSizes, std::vector<double>& searchDirection,
double min,
double cur,
double max,
HGridMethod method,
int verbosity);
double goldenSectionSearch(std::vector< double > &startHGridCellSizes, std::vector< double > &searchDirection, double min, double cur, double max, HGridMethod method, int verbosity)
void getOptimalDistribution(std::vector< double > &hGridCellSizes, unsigned int numberOfLevels, HGridMethod method, int verbosity)
double diffPdfInt(double x, int power)
diff(int(f(r)*r^power*dr,r=s..e)/int(f(r)*dr,r=0..omega),e)=f(e)*e^power/int(f(r)*dr,r=0..omega)
double cell2Min(unsigned int i)
Computes the left bound of the cell with given ordinal number.
void initialisePolyFunc(double omega, std::vector< double > &coeff, unsigned int numberOfCells, int verbosity)
double calculateWork(std::vector< double > &hGridCellSizes, HGridMethod method, int verbosity)
The amount of work that has to be done to run a simulation using the HGrid, in steps.
double length_
The weighted length of the domain.
double diffStartExpectedCellsIntegral(double start, double end, int p, double h)
double intCell2Min(unsigned int i)
double cell2Max(unsigned int i)
Computes the right bound of the cell with given ordinal number.
double intCell2Max(unsigned int i)
void initialise(const MercuryBase &problem, unsigned int numberOfCells, int verbosity)
HGridMethod
Enum class that indicates how particles in different levels (cross level checking) of the HGrid are c...
double expectedCellsIntegral(double start, double end, int p, double h)
This function calculates: int((2*r/h+2)^d f(r) dr,r=s..e)/int(f(r) dr,r=s..e)+ Used to calculated the...
void calculateDiffWork(std::vector< double > &hGridCellSizes, std::vector< double > &dfdx, HGridMethod method, int verbosity)
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
void histNumberParticlesPerCell(std::vector< double > &hGridCellSizes)
double diffHExpectedCellsIntegralCellNumerator(double start, double end, unsigned int i, int p, double h)
void calcDfDx(std::vector< double > &hGridCellSizes, std::vector< double > &dfdx, HGridMethod method, int verbosity)
double rMax_
Radius of the largest particle, "rounded" to the smallest double that is larger than the radius of ea...
double expectedCellsIntegralCellDenominator(double start, double end, unsigned int i)
double checkLimit(std::vector< double > &hGridCellSizes, std::vector< double > &dfdx, int verbosity)
std::vector< double > cellN_
void applyStep(std::vector< double > &hGridCellSizes, std::vector< double > &dfdx, double stepsize, int verbosity)
double rMin_
Radius of the smallest particle, "rounded" to the largest double that is smaller than the radius of e...
std::vector< double > intCellN
unsigned int dimension_
The dimension of the system, usually 3, sometimes 2 or 1.
double cellCheckOverContactCheckRatio_
The ratio of the time required for a single geometric contact detection over the time required to ret...
double diffHExpectedCellsIntegral(double start, double end, int p, double h)
unsigned int radius2Cell(double r)
Assigns a BaseParticle of given radius to a certain cell.
double pdfIntCell(double start, double end, unsigned int i, int p)
double pdfInt(double start, double end, int power)
This function calculates: int(f(r)*r^power*dr,r=start..end)/int(f(r)*dr,r=0..omega) with r=a*r+b...
double expectedCellsIntegralCellNumerator(double start, double end, unsigned int i, int p, double h)
unsigned int numCells_
Number of cells, usually called levels in the HGrid.
double diffEndExpectedCellsIntegral(double start, double end, int p, double h)
unsigned int radius2IntCell(double r)