26 #ifndef BASE_COUPLING_H
27 #define BASE_COUPLING_H
46 template<
class M,
class O>
84 const Mdouble m = M::particleHandler.getMass();
85 const Vec3D com = M::particleHandler.getMassTimesPosition();
88 const static long int width = os.precision() + 6;
89 os << std::setw(width) << M::getTime()
91 <<
" " << std::setw(width) << M::particleHandler.getMomentum().
getX()
92 <<
" " << std::setw(width) << M::particleHandler.getMomentum().getY()
93 <<
" " << std::setw(width) << M::particleHandler.getMomentum().getZ()
94 <<
" " << std::setw(width) << M::particleHandler.getAngularMomentum().getX()
95 <<
" " << std::setw(width) << M::particleHandler.getAngularMomentum().getY()
96 <<
" " << std::setw(width) << M::particleHandler.getAngularMomentum().getZ()
97 <<
" " << std::setw(width) << -
Vec3D::dot(M::getGravity(), com)
98 <<
" " << std::setw(width) << M::particleHandler.getKineticEnergy()
99 <<
" " << std::setw(width) << M::particleHandler.getRotationalEnergy()
102 <<
" " << std::setw(width)
115 if (M::getAppend()) {
119 long width = os.precision() + 6;
120 os << std::setw(width)
121 <<
"time " << std::setw(width)
122 <<
"mass " << std::setw(width)
123 <<
"momentum_X " << std::setw(width)
124 <<
"momentum_Y " << std::setw(width)
125 <<
"momentum_Z " << std::setw(width)
126 <<
"angMomentum_X " << std::setw(width)
127 <<
"angMomentum_Y " << std::setw(width)
128 <<
"angMomentum_Z " << std::setw(width)
129 <<
"gravitEnergy " << std::setw(width)
130 <<
"traKineticEnergy " << std::setw(width)
131 <<
"rotKineticEnergy " << std::setw(width)
132 <<
"elasticEnergy " << std::setw(width)
133 <<
"centerOfMassX " << std::setw(width)
134 <<
"centerOfMassY " << std::setw(width)
135 <<
"centerOfMassZ\n";
143 O::actionsBeforeOomphTimeStep();
144 this->unsteady_newton_solve(this->time_pt()->dt());
152 for (
int n = 0;
n < nt; ++
n)
154 M::computeOneTimeStep();
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
std::string getName(int argc, char *argv[])
Definition: CombineParallelDataFiles.cpp:12
@ MULTIPLE_FILES
each time-step will be written into/read from separate files numbered consecutively: name_....
@ MULTIPLE_FILES_PADDED
each time-step will be written into/read from separate files numbered consecutively,...
Definition: BaseCoupling.h:48
bool CGMapping_
Definition: BaseCoupling.h:189
CGFunctions::LucyXYZ cgFunction_
Definition: BaseCoupling.h:191
std::string getName() const
Definition: BaseCoupling.h:64
bool useCGMapping()
Definition: BaseCoupling.h:181
void solveOomph()
Definition: BaseCoupling.h:141
void removeOldFiles() const
Definition: BaseCoupling.h:68
double getCGWidth()
Definition: BaseCoupling.h:176
void writeEneHeader(std::ostream &os) const override
Definition: BaseCoupling.h:112
void setName(std::string name)
Definition: BaseCoupling.h:59
CGFunctions::LucyXYZ getCGFunction()
Definition: BaseCoupling.h:184
void setCGWidth(const double &width)
Definition: BaseCoupling.h:158
void writeEneTimeStep(std::ostream &os) const override
Definition: BaseCoupling.h:76
void solveMercury(unsigned long nt)
Definition: BaseCoupling.h:150
void setWidth(Mdouble width)
Set the cutoff radius.
Mdouble Y
Definition: Vector.h:66
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:76
Mdouble getX() const
Definition: Vector.h:402
const Mdouble NaN
Definition: GeneralDefine.h:43
std::string name
Definition: MercuryProb.h:48