|
#include <algorithm>
#include <dirent.h>
#include <sys/types.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <sstream>
#include "Math/Matrix.h"
#include <CMakeDefinitions.h>
Go to the source code of this file.
Classes | |
struct | ClumpData |
Typedefs | |
typedef std::vector< double > | DoubleVector |
typedef std::vector< DoubleVector > | Double2DVector |
typedef std::vector< std::string > | StringVector |
Functions | |
bool | CompareFunction (std::string a, std::string b) |
double | RandomDouble (double Max) |
void | LoadConf (ClumpData &a) |
void | LoadPebbles (ClumpData &a) |
void | LoadMass (ClumpData &a) |
void | LoadTOI (ClumpData &a) |
void | LoadPD (ClumpData &a) |
void | LoadClumps (ClumpData &data, bool VERBOSE=false) |
ClumpData | RotateClump (ClumpData data, int clump_index, DoubleVector new_pd) |
DoubleVector | UniformRandomPDs () |
typedef std::vector<DoubleVector> Double2DVector |
typedef std::vector<double> DoubleVector |
typedef std::vector<std::string> StringVector |
bool CompareFunction | ( | std::string | a, |
std::string | b | ||
) |
Referenced by LoadConf().
// Main function that loads all the necessary files to initiate Clumps
References ClumpData::clumpNames, constants::i, INFO, LoadConf(), LoadMass(), LoadPD(), LoadPebbles(), LoadTOI(), logger, ClumpData::mass, ClumpData::pd, ClumpData::pebblesR, ClumpData::pebblesX, ClumpData::pebblesY, ClumpData::pebblesZ, ClumpData::toi, and VERBOSE.
Referenced by clumpTest::clumpTest(), and multiParticleT1::multiParticleT1().
void LoadConf | ( | ClumpData & | a | ) |
Loading available Clumps and their names
References ClumpData::clumpNames, CompareFunction(), getMercuryDPMSourceDir(), constants::i, and ClumpData::path.
Referenced by LoadClumps().
void LoadMass | ( | ClumpData & | a | ) |
Load mass of a clump
References ClumpData::clumpNames, constants::i, INFO, logger, ClumpData::mass, and ClumpData::path.
Referenced by LoadClumps().
void LoadPD | ( | ClumpData & | a | ) |
Load pre-computed principal directions (PDs) of a clump. Normally MClump tool aligns PDs with the global Cartesian axes.
References ClumpData::clumpNames, constants::i, INFO, logger, ClumpData::path, and ClumpData::pd.
Referenced by LoadClumps().
void LoadPebbles | ( | ClumpData & | a | ) |
Loading pebbles of a clump
References ClumpData::clumpNames, constants::i, INFO, logger, ClumpData::path, ClumpData::pebblesR, ClumpData::pebblesX, ClumpData::pebblesY, and ClumpData::pebblesZ.
Referenced by LoadClumps().
void LoadTOI | ( | ClumpData & | a | ) |
Load tensor of inertia (TOI) of a clump
References ClumpData::clumpNames, constants::i, INFO, logger, ClumpData::path, and ClumpData::toi.
Referenced by LoadClumps().
Referenced by multiParticleT1::setupInitialConditions(), and UniformRandomPDs().
ClumpData RotateClump | ( | ClumpData | data, |
int | clump_index, | ||
DoubleVector | new_pd | ||
) |
Changes PDs of the clump - sufficient for clump to be properly rotated
References ClumpData::pd.
Referenced by multiParticleT1::setupInitialConditions().
DoubleVector UniformRandomPDs | ( | ) |
Generate random (and isotropically distributed) principal directions frame
References mathsFunc::cos(), Vec3D::cross(), Vec3D::normalise(), RandomDouble(), mathsFunc::sin(), Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by multiParticleT1::setupInitialConditions().