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);
143 void calcDfDx(std::vector<double>& hGridCellSizes, std::vector<double>& dfdx,
HGridMethod method,
int verbosity);
148 double checkLimit(std::vector<double>& hGridCellSizes, std::vector<double>& dfdx,
int verbosity);
153 void applyStep(std::vector<double>& hGridCellSizes, std::vector<double>& dfdx,
double stepsize,
int verbosity);
159 goldenSectionSearch(std::vector<double>& startHGridCellSizes, std::vector<double>& searchDirection,
double min,
160 double cur,
double max,
HGridMethod method,
int verbosity);
HGridMethod
Enum class that indicates how particles in different levels (cross level checking) of the HGrid are c...
Definition: MercuryBase.h:44
Definition: HGridOptimiser.h:37
double pdfInt(double start, double end, int power)
Definition: HGridOptimiser.cc:224
double diffStartExpectedCellsIntegral(double start, double end, int p, double h)
Definition: HGridOptimiser.cc:353
double goldenSectionSearch(std::vector< double > &startHGridCellSizes, std::vector< double > &searchDirection, double min, double cur, double max, HGridMethod method, int verbosity)
Definition: HGridOptimiser.cc:984
unsigned int dimension_
The dimension of the system, usually 3, sometimes 2 or 1.
Definition: HGridOptimiser.h:206
double checkLimit(std::vector< double > &hGridCellSizes, std::vector< double > &dfdx, int verbosity)
Definition: HGridOptimiser.cc:902
unsigned int numCells_
Number of cells, usually called levels in the HGrid.
Definition: HGridOptimiser.h:177
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,...
Definition: HGridOptimiser.cc:261
double expectedCellsIntegral(double start, double end, int p, double h)
Definition: HGridOptimiser.cc:323
double diffEndExpectedCellsIntegral(double start, double end, int p, double h)
Definition: HGridOptimiser.cc:394
double expectedCellsIntegralCellNumerator(double start, double end, unsigned int i, int p, double h)
Definition: HGridOptimiser.cc:275
double diffHExpectedCellsIntegral(double start, double end, int p, double h)
Definition: HGridOptimiser.cc:434
void calcDfDx(std::vector< double > &hGridCellSizes, std::vector< double > &dfdx, HGridMethod method, int verbosity)
Definition: HGridOptimiser.cc:878
double rMax_
Radius of the largest particle, "rounded" to the smallest double that is larger than the radius of ea...
Definition: HGridOptimiser.h:187
void histNumberParticlesPerCell(std::vector< double > &hGridCellSizes)
Definition: HGridOptimiser.cc:1095
std::vector< double > intCellN
Definition: HGridOptimiser.h:212
double diffHExpectedCellsIntegralCellNumerator(double start, double end, unsigned int i, int p, double h)
Definition: HGridOptimiser.cc:290
void initialisePolyFunc(double omega, std::vector< double > &coeff, unsigned int numberOfCells, int verbosity)
Definition: HGridOptimiser.cc:110
double pdfIntCell(double start, double end, unsigned int i, int p)
Definition: HGridOptimiser.cc:213
std::vector< double > cellN_
Definition: HGridOptimiser.h:211
double cell2Min(unsigned int i)
Computes the left bound of the cell with given ordinal number.
Definition: HGridOptimiser.cc:200
void getOptimalDistribution(std::vector< double > &hGridCellSizes, unsigned int numberOfLevels, HGridMethod method, int verbosity)
Definition: HGridOptimiser.cc:1043
double cellCheckOverContactCheckRatio_
The ratio of the time required for a single geometric contact detection over the time required to ret...
Definition: HGridOptimiser.h:202
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.
Definition: HGridOptimiser.cc:728
double cell2Max(unsigned int i)
Computes the right bound of the cell with given ordinal number.
Definition: HGridOptimiser.cc:208
void calculateDiffWork(std::vector< double > &hGridCellSizes, std::vector< double > &dfdx, HGridMethod method, int verbosity)
Definition: HGridOptimiser.cc:463
double length_
The weighted length of the domain.
Definition: HGridOptimiser.h:195
double rMin_
Radius of the smallest particle, "rounded" to the largest double that is smaller than the radius of e...
Definition: HGridOptimiser.h:182
void applyStep(std::vector< double > &hGridCellSizes, std::vector< double > &dfdx, double stepsize, int verbosity)
Definition: HGridOptimiser.cc:966
unsigned int radius2Cell(double r)
Assigns a BaseParticle of given radius to a certain cell.
Definition: HGridOptimiser.cc:165
void initialise(const MercuryBase &problem, unsigned int numberOfCells, int verbosity)
Definition: HGridOptimiser.cc:33
double expectedCellsIntegralCellDenominator(double start, double end, unsigned int i)
Definition: HGridOptimiser.cc:312
unsigned int radius2IntCell(double r)
Definition: HGridOptimiser.cc:173
double intCell2Min(unsigned int i)
Definition: HGridOptimiser.cc:181
double intCell2Max(unsigned int i)
Definition: HGridOptimiser.cc:189
This is the base class for both Mercury2D and Mercury3D. Note the actually abstract grid is defined i...
Definition: MercuryBase.h:126
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51