takes data and fstat files and splits them into *.data.???? and *.fstat.???? files
More...
|
| CFile (std::string name) |
| Constructor. More...
|
|
| ~CFile () |
| Destructor. More...
|
|
bool | copy () |
|
| CFile (std::string name) |
| Constructor. More...
|
|
| ~CFile () |
| Destructor. More...
|
|
void | copy (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double timeMin, double timeMax, unsigned int periodic) |
|
void | writeP4P (double timeMin, double timeMax) |
|
void | writeP4C (std::fstream &fstat, double timeData) |
|
void | writeP4W (std::fstream &fstat, double timeData) |
|
void | writeRestart (double timeData, double density) |
|
std::string | getName (std::string type, unsigned int counter) |
|
| CFile (std::string name) |
| Constructor. More...
|
|
| ~CFile () |
| Destructor. More...
|
|
bool | copy (unsigned int stepsize, unsigned int counter) |
|
bool | copy_data (unsigned int stepsize, unsigned int counter) |
|
bool | copy_fstat (unsigned int stepsize, unsigned int counter) |
|
takes data and fstat files and splits them into *.data.???? and *.fstat.???? files
84 std::stringstream output_filename;
85 std::fstream output_file;
94 CX1 = CY1 = CZ1 = 0.0;
95 CX2 = CY2 = CZ2 = 0.0;
96 for (
unsigned int i=0;
i<
N;
i++) {
97 data_file >>
X >>
Y >>
Z >> VX >> VY >> VZ >>
R >> AX >> AY >>
AZ >> WX >> WY >> WZ >>
info;
102 CX +=
X*mass; CY +=
Y*mass; CZ +=
Z*mass;
M+=mass;
106 CX +=
X*mass; CY +=
Y*mass; CZ +=
Z*mass;
M+=mass;
111 CX1 +=
X*mass; CY1 +=
Y*mass; CZ1 +=
Z*mass;
M1+=mass;
113 CX2 +=
X*mass; CY2 +=
Y*mass; CZ2 +=
Z*mass;
M2+=mass;
120 CX1 +=
X*mass; CY1 +=
Y*mass; CZ1 +=
Z*mass;
M1+=mass;
122 CX2 +=
X*mass; CY2 +=
Y*mass; CZ2 +=
Z*mass;
M2+=mass;
127 com_file <<
T <<
" " << CX/
M <<
" " << CY/
M <<
" " << CZ/
M;
129 com_file <<
" " << CX2/
M2 <<
" " << CY2/
M2 <<
" " << CZ2/
M2 << std::endl;
131 com_file <<
T <<
" " << CX/
M <<
" " << CY/
M <<
" " << CZ/
M << std::endl;
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Eigen::Triplet< double > T
Definition: EigenUnitTest.cpp:11
@ AZ
Definition: StatisticsVector.h:21
@ R
Definition: StatisticsVector.h:21
M1<< 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12;Map< MatrixXf > M2(M1.data(), 6, 2)
MatrixXf M1
Definition: Tutorial_SlicingCol.cpp:1
Matrix< RealScalar, Dynamic, Dynamic > M
Definition: bench_gemm.cpp:50
int info0
Definition: centerofmass.cpp:152
int info1
Definition: centerofmass.cpp:152
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
@ N
Definition: constructor.cpp:22
#define X
Definition: icosphere.cpp:20
#define Z
Definition: icosphere.cpp:21
int info
Definition: level2_cplx_impl.h:39
line
Definition: calibrate.py:103
const char Y
Definition: test/EulerAngles.cpp:32
References AZ, com_file, data_file, i, info, info0, info1, calibrate::line, M1, M2(), N, R, splittinginfo, splittingradius, oomph::Global_string_for_annotation::string(), X, Y, and Z.
Referenced by main().
void CFile::writeP4C |
( |
std::fstream & |
fstat, |
|
|
double |
timeData |
|
) |
| |
|
inline |
187 double P1, P2,
delta, deltat, fn, ft;
192 p4c >> dummy >> dummy;
197 if (time < timeData * 0.999999)
199 logger(
INFO,
"reading p4c (t % N %): below timeMin; skipped", time,
N);
200 for (
unsigned int i = 0;
i <
N;
i++)
208 fstat <<
"# " << time <<
" " <<
N << std::endl;
209 fstat <<
"# " << std::endl;
210 fstat <<
"# " << std::endl;
214 for (
unsigned int i = 0;
i <
N;
i++)
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
double Mdouble
Definition: GeneralDefine.h:13
std::vector< Vec3D > position_
Definition: ConvertP4Files.cpp:423
void writeP4W(std::fstream &fstat, double timeData)
Definition: ConvertP4Files.cpp:300
std::vector< unsigned int > id_
Definition: ConvertP4Files.cpp:424
Definition: Kernel/Math/Vector.h:30
double C1
"Mooney Rivlin" coefficient for generalised Mooney Rivlin law
Definition: TwenteMeshGluing.cpp:74
double C2
"Mooney Rivlin" coefficient for generalised Mooney Rivlin law
Definition: mpi/distribution/airy_cantilever/airy_cantilever2.cc:156
int delta
Definition: MultiOpt.py:96
@ F
Definition: octree.h:74
t
Definition: plotPSD.py:36
References Global_Physical_Variables::C1, Global_Physical_Variables::C2, MultiOpt::delta, oomph::OcTreeNames::F, i, id_, INFO, calibrate::line, logger, n, N, p4c, periodic_, position_, oomph::Global_string_for_annotation::string(), plotPSD::t, writeP4W(), xmax_, and xmin_.
Referenced by writeP4P().
84 double ID, GROUP, VOLUME, MASS, VX, VY, VZ, Angular_Velocity_X, Angular_Velocity_Y, Angular_Velocity_Z;
86 unsigned int counter = 0;
91 p4p >> dummy >> dummy;
98 logger(
INFO,
"reading p4p (t % N %): timeMax reached; terminating", time,
N);
101 else if (time < timeMin)
103 logger(
INFO,
"reading p4p (t % N %): below timeMin; skipped", time,
N);
104 for (
unsigned int i = 0;
i <
N;
i++)
109 logger(
INFO,
"reading p4p (t % N % timestep #%)", time,
N, counter);
116 logger(
INFO,
"Files opened: % and %", dataName, fstatName);
126 <<
zmax_ << std::endl;
130 for (
unsigned int i=0;
i<
N;
i++) {
148 >> Angular_Velocity_X
149 >> Angular_Velocity_Y
150 >> Angular_Velocity_Z;
161 << Angular_Velocity_X <<
" "
162 << Angular_Velocity_Y <<
" "
163 << Angular_Velocity_Z <<
" "
int data[]
Definition: Map_placement_new.cpp:1
void writeP4C(std::fstream &fstat, double timeData)
Definition: ConvertP4Files.cpp:182
std::string getName(std::string type, unsigned int counter)
Definition: ConvertP4Files.cpp:396
void writeRestart(double timeData, double density)
Definition: ConvertP4Files.cpp:352
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
const Mdouble pi
Definition: ExtendedMath.h:23
References data, getName(), i, id_, INFO, calibrate::line, logger, N, out(), Global_Physical_Variables::P, p4p, constants::pi, position_, Eigen::bfloat16_impl::pow(), oomph::Global_string_for_annotation::string(), writeP4C(), writeRestart(), xmax_, xmin_, ymax_, ymin_, zmax_, and zmin_.
Referenced by copy().
void CFile::writeP4W |
( |
std::fstream & |
fstat, |
|
|
double |
timeData |
|
) |
| |
|
inline |
306 double P1,
delta, deltat, fn, ft;
311 p4w >> dummy >> dummy;
316 if (time < timeData * 0.999999)
318 logger(
INFO,
"reading p4w (t % N %): below timeMin; skipped", time,
N);
319 for (
unsigned int i = 0;
i <
N;
i++)
326 for (
unsigned int i = 0;
i <
N;
i++)
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:49
Definition: matrices.h:74
References MultiOpt::delta, oomph::OcTreeNames::F, i, id_, INFO, calibrate::line, logger, n, N, p4w, oomph::Global_string_for_annotation::string(), and plotPSD::t.
Referenced by writeP4C().
void CFile::writeRestart |
( |
double |
timeData, |
|
|
double |
density |
|
) |
| |
|
inline |
359 "restart_version 1.0 name " <<
name_ <<
"\n"
360 "dataFile name " <<
name_ <<
".data fileType MULTIPLE_FILES_PADDED saveCount 1 counter 1 nextSavedTimeStep 0\n"
361 "fStatFile name " <<
name_ <<
".fstat fileType MULTIPLE_FILES_PADDED saveCount 1 counter 1 nextSavedTimeStep 0\n"
362 "eneFile name " <<
name_ <<
".ene fileType ONE_FILE saveCount 1 counter 302 nextSavedTimeStep 0\n"
363 "restartFile name " <<
name_ <<
".restart fileType ONE_FILE saveCount 1 counter 1 nextSavedTimeStep 0\n"
364 "statFile name " <<
name_ <<
".stat fileType ONE_FILE saveCount 1 counter 0 nextSavedTimeStep 0\n"
371 "timeStep 0 time " << timeData <<
" ntimeSteps 0 timeMax " << timeData <<
"\n"
372 "systemDimensions 3 particleDimensions 3 gravity 0 0 -9.8\n"
374 "LinearViscoelasticSpecies id 0 density " <<
density <<
" stiffness 0 dissipation 0\n"
382 restart <<
"PeriodicBoundary id 0 normal 1 0 0 scaleFactor 1 distanceLeft " <<
xmin_ <<
" distanceRight " <<
xmax_ <<
" shift " <<
xmax_-
xmin_ <<
" 0 0\n";
384 restart <<
"PeriodicBoundary id 0 normal 0 1 0 scaleFactor 1 distanceLeft " <<
ymin_ <<
" distanceRight " <<
ymax_ <<
" shift " <<
ymax_-
ymin_ <<
" 0 0\n";
386 restart <<
"PeriodicBoundary id 0 normal 0 0 1 scaleFactor 1 distanceLeft " <<
zmin_ <<
" distanceRight " <<
zmax_ <<
" shift " <<
zmax_-
zmin_ <<
" 0 0\n";
390 "BaseParticle id 0 indSpecies 0 position 0 0 0 orientation 0 0 0 0 velocity 0 0 0 angularVelocity 0 0 0 0 force 0 0 0 torque 0 0 0 radius 0.5 invMass 1 invInertia 10\n"
Definition: restart2.cpp:8
References UniformPSDSelfTest::density, INFO, logger, name_, out(), periodic_, xmax_, xmin_, ymax_, ymin_, zmax_, and zmin_.
Referenced by writeP4P().