5 #ifndef BASE_COUPLING_H
6 #define BASE_COUPLING_H
25 template<
class M,
class O>
63 const Mdouble m = M::particleHandler.getMass();
64 const Vec3D com = M::particleHandler.getMassTimesPosition();
67 const static long int width = os.precision() + 6;
68 os << std::setw(width) << M::getTime()
70 <<
" " << std::setw(width) << M::particleHandler.getMomentum().
getX()
71 <<
" " << std::setw(width) << M::particleHandler.getMomentum().getY()
72 <<
" " << std::setw(width) << M::particleHandler.getMomentum().getZ()
73 <<
" " << std::setw(width) << M::particleHandler.getAngularMomentum().getX()
74 <<
" " << std::setw(width) << M::particleHandler.getAngularMomentum().getY()
75 <<
" " << std::setw(width) << M::particleHandler.getAngularMomentum().getZ()
76 <<
" " << std::setw(width) << -
Vec3D::dot(M::getGravity(), com)
77 <<
" " << std::setw(width) << M::particleHandler.getKineticEnergy()
78 <<
" " << std::setw(width) << M::particleHandler.getRotationalEnergy()
81 <<
" " << std::setw(width)
98 long width = os.precision() + 6;
99 os << std::setw(width)
100 <<
"time " << std::setw(width)
101 <<
"mass " << std::setw(width)
102 <<
"momentum_X " << std::setw(width)
103 <<
"momentum_Y " << std::setw(width)
104 <<
"momentum_Z " << std::setw(width)
105 <<
"angMomentum_X " << std::setw(width)
106 <<
"angMomentum_Y " << std::setw(width)
107 <<
"angMomentum_Z " << std::setw(width)
108 <<
"gravitEnergy " << std::setw(width)
109 <<
"traKineticEnergy " << std::setw(width)
110 <<
"rotKineticEnergy " << std::setw(width)
111 <<
"elasticEnergy " << std::setw(width)
112 <<
"centerOfMassX " << std::setw(width)
113 <<
"centerOfMassY " << std::setw(width)
114 <<
"centerOfMassZ\n";
122 O::actionsBeforeOomphTimeStep();
127 this->unsteady_newton_solve(this->time_pt()->dt());
131 this->unsteady_newton_solve(this->time_pt()->dt(), max_adapt,
false);
140 double residualNorm = residual.
max();
141 if (residualNorm == 0) {
142 logger(
ERROR,
"Maximum residuals %; the computation has failed and the code will exit", residualNorm);
151 for (
int n = 0;
n < nt; ++
n)
153 M::computeOneTimeStep();
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
std::string getName(int argc, char *argv[])
Definition: CombineParallelDataFiles.cpp:16
@ 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,...
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Definition: BaseCoupling.h:27
bool CGMapping_
Definition: BaseCoupling.h:188
void solveOomph(int max_adapt=0)
Definition: BaseCoupling.h:120
CGFunctions::LucyXYZ cgFunction_
Definition: BaseCoupling.h:190
std::string getName() const
Definition: BaseCoupling.h:43
bool useCGMapping()
Definition: BaseCoupling.h:180
void checkResidual()
Definition: BaseCoupling.h:137
void removeOldFiles() const
Definition: BaseCoupling.h:47
double getCGWidth()
Definition: BaseCoupling.h:175
void writeEneHeader(std::ostream &os) const override
Definition: BaseCoupling.h:91
void setName(std::string name)
Definition: BaseCoupling.h:38
CGFunctions::LucyXYZ getCGFunction()
Definition: BaseCoupling.h:183
void setCGWidth(const double &width)
Definition: BaseCoupling.h:157
void writeEneTimeStep(std::ostream &os) const override
Definition: BaseCoupling.h:55
void solveMercury(unsigned long nt)
Definition: BaseCoupling.h:149
void setWidth(Mdouble width)
Set the cutoff radius.
Definition: Kernel/Math/Vector.h:30
Mdouble Y
Definition: Kernel/Math/Vector.h:45
Mdouble Z
Definition: Kernel/Math/Vector.h:45
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:56
Mdouble getX() const
Definition: Kernel/Math/Vector.h:431
Definition: double_vector.h:58
double max() const
returns the maximum coefficient
Definition: double_vector.cc:604
int * m
Definition: level2_cplx_impl.h:294
void get_residuals(const Vector< double > ¶m, const Vector< double > &unknowns, Vector< double > &residuals)
Global residual fct.
Definition: spring_contact.cc:65
const Mdouble NaN
Definition: GeneralDefine.h:22
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
string name
Definition: plotDoE.py:33