Nektar++
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Nektar::RigidSolver Class Reference

#include <RigidSolver.h>

Public Member Functions

void InitObject (const LibUtilities::SessionReaderSharedPtr session, const MultiRegions::ExpListSharedPtr &pField, Array< OneD, NekDouble > pivot)
 
void SetMovableDoFs (std::vector< bool > &moveDoFs)
 
void SetInitialConditions (const LibUtilities::SessionReaderSharedPtr session, Array< OneD, NekDouble > MRFData)
 
void UpdateFrameVelocity (Array< OneD, NekDouble > &aeroforce, const NekDouble &time, Array< OneD, NekDouble > &MRFData)
 Updates the forcing array with the current required forcing.
 
void SetNewmarkBetaSolver (Array< OneD, NekDouble > &AddedMass)
 
void GetFilterInfo (const LibUtilities::SessionReaderSharedPtr session, std::map< std::string, std::string > &vParams)
 
bool HasFreeDoFs ()
 
void SetOldFvis (Array< OneD, NekDouble > force)
 

Protected Member Functions

void LoadParameters (const LibUtilities::SessionReaderSharedPtr session, const TiXmlElement *pSolver)
 
void InitBodySolver (const LibUtilities::SessionReaderSharedPtr session, const TiXmlElement *pSolver, Array< OneD, NekDouble > pivot)
 
NekDouble EvaluateExpression (const LibUtilities::SessionReaderSharedPtr session, std::string expression)
 
void UpdatePrescribed (const NekDouble &time, std::map< int, NekDouble > &Dirs)
 
void UpdateMRFData (Array< OneD, NekDouble > &MRFData)
 
void SetInitialConditions (std::map< int, NekDouble > &Dirs)
 
void SolveBodyMotion (Array< OneD, Array< OneD, NekDouble > > &bodyVel, const Array< OneD, NekDouble > &forcebody, std::map< int, NekDouble > &Dirs)
 
void ParserFunctionToMap (const bool allowzero, const LibUtilities::SessionReaderSharedPtr session, const std::string &FuncName, const std::string &var, std::map< int, LibUtilities::EquationSharedPtr > &result, const int i)
 
void CheckParameters ()
 

Private Member Functions

void SolveInertialFrame (Array< OneD, Array< OneD, NekDouble > > &bodyVel, const Array< OneD, NekDouble > &forcebody, std::map< int, NekDouble > &Dirs)
 
void SolveBodyFrame (Array< OneD, Array< OneD, NekDouble > > &bodyVel, const Array< OneD, NekDouble > &forcebody, std::map< int, NekDouble > &Dirs)
 
void SolveRotOneFree (Array< OneD, Array< OneD, NekDouble > > &bodyVel, const Array< OneD, NekDouble > &forcebody, std::map< int, NekDouble > &Dirs)
 

Private Attributes

int m_solveType
 
int m_index
 
NekDouble m_currentTime
 
NekDouble m_timestep
 
NekDouble m_beta
 
NekDouble m_gamma
 
int m_spacedim
 
bool m_isRoot
 
bool m_hasFreeMotion
 
bool m_hasRotation
 
int m_outputFrequency
 
std::ofstream m_outputStream
 
std::set< int > m_dirDoFs
 
Array< OneD, NekDoublem_inertialPosition
 
Array< OneD, Array< OneD, NekDouble > > m_vel
 
std::map< int, LibUtilities::EquationSharedPtrm_extForceFunction
 
std::map< int, LibUtilities::EquationSharedPtrm_frameVelFunction
 
Array< OneD, NekDoublem_extForceXYZ
 
Array< OneD, NekDoublem_pivot
 
NekDouble m_pivotdistance
 
Array< OneD, NekDoublem_oldFvis
 
NekDouble m_mass
 
NekDouble m_rotaionInertia
 
Array< OneD, NekDoublem_M
 
Array< OneD, NekDoublem_C
 
Array< OneD, NekDoublem_K
 
Newmark_BetaSolver m_bodySolver
 
FrameTransform m_frame
 

Detailed Description

Definition at line 106 of file RigidSolver.h.

Member Function Documentation

◆ CheckParameters()

void Nektar::RigidSolver::CheckParameters ( )
protected

Definition at line 83 of file RigidSolver.cpp.

84{
85 // Count free translational DoFs
86 int nFreeTrans = 0;
87 bool freeX = false;
88
89 for (int i = 0; i < m_spacedim; ++i)
90 {
91 if (m_dirDoFs.find(i) == m_dirDoFs.end())
92 {
93 ++nFreeTrans;
94 if (i == 0)
95 {
96 freeX = true;
97 }
98 }
99 }
100 if (!m_hasRotation)
101 {
102 m_solveType = 0; // inertial frame
103 }
104 else if (nFreeTrans == 1 && freeX)
105 {
106 m_solveType = 1; // with given rotation and only x free
107 if (m_spacedim >= 2)
108 {
109 m_dirDoFs.erase(1);
110 }
111 }
112 else if ((nFreeTrans == 2 || nFreeTrans == 0) && m_hasRotation)
113 {
114 m_solveType = 2; // full planar rigid solver (rotation involved)
115 }
116 else
117 {
118 ASSERTL0(false, "Unsupported rigid motion: this solver supports only "
119 "(i) translation-only motion, "
120 "(ii) x-only translation with optional rotation, or "
121 "(iii) full planar rigid-body motion.");
122 }
123 if (m_hasRotation)
124 {
125 m_inertialPosition = Array<OneD, NekDouble>(2, 0.);
126 // m_K should be zero
127 NekDouble sum = 0;
128 for (size_t i = 0; i < m_K.size(); ++i)
129 {
130 sum += fabs(m_K[i]);
131 }
132 for (size_t i = 0; i < m_C.size(); ++i)
133 {
134 sum += fabs(m_C[i]);
135 }
137 "C, K should be zero [in body frame solver].");
138 }
139}
#define ASSERTL0(condition, msg)
Array< OneD, NekDouble > m_C
std::set< int > m_dirDoFs
Array< OneD, NekDouble > m_inertialPosition
Array< OneD, NekDouble > m_K
static const NekDouble kNekZeroTol

References ASSERTL0, Nektar::NekConstants::kNekZeroTol, m_C, m_dirDoFs, m_hasRotation, m_inertialPosition, m_K, m_solveType, and m_spacedim.

Referenced by InitObject().

◆ EvaluateExpression()

NekDouble Nektar::RigidSolver::EvaluateExpression ( const LibUtilities::SessionReaderSharedPtr  session,
std::string  expression 
)
protected

Definition at line 173 of file RigidSolver.cpp.

175{
176 NekDouble value = 0.;
177 try
178 {
179 LibUtilities::Equation expession(session->GetInterpreter(), expression);
180 value = expession.Evaluate();
181 }
182 catch (const std::runtime_error &)
183 {
184 NEKERROR(ErrorUtil::efatal, "Error evaluating expression" + expression);
185 }
186 return value;
187}
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...

References Nektar::ErrorUtil::efatal, Nektar::LibUtilities::Equation::Evaluate(), and NEKERROR.

Referenced by InitBodySolver(), and LoadParameters().

◆ GetFilterInfo()

void Nektar::RigidSolver::GetFilterInfo ( const LibUtilities::SessionReaderSharedPtr  session,
std::map< std::string, std::string > &  vParams 
)

Definition at line 982 of file RigidSolver.cpp.

985{
986 TiXmlElement *pForce = session->GetElement("Nektar/RIGIDSOLVER");
987 const TiXmlElement *param = pForce->FirstChildElement("BOUNDARY");
988 ASSERTL0(param, "Body surface should be assigned");
989
990 vParams["Boundary"] = param->GetText();
991 const TiXmlElement *pivotElmt = pForce->FirstChildElement("PIVOTPOINT");
992 if (pivotElmt)
993 {
994 std::string pstr = pivotElmt->GetText();
995 std::replace(pstr.begin(), pstr.end(), ',', ' ');
996 vParams["MomentPoint"] = pstr;
997 }
998}

References ASSERTL0.

Referenced by Nektar::VCSFSI::InitialiseFilter().

◆ HasFreeDoFs()

bool Nektar::RigidSolver::HasFreeDoFs ( )
inline

Definition at line 122 of file RigidSolver.h.

123 {
124 return m_hasFreeMotion;
125 };

References m_hasFreeMotion.

Referenced by Nektar::VCSFSI::InitialiseFilter(), and Nektar::VCSFSI::v_SolveSolid().

◆ InitBodySolver()

void Nektar::RigidSolver::InitBodySolver ( const LibUtilities::SessionReaderSharedPtr  session,
const TiXmlElement *  pSolver,
Array< OneD, NekDouble pivot 
)
protected

Definition at line 329 of file RigidSolver.cpp.

332{
333 int NumDof = m_spacedim + 1;
334 const TiXmlElement *mssgTag;
335 std::string mssgStr;
336 // allocate memory and initialise
337 m_vel = Array<OneD, Array<OneD, NekDouble>>(3);
338 for (size_t i = 0; i < 3; ++i)
339 {
340 m_vel[i] = Array<OneD, NekDouble>(NumDof, 0.);
341 }
342 // read prescribed motion DoFs
343 m_dirDoFs.clear();
344 for (int i = 0; i < NumDof; ++i)
345 {
346 m_dirDoFs.insert(i);
347 }
348 mssgTag = pSolver->FirstChildElement("MOTIONPRESCRIBED");
349 if (mssgTag)
350 {
351 std::vector<std::string> values;
352 mssgStr = mssgTag->GetText();
353 ParseUtils::GenerateVector(mssgStr, values);
354 ASSERTL0(values.size() == NumDof,
355 "MOTIONPRESCRIBED vector should be of size " +
356 std::to_string(NumDof));
357 for (int i = 0; i < NumDof; ++i)
358 {
359 if (EvaluateExpression(session, values[i]) == 0)
360 {
361 m_dirDoFs.erase(i);
362 }
363 }
364 }
367 m_hasFreeMotion = m_dirDoFs.size() < NumDof;
368 // read mass matrix
369 m_M = Array<OneD, NekDouble>(NumDof * NumDof, 0.);
370 mssgTag = pSolver->FirstChildElement("MASS");
371 ASSERTL0(m_dirDoFs.size() == NumDof || mssgTag, "Mass matrix is required.");
372 if (mssgTag)
373 {
374 std::vector<std::string> values;
375 mssgStr = mssgTag->GetText();
376 ParseUtils::GenerateVector(mssgStr, values);
377 ASSERTL0(values.size() == 1, "Mass matrix should be a scalar.");
378 m_mass = EvaluateExpression(session, values[0]);
379 for (int i = 0; i < m_spacedim; ++i)
380 {
381 m_M[i + i * NumDof] = m_mass;
382 }
383 }
384 mssgTag = pSolver->FirstChildElement("ROTATIONINERTIA");
385 if (mssgTag)
386 {
387 std::vector<std::string> values;
388 mssgStr = mssgTag->GetText();
389 ParseUtils::GenerateVector(mssgStr, values);
390 ASSERTL0(values.size() == 1, "Inertia should be a scalar.");
391 m_rotaionInertia = EvaluateExpression(session, values[0]);
392 m_M[NumDof * NumDof - 1] = m_rotaionInertia;
393 }
394 // read damping matrix
395 m_C = Array<OneD, NekDouble>(NumDof * NumDof, 0.);
396 mssgTag = pSolver->FirstChildElement("DAMPING");
397 if (mssgTag)
398 {
399 std::vector<std::string> values;
400 mssgStr = mssgTag->GetText();
401 ParseUtils::GenerateVector(mssgStr, values);
402 ASSERTL0(values.size() == NumDof * NumDof,
403 "Damping matrix should be of size " + std::to_string(NumDof) +
404 "X" + std::to_string(NumDof));
405 int count = 0;
406 for (int i = 0; i < NumDof; ++i)
407 {
408 for (int j = 0; j < NumDof; ++j)
409 {
410 m_C[count] = EvaluateExpression(session, values[count]);
411 ++count;
412 }
413 }
414 }
415 // read rigidity matrix
416 m_K = Array<OneD, NekDouble>(NumDof * NumDof, 0.);
417 mssgTag = pSolver->FirstChildElement("RIGIDITY");
418 if (mssgTag)
419 {
420 std::vector<std::string> values;
421 mssgStr = mssgTag->GetText();
422 ParseUtils::GenerateVector(mssgStr, values);
423 ASSERTL0(values.size() == NumDof * NumDof,
424 "Rigidity matrix should be of size " + std::to_string(NumDof) +
425 "X" + std::to_string(NumDof));
426 int count = 0;
427 for (int i = 0; i < NumDof; ++i)
428 {
429 for (int j = 0; j < NumDof; ++j)
430 {
431 m_K[count] = EvaluateExpression(session, values[count]);
432 ++count;
433 }
434 }
435 }
436 // read pivot point
437 mssgTag = pSolver->FirstChildElement("PIVOTPOINT");
438 m_pivot = Array<OneD, NekDouble>(m_spacedim, 0.);
439 if (mssgTag)
440 {
441 std::vector<std::string> values;
442 mssgStr = mssgTag->GetText();
443 ParseUtils::GenerateVector(mssgStr, values);
444 ASSERTL0(values.size() == m_spacedim,
445 "PIVOTPOINT vector should be of size " +
446 std::to_string(m_spacedim));
447 for (int i = 0; i < m_spacedim; ++i)
448 {
449 m_pivot[i] = EvaluateExpression(session, values[i]);
450 }
451 }
452 Vmath::Vcopy(m_spacedim, m_pivot, 1, pivot, 1);
453 // read the distance between pivotpoint and masscenter
454 mssgTag = pSolver->FirstChildElement("PIVOTDISTANCE");
455 m_pivotdistance = 0.;
456 if (mssgTag)
457 {
458 std::vector<std::string> values;
459 mssgStr = mssgTag->GetText();
460 ParseUtils::GenerateVector(mssgStr, values);
461 ASSERTL0(values.size() == 1, "PivotDistance should be a scalar.");
462 m_pivotdistance = EvaluateExpression(session, values[0]);
463 }
464 // read Newmark Beta paramters
465 m_timestep = session->GetParameter("TimeStep");
466 m_beta = 0.25;
467 m_gamma = 0.51;
468 if (session->DefinesParameter("NewmarkBeta"))
469 {
470 m_beta = session->GetParameter("NewmarkBeta");
471 }
472 if (session->DefinesParameter("NewmarkGamma"))
473 {
474 m_gamma = session->GetParameter("NewmarkGamma");
475 }
476}
static bool GenerateVector(const std::string &str, std::vector< T > &out)
Takes a comma-separated string and converts it to entries in a vector.
Array< OneD, NekDouble > m_pivot
NekDouble m_pivotdistance
NekDouble EvaluateExpression(const LibUtilities::SessionReaderSharedPtr session, std::string expression)
NekDouble m_rotaionInertia
Array< OneD, NekDouble > m_M
Array< OneD, Array< OneD, NekDouble > > m_vel
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition Vmath.hpp:825

References ASSERTL0, EvaluateExpression(), Nektar::ParseUtils::GenerateVector(), m_beta, m_C, m_dirDoFs, m_gamma, m_hasFreeMotion, m_hasRotation, m_K, m_M, m_mass, m_pivot, m_pivotdistance, m_rotaionInertia, m_spacedim, m_timestep, m_vel, and Vmath::Vcopy().

Referenced by InitObject().

◆ InitObject()

void Nektar::RigidSolver::InitObject ( const LibUtilities::SessionReaderSharedPtr  session,
const MultiRegions::ExpListSharedPtr pField,
Array< OneD, NekDouble pivot 
)

Definition at line 56 of file RigidSolver.cpp.

59{
60 bool isH1d, isH2d;
61 session->MatchSolverInfo("Homogeneous", "1D", isH1d, false);
62 session->MatchSolverInfo("Homogeneous", "2D", isH2d, false);
63 bool singleMode, halfMode;
64 session->MatchSolverInfo("ModeType", "SingleMode", singleMode, false);
65 session->MatchSolverInfo("ModeType", "HalfMode", halfMode, false);
66 if (singleMode || halfMode)
67 {
68 isH1d = false;
69 }
70 int expdim = isH2d ? 1 : pField->GetGraph()->GetMeshDimension();
71 m_spacedim = expdim + (isH1d ? 1 : 0) + (isH2d ? 2 : 0);
72 m_isRoot = pField->GetComm()->TreatAsRankZero();
73 m_index = 1;
74 m_currentTime = -1.;
75 m_extForceXYZ = Array<OneD, NekDouble>(6, 0.0);
76 m_oldFvis = Array<OneD, NekDouble>(6, 0.0);
77 TiXmlElement *pSolver = session->GetElement("Nektar/RIGIDSOLVER");
78 LoadParameters(session, pSolver);
79 InitBodySolver(session, pSolver, pivot);
81}
void LoadParameters(const LibUtilities::SessionReaderSharedPtr session, const TiXmlElement *pSolver)
void InitBodySolver(const LibUtilities::SessionReaderSharedPtr session, const TiXmlElement *pSolver, Array< OneD, NekDouble > pivot)
Array< OneD, NekDouble > m_oldFvis
Array< OneD, NekDouble > m_extForceXYZ
NekDouble m_currentTime

References CheckParameters(), InitBodySolver(), LoadParameters(), m_currentTime, m_extForceXYZ, m_index, m_isRoot, m_oldFvis, and m_spacedim.

Referenced by Nektar::PressDecompVCSFSI::v_InitObject(), and Nektar::VCSFSI::v_InitObject().

◆ LoadParameters()

void Nektar::RigidSolver::LoadParameters ( const LibUtilities::SessionReaderSharedPtr  session,
const TiXmlElement *  pSolver 
)
protected

Definition at line 205 of file RigidSolver.cpp.

208{
209 const TiXmlElement *funcNameElmt;
210 // load frame velocity
211 funcNameElmt = pSolver->FirstChildElement("FRAMEVELOCITY");
212 if (funcNameElmt)
213 {
214 std::string FuncName = funcNameElmt->GetText();
215 ASSERTL0(session->DefinesFunction(FuncName),
216 "Function '" + FuncName + "' is not defined in the session.");
217 // linear velocity
218 for (int i = 0; i < m_spacedim; ++i)
219 {
220 std::string var = session->GetVariable(i);
221 ParserFunctionToMap(false, session, FuncName, var,
223 }
224 // linear displacement and acceleration
225 std::vector<std::string> linearDispVar = {"X", "Y", "Z"};
226 std::vector<std::string> linearAcceVar = {"A_x", "A_y", "A_z"};
227 for (int i = 0; i < m_spacedim; ++i)
228 {
229 ParserFunctionToMap(true, session, FuncName, linearDispVar[i],
230 m_frameVelFunction, i + 6);
231 ParserFunctionToMap(true, session, FuncName, linearAcceVar[i],
232 m_frameVelFunction, i + 12);
233 }
234 // angular velocities
235 std::vector<std::string> angularVar = {"Omega_x", "Omega_y", "Omega_z"};
236 m_hasRotation = false;
237 for (int i = 0; i < 3; ++i)
238 {
239 std::string var = angularVar[i];
240 ParserFunctionToMap(false, session, FuncName, var,
241 m_frameVelFunction, i + 3);
243 m_frameVelFunction.end();
244 }
245 // angular displacement and acceleration
246 std::vector<std::string> angularDispVar = {"Theta_x", "Theta_y",
247 "Theta_z"};
248 std::vector<std::string> angularAccepVar = {"DOmega_x", "DOmega_y",
249 "DOmega_z"};
250 for (int i = 0; i < 3; ++i)
251 {
252 ParserFunctionToMap(true, session, FuncName, angularDispVar[i],
253 m_frameVelFunction, i + 3 + 6);
254 ParserFunctionToMap(true, session, FuncName, angularAccepVar[i],
255 m_frameVelFunction, i + 3 + 12);
256 }
257 }
258
259 // load external force
260 funcNameElmt = pSolver->FirstChildElement("EXTERNALFORCE");
261 if (funcNameElmt)
262 {
263 std::string FuncName = funcNameElmt->GetText();
264 if (session->DefinesFunction(FuncName))
265 {
266 std::vector<std::string> forceVar = {"Fx", "Fy", "Fz"};
267 for (int i = 0; i < m_spacedim; ++i)
268 {
269 std::string var = forceVar[i];
270 ParserFunctionToMap(false, session, FuncName, var,
272 }
273 std::vector<std::string> momentVar = {"Mx", "My", "Mz"};
274 for (int i = 0; i < 3; ++i)
275 {
276 std::string var = momentVar[i];
277 ParserFunctionToMap(false, session, FuncName, var,
278 m_extForceFunction, i + 3);
279 }
280 }
281 }
282
283 // OutputFile
284 const TiXmlElement *mssgTag = pSolver->FirstChildElement("OutputFile");
285 std::string filename;
286 if (mssgTag)
287 {
288 filename = mssgTag->GetText();
289 }
290 else
291 {
292 filename = session->GetSessionName();
293 }
294 if (!(filename.length() >= 4 &&
295 filename.substr(filename.length() - 4) == ".mrf"))
296 {
297 filename += ".mrf";
298 }
299 if (m_isRoot)
300 {
301 m_outputStream.open(filename.c_str());
302 if (m_spacedim == 2)
303 {
305 << "Variables = t, x, ux, ax, y, uy, ay, theta, omega, domega"
306 << std::endl;
307 }
308 else if (m_spacedim == 3)
309 {
310 m_outputStream << "Variables = t, x, ux, ax, y, uy, ay, z, uz, az, "
311 "theta, omega, domega"
312 << std::endl;
313 }
314 }
315
316 // output frequency
318 mssgTag = pSolver->FirstChildElement("OutputFrequency");
319 if (mssgTag)
320 {
321 std::vector<std::string> values;
322 std::string mssgStr = mssgTag->GetText();
323 m_outputFrequency = round(EvaluateExpression(session, mssgStr));
324 }
326 "OutputFrequency should be greater than zero.");
327}
void ParserFunctionToMap(const bool allowzero, const LibUtilities::SessionReaderSharedPtr session, const std::string &FuncName, const std::string &var, std::map< int, LibUtilities::EquationSharedPtr > &result, const int i)
std::ofstream m_outputStream
std::map< int, LibUtilities::EquationSharedPtr > m_frameVelFunction
std::map< int, LibUtilities::EquationSharedPtr > m_extForceFunction

References ASSERTL0, EvaluateExpression(), m_extForceFunction, m_frameVelFunction, m_hasRotation, m_isRoot, m_outputFrequency, m_outputStream, m_spacedim, and ParserFunctionToMap().

Referenced by InitObject().

◆ ParserFunctionToMap()

void Nektar::RigidSolver::ParserFunctionToMap ( const bool  allowzero,
const LibUtilities::SessionReaderSharedPtr  session,
const std::string &  FuncName,
const std::string &  var,
std::map< int, LibUtilities::EquationSharedPtr > &  result,
const int  i 
)
protected

Definition at line 189 of file RigidSolver.cpp.

193{
194 if (session->DefinesFunction(FuncName, var))
195 {
197 session->GetFunction(FuncName, var);
198 if (allowzero || "0" != equ->GetExpression())
199 {
200 result[i] = equ;
201 }
202 }
203}
std::shared_ptr< Equation > EquationSharedPtr
Definition Equation.h:131

Referenced by LoadParameters().

◆ SetInitialConditions() [1/2]

void Nektar::RigidSolver::SetInitialConditions ( const LibUtilities::SessionReaderSharedPtr  session,
Array< OneD, NekDouble MRFData 
)

Definition at line 860 of file RigidSolver.cpp.

863{
864 NekDouble time = 0.;
865 std::map<std::string, std::string> fieldMetaDataMap;
866 std::vector<std::string> strFrameData = {
867 "X", "Y", "Z", "Theta_x", "Theta_y", "Theta_z",
868 "U", "V", "W", "Omega_x", "Omega_y", "Omega_z",
869 "A_x", "A_y", "A_z", "DOmega_x", "DOmega_y", "DOmega_z"};
870 std::map<std::string, NekDouble> fileData;
871 if (session->DefinesFunction("InitialConditions"))
872 {
873 for (int i = 0; i < session->GetVariables().size(); ++i)
874 {
875 if (session->GetFunctionType("InitialConditions",
876 session->GetVariable(i)) ==
878 {
879 std::string filename = session->GetFunctionFilename(
880 "InitialConditions", session->GetVariable(i));
881 fs::path pfilename(filename);
882 // redefine path for parallel file which is in directory
883 if (fs::is_directory(pfilename))
884 {
885 fs::path metafile("Info.xml");
886 fs::path fullpath = pfilename / metafile;
887 filename = LibUtilities::PortablePath(fullpath);
888 }
890 LibUtilities::FieldIO::CreateForFile(session, filename);
891 fld->ImportFieldMetaData(filename, fieldMetaDataMap);
892
893 // check to see if time is defined
894 if (fieldMetaDataMap != LibUtilities::NullFieldMetaDataMap)
895 {
896 if (fieldMetaDataMap.find("Time") != fieldMetaDataMap.end())
897 {
898 time = std::stod(fieldMetaDataMap["Time"]);
899 }
900 fileData.clear();
901 for (auto &var : strFrameData)
902 {
903 if (fieldMetaDataMap.find(var) !=
904 fieldMetaDataMap.end())
905 {
906 fileData[var] = std::stod(fieldMetaDataMap[var]);
907 }
908 }
909 if (fileData.size() == strFrameData.size())
910 {
911 break;
912 }
913 }
914 }
915 }
916 }
917 if (session->DefinesCmdLineArgument("set-start-time"))
918 {
919 time = std::stod(
920 session->GetCmdLineArgument<std::string>("set-start-time"));
921 }
922 if (fileData.size() == strFrameData.size())
923 {
924 int NumDofm1 = m_vel[0].size() - 1;
925 for (int i = 0; i < m_spacedim; ++i)
926 {
927 m_vel[0][i] = fileData[strFrameData[i]];
928 m_vel[1][i] = fileData[strFrameData[i + 6]];
929 m_vel[2][i] = fileData[strFrameData[i + 12]];
930 }
931 m_vel[0][NumDofm1] = fileData[strFrameData[5]];
932 m_vel[1][NumDofm1] = fileData[strFrameData[11]];
933 m_vel[2][NumDofm1] = fileData[strFrameData[17]];
934 if (m_hasRotation)
935 {
936 m_inertialPosition[0] = m_vel[0][0];
937 m_inertialPosition[1] = m_vel[0][1];
938 }
939 }
940 std::map<int, NekDouble> Dirs;
941 UpdatePrescribed(time, Dirs);
943 UpdateMRFData(MRFData);
944 // output initial status for rigid body
945 if (m_isRoot)
946 {
947 Array<OneD, Array<OneD, NekDouble>> tmpVel;
948 if (m_hasRotation)
949 {
950 tmpVel = Array<OneD, Array<OneD, NekDouble>>(m_vel.size());
951 for (size_t i = 0; i < m_vel.size(); ++i)
952 {
953 tmpVel[i] = Array<OneD, NekDouble>(m_vel[i].size());
954 Vmath::Vcopy(m_vel[i].size(), m_vel[i], 1, tmpVel[i], 1);
955 }
956 // transform u, du to body frame
957 Array<OneD, NekDouble> angle(3, 0.);
958 angle[2] = tmpVel[0][m_spacedim];
959 m_frame.SetAngle(angle);
960 m_frame.BodyToInerital(m_spacedim, tmpVel[1], tmpVel[1]);
961 m_frame.BodyToInerital(m_spacedim, tmpVel[2], tmpVel[2]);
962 tmpVel[2][0] -= tmpVel[1][m_spacedim] * tmpVel[1][1];
963 tmpVel[2][1] += tmpVel[1][m_spacedim] * tmpVel[1][0];
964 tmpVel[0][0] = m_inertialPosition[0];
965 tmpVel[0][1] = m_inertialPosition[1];
966 }
967 else
968 {
969 tmpVel = m_vel;
970 }
971 m_outputStream << boost::format("%25.19e") % time << " ";
972 for (size_t i = 0; i < tmpVel[0].size(); ++i)
973 {
974 m_outputStream << boost::format("%25.19e") % tmpVel[0][i] << " "
975 << boost::format("%25.19e") % tmpVel[1][i] << " "
976 << boost::format("%25.19e") % tmpVel[2][i] << " ";
977 }
978 m_outputStream << std::endl;
979 }
980}
void SetAngle(const Array< OneD, NekDouble > theta)
void BodyToInerital(const int dim, const Array< OneD, NekDouble > &body, Array< OneD, NekDouble > &inertial)
static std::shared_ptr< FieldIO > CreateForFile(const LibUtilities::SessionReaderSharedPtr session, const std::string &filename)
Construct a FieldIO object for a given input filename.
Definition FieldIO.cpp:223
void UpdateMRFData(Array< OneD, NekDouble > &MRFData)
void UpdatePrescribed(const NekDouble &time, std::map< int, NekDouble > &Dirs)
FrameTransform m_frame
void SetInitialConditions(const LibUtilities::SessionReaderSharedPtr session, Array< OneD, NekDouble > MRFData)
std::shared_ptr< FieldIO > FieldIOSharedPtr
Definition FieldIO.h:322
static std::string PortablePath(const fs::path &path)
create portable path on different platforms for std::filesystem path.
static FieldMetaDataMap NullFieldMetaDataMap
Definition FieldIO.h:51

References Nektar::FrameTransform::BodyToInerital(), Nektar::LibUtilities::FieldIO::CreateForFile(), Nektar::LibUtilities::eFunctionTypeFile, m_frame, m_hasRotation, m_inertialPosition, m_isRoot, m_outputStream, m_spacedim, m_vel, Nektar::LibUtilities::NullFieldMetaDataMap, Nektar::LibUtilities::PortablePath(), Nektar::FrameTransform::SetAngle(), SetInitialConditions(), UpdateMRFData(), UpdatePrescribed(), and Vmath::Vcopy().

Referenced by SetInitialConditions(), Nektar::PressDecompVCSFSI::v_DoInitialise(), and Nektar::VCSFSI::v_DoInitialise().

◆ SetInitialConditions() [2/2]

void Nektar::RigidSolver::SetInitialConditions ( std::map< int, NekDouble > &  Dirs)
protected

Definition at line 1000 of file RigidSolver.cpp.

1001{
1002 for (auto it : Dirs)
1003 {
1004 int NumDof = m_vel[0].size();
1005 int NumDof2 = NumDof << 1;
1006 if (it.first < m_vel[0].size())
1007 {
1008 m_vel[1][it.first] = it.second;
1009 }
1010 else if (it.first < NumDof2)
1011 {
1012 m_vel[0][it.first - NumDof] = it.second;
1013 }
1014 else
1015 {
1016 m_vel[2][it.first - NumDof2] = it.second;
1017 }
1018 }
1019}

References m_vel.

◆ SetMovableDoFs()

void Nektar::RigidSolver::SetMovableDoFs ( std::vector< bool > &  moveDoFs)

Definition at line 141 of file RigidSolver.cpp.

142{
143 for (const auto &it : m_frameVelFunction)
144 {
145 if (it.first < 6)
146 {
147 moveDoFs[it.first] = true;
148 }
149 }
150 for (int i = 0; i < m_spacedim; ++i)
151 {
152 if (m_dirDoFs.find(i) == m_dirDoFs.end())
153 {
154 moveDoFs[i] = true;
155 }
156 }
157 if (m_dirDoFs.find(m_spacedim) == m_dirDoFs.end())
158 {
159 moveDoFs[5] = true;
160 }
161 if (moveDoFs[5])
162 {
163 // since m_frameVelFunction is defined in inerital frame
164 // motions in 2 directions occur if there is rotation
165 if (moveDoFs[0] || moveDoFs[1])
166 {
167 moveDoFs[0] = true;
168 moveDoFs[1] = true;
169 }
170 }
171}

References m_dirDoFs, m_frameVelFunction, and m_spacedim.

Referenced by Nektar::PressDecompVCSFSI::v_InitObject(), and Nektar::VCSFSI::v_InitObject().

◆ SetNewmarkBetaSolver()

void Nektar::RigidSolver::SetNewmarkBetaSolver ( Array< OneD, NekDouble > &  AddedMass)

Definition at line 849 of file RigidSolver.cpp.

850{
851 int NumDof = m_spacedim + 1;
852 if (AddedMass.size() >= NumDof * NumDof)
853 {
854 Vmath::Vadd(NumDof * NumDof, AddedMass, 1, m_M, 1, m_M, 1);
855 }
858}
void SetNewmarkBeta(NekDouble beta, NekDouble gamma, NekDouble dt, Array< OneD, NekDouble > M, Array< OneD, NekDouble > C, Array< OneD, NekDouble > K, std::set< int > DirDoFs, int solveType)
Newmark_BetaSolver m_bodySolver
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition Vmath.hpp:180

References m_beta, m_bodySolver, m_C, m_dirDoFs, m_gamma, m_K, m_M, m_solveType, m_spacedim, m_timestep, Nektar::Newmark_BetaSolver::SetNewmarkBeta(), and Vmath::Vadd().

Referenced by Nektar::PressDecompVCSFSI::v_DoInitialise(), and Nektar::VCSFSI::v_DoInitialise().

◆ SetOldFvis()

void Nektar::RigidSolver::SetOldFvis ( Array< OneD, NekDouble force)

Definition at line 522 of file RigidSolver.cpp.

523{
524 for (int i = 0; i < 6; ++i)
525 {
526 m_oldFvis[i] = force[6 + i];
527 }
528}

References m_oldFvis.

Referenced by Nektar::PressDecompVCSFSI::v_DoInitialise(), and Nektar::VCSFSI::v_DoInitialise().

◆ SolveBodyFrame()

void Nektar::RigidSolver::SolveBodyFrame ( Array< OneD, Array< OneD, NekDouble > > &  bodyVel,
const Array< OneD, NekDouble > &  forcebody,
std::map< int, NekDouble > &  Dirs 
)
private

Definition at line 716 of file RigidSolver.cpp.

719{
720 m_bodySolver.SolvePrescribed(bodyVel, Dirs); // at most 1 rotation
721 Array<OneD, NekDouble> force(6, 0.), angle(3, 0.);
722 if (!m_hasFreeMotion)
723 {
724 angle[2] = bodyVel[0][m_spacedim];
725 m_frame.SetAngle(angle);
726 m_frame.IneritalToBody(m_spacedim, bodyVel[1], bodyVel[1]);
727 m_frame.IneritalToBody(m_spacedim, bodyVel[2], bodyVel[2]);
728 bodyVel[2][0] += bodyVel[1][m_spacedim] * bodyVel[1][1];
729 bodyVel[2][1] -= bodyVel[1][m_spacedim] * bodyVel[1][0];
730 return;
731 }
732 if (m_dirDoFs.find(m_spacedim) != m_dirDoFs.end())
733 {
734 // known rotation
735 angle[2] = bodyVel[0][m_spacedim];
736 m_frame.SetAngle(angle);
738 for (int i = 0; i < m_spacedim; ++i)
739 {
740 force[i] = forcebody[i] + force[i];
741 }
742 force[0] += m_mass * bodyVel[1][m_spacedim] * bodyVel[1][m_spacedim] *
744 force[1] -= m_mass * bodyVel[2][m_spacedim] * m_pivotdistance;
745 m_bodySolver.SolveFreeVarMat(bodyVel, force, m_mass);
746 }
747 else
748 {
749 // all free
750 Array<OneD, Array<OneD, NekDouble>> tmpbodyVel(bodyVel.size());
751 for (size_t i = 0; i < bodyVel.size(); ++i)
752 {
753 tmpbodyVel[i] = Array<OneD, NekDouble>(bodyVel[i].size());
754 Vmath::Vcopy(bodyVel[i].size(), bodyVel[i], 1, tmpbodyVel[i], 1);
755 }
756 for (int iter = 0; iter < 2; ++iter)
757 {
758 if (iter > 0)
759 {
760 for (size_t i = 0; i < bodyVel.size(); ++i)
761 {
762 Vmath::Vcopy(bodyVel[i].size() - 1, bodyVel[i], 1,
763 tmpbodyVel[i], 1);
764 }
765 }
766 angle[2] = tmpbodyVel[0][m_spacedim];
767 m_frame.SetAngle(angle);
769 for (int i = 0; i < m_spacedim; ++i)
770 {
771 force[i] = forcebody[i] + force[i];
772 }
773 force[m_spacedim] = forcebody[5] + m_extForceXYZ[5];
774 m_bodySolver.SolveFreeVarMat(tmpbodyVel, force, m_mass);
775 }
776 // copy final results
777 for (size_t i = 0; i < bodyVel.size(); ++i)
778 {
779 Vmath::Vcopy(bodyVel[i].size(), tmpbodyVel[i], 1, bodyVel[i], 1);
780 }
781 }
782}
void IneritalToBody(const int dim, const Array< OneD, NekDouble > &inertial, Array< OneD, NekDouble > &body)
void SolveFreeVarMat(Array< OneD, Array< OneD, NekDouble > > u, Array< OneD, NekDouble > force, const NekDouble mass)
void SolvePrescribed(Array< OneD, Array< OneD, NekDouble > > u, std::map< int, NekDouble > motionPrescribed)

References Nektar::FrameTransform::IneritalToBody(), m_bodySolver, m_dirDoFs, m_extForceXYZ, m_frame, m_hasFreeMotion, m_mass, m_pivotdistance, m_spacedim, Nektar::FrameTransform::SetAngle(), Nektar::Newmark_BetaSolver::SolveFreeVarMat(), Nektar::Newmark_BetaSolver::SolvePrescribed(), and Vmath::Vcopy().

Referenced by SolveBodyMotion().

◆ SolveBodyMotion()

void Nektar::RigidSolver::SolveBodyMotion ( Array< OneD, Array< OneD, NekDouble > > &  bodyVel,
const Array< OneD, NekDouble > &  forcebody,
std::map< int, NekDouble > &  Dirs 
)
protected

Definition at line 647 of file RigidSolver.cpp.

650{
651 if (0 == m_solveType)
652 {
653 SolveInertialFrame(bodyVel, forcebody, Dirs);
654 }
655 else if (1 == m_solveType)
656 {
657 SolveRotOneFree(bodyVel, forcebody, Dirs);
658 }
659 else if (2 == m_solveType)
660 {
661 SolveBodyFrame(bodyVel, forcebody, Dirs);
662 }
663 else
664 {
665 ASSERTL0(false, "Unsupported rigid solver type.");
666 }
667}
void SolveBodyFrame(Array< OneD, Array< OneD, NekDouble > > &bodyVel, const Array< OneD, NekDouble > &forcebody, std::map< int, NekDouble > &Dirs)
void SolveInertialFrame(Array< OneD, Array< OneD, NekDouble > > &bodyVel, const Array< OneD, NekDouble > &forcebody, std::map< int, NekDouble > &Dirs)
void SolveRotOneFree(Array< OneD, Array< OneD, NekDouble > > &bodyVel, const Array< OneD, NekDouble > &forcebody, std::map< int, NekDouble > &Dirs)

References ASSERTL0, m_solveType, SolveBodyFrame(), SolveInertialFrame(), and SolveRotOneFree().

Referenced by UpdateFrameVelocity().

◆ SolveInertialFrame()

void Nektar::RigidSolver::SolveInertialFrame ( Array< OneD, Array< OneD, NekDouble > > &  bodyVel,
const Array< OneD, NekDouble > &  forcebody,
std::map< int, NekDouble > &  Dirs 
)
private

Definition at line 669 of file RigidSolver.cpp.

672{
673 // only translational motion or prescribed tranlation with rotational
674 // solve in absolute frame and transform to body frame
675 m_bodySolver.SolvePrescribed(bodyVel, Dirs);
676 if (m_hasFreeMotion)
677 {
678 Array<OneD, NekDouble> force(6, 0.);
679 for (int i = 0; i < m_spacedim; ++i)
680 {
681 force[i] = forcebody[i] + m_extForceXYZ[i];
682 }
683 force[m_spacedim] = forcebody[5] + m_extForceXYZ[5];
684 m_bodySolver.SolveFreeFixMat(bodyVel, force);
685 }
686}
void SolveFreeFixMat(Array< OneD, Array< OneD, NekDouble > > u, Array< OneD, NekDouble > force)

References m_bodySolver, m_extForceXYZ, m_hasFreeMotion, m_spacedim, Nektar::Newmark_BetaSolver::SolveFreeFixMat(), and Nektar::Newmark_BetaSolver::SolvePrescribed().

Referenced by SolveBodyMotion().

◆ SolveRotOneFree()

void Nektar::RigidSolver::SolveRotOneFree ( Array< OneD, Array< OneD, NekDouble > > &  bodyVel,
const Array< OneD, NekDouble > &  forcebody,
std::map< int, NekDouble > &  Dirs 
)
private

Definition at line 689 of file RigidSolver.cpp.

692{
693 // one direction free
694 NekDouble uy = 0.;
695 if (Dirs.find(1) != Dirs.end())
696 {
697 uy = Dirs[1];
698 Dirs.erase(1);
699 }
700 m_bodySolver.SolvePrescribed(bodyVel, Dirs);
701 Array<OneD, NekDouble> force(6, 0.), angle(3, 0.);
702 angle[2] = bodyVel[0][m_spacedim];
703 m_frame.SetAngle(angle);
705 for (int i = 0; i < m_spacedim; ++i)
706 {
707 force[i] = forcebody[i] + force[i];
708 }
709 force[0] += m_mass * bodyVel[1][m_spacedim] * bodyVel[1][m_spacedim] *
711 force[1] -= m_mass * bodyVel[2][m_spacedim] * m_pivotdistance;
712 m_bodySolver.SolveOneFree(bodyVel, force, angle, uy, m_mass);
713}
void SolveOneFree(Array< OneD, Array< OneD, NekDouble > > u, Array< OneD, NekDouble > force, const Array< OneD, NekDouble > theta, const NekDouble uy, const NekDouble mass)

References Nektar::FrameTransform::IneritalToBody(), m_bodySolver, m_extForceXYZ, m_frame, m_mass, m_pivotdistance, m_spacedim, Nektar::FrameTransform::SetAngle(), Nektar::Newmark_BetaSolver::SolveOneFree(), and Nektar::Newmark_BetaSolver::SolvePrescribed().

Referenced by SolveBodyMotion().

◆ UpdateFrameVelocity()

void Nektar::RigidSolver::UpdateFrameVelocity ( Array< OneD, NekDouble > &  aeroforce,
const NekDouble time,
Array< OneD, NekDouble > &  MRFData 
)

Updates the forcing array with the current required forcing.

Parameters
pFields
time

Definition at line 535 of file RigidSolver.cpp.

538{
539 if (m_currentTime >= time)
540 {
541 return;
542 }
543
544 for (int i = 0; i < 6; ++i)
545 {
546 aeroforce[i] +=
547 2. * aeroforce[6 + i] - m_oldFvis[i]; // extrapolate viscous
548 m_oldFvis[i] = aeroforce[6 + i];
549 }
550 m_currentTime = time;
551 std::map<int, NekDouble> Dirs;
552 UpdatePrescribed(time, Dirs);
553 // compute the velocites whoes functions are provided in inertial frame
554 if (m_hasFreeMotion)
555 {
556 for (auto it : m_extForceFunction)
557 {
558 m_extForceXYZ[it.first] = it.second->Evaluate(0., 0., 0., time);
559 }
560 }
561 SolveBodyMotion(m_vel, aeroforce, Dirs);
562 Array<OneD, Array<OneD, NekDouble>> tmpVel;
563 if (m_hasRotation)
564 {
565 // update inertial position of the body
566 tmpVel = Array<OneD, Array<OneD, NekDouble>>(m_vel.size());
567 for (size_t i = 0; i < m_vel.size(); ++i)
568 {
569 tmpVel[i] = Array<OneD, NekDouble>(m_vel[i].size());
570 Vmath::Vcopy(m_vel[i].size(), m_vel[i], 1, tmpVel[i], 1);
571 }
572 Array<OneD, NekDouble> angle(3, 0.);
573 angle[2] = tmpVel[0][m_spacedim];
574 m_frame.SetAngle(angle);
575 m_frame.BodyToInerital(m_spacedim, tmpVel[1], tmpVel[1]);
576 m_frame.BodyToInerital(m_spacedim, tmpVel[2], tmpVel[2]);
577 tmpVel[2][0] -= tmpVel[1][m_spacedim] * tmpVel[1][1];
578 tmpVel[2][1] += tmpVel[1][m_spacedim] * tmpVel[1][0];
580 m_timestep * (tmpVel[1][0] + 0.5 * m_timestep * tmpVel[2][0]);
582 m_timestep * (tmpVel[1][1] + 0.5 * m_timestep * tmpVel[2][1]);
583 tmpVel[0][0] = m_inertialPosition[0];
584 tmpVel[0][1] = m_inertialPosition[1];
585 }
586 if (m_isRoot && m_index % m_outputFrequency == 0)
587 {
588 if (!m_hasRotation)
589 {
590 tmpVel = m_vel;
591 }
592 m_outputStream << boost::format("%25.19e") % time << " ";
593 for (size_t i = 0; i < tmpVel[0].size(); ++i)
594 {
595 m_outputStream << boost::format("%25.19e") % tmpVel[0][i] << " "
596 << boost::format("%25.19e") % tmpVel[1][i] << " "
597 << boost::format("%25.19e") % tmpVel[2][i] << " ";
598 }
599 m_outputStream << std::endl;
600 }
601 // set displacements at the current time step
602 UpdateMRFData(MRFData);
603 ++m_index;
604}
void SolveBodyMotion(Array< OneD, Array< OneD, NekDouble > > &bodyVel, const Array< OneD, NekDouble > &forcebody, std::map< int, NekDouble > &Dirs)

References Nektar::FrameTransform::BodyToInerital(), m_currentTime, m_extForceFunction, m_extForceXYZ, m_frame, m_hasFreeMotion, m_hasRotation, m_index, m_inertialPosition, m_isRoot, m_oldFvis, m_outputFrequency, m_outputStream, m_spacedim, m_timestep, m_vel, Nektar::FrameTransform::SetAngle(), SolveBodyMotion(), UpdateMRFData(), UpdatePrescribed(), and Vmath::Vcopy().

Referenced by Nektar::VCSFSI::v_SolveSolid().

◆ UpdateMRFData()

void Nektar::RigidSolver::UpdateMRFData ( Array< OneD, NekDouble > &  MRFData)
protected

MRFData: X, Y, Z, Theta_x, Theta_y, Theta_z, [inertial frame 0-5] U, V, W, Omega_x, Omega_y, Omega_z, [body frame 6-11] A_x, A_y, A_z, DOmega_x, DOmega_y, DOmega_z, [body frame 12-17] pivot_x, pivot_y, pivot_z, [body frame]

Definition at line 606 of file RigidSolver.cpp.

607{
608 /// MRFData:
609 /// X, Y, Z, Theta_x, Theta_y, Theta_z, [inertial frame 0-5]
610 /// U, V, W, Omega_x, Omega_y, Omega_z, [body frame 6-11]
611 /// A_x, A_y, A_z, DOmega_x, DOmega_y, DOmega_z, [body frame 12-17]
612 /// pivot_x, pivot_y, pivot_z, [body frame]
613 for (int i = 0; i < 18; ++i)
614 {
615 MRFData[i] = 0.0;
616 }
617
618 if (m_hasRotation)
619 {
620 MRFData[0] = m_inertialPosition[0];
621 MRFData[1] = m_inertialPosition[1];
622 }
623 else
624 {
625 MRFData[0] = m_vel[0][0];
626 MRFData[1] = m_vel[0][1];
627 }
628
629 if (m_hasRotation)
630 {
631 MRFData[5] = m_vel[0][m_spacedim];
632 }
633
634 for (int i = 0; i < m_spacedim; ++i)
635 {
636 MRFData[i + 6] = m_vel[1][i];
637 MRFData[i + 12] = m_vel[2][i];
638 }
639
640 if (m_hasRotation)
641 {
642 MRFData[11] = m_vel[1][m_spacedim];
643 MRFData[17] = m_vel[2][m_spacedim];
644 }
645}

References m_hasRotation, m_inertialPosition, m_spacedim, and m_vel.

Referenced by SetInitialConditions(), and UpdateFrameVelocity().

◆ UpdatePrescribed()

void Nektar::RigidSolver::UpdatePrescribed ( const NekDouble time,
std::map< int, NekDouble > &  Dirs 
)
protected

Definition at line 478 of file RigidSolver.cpp.

480{
481 int NumDof = m_spacedim + 1;
482 for (auto it : m_frameVelFunction)
483 {
484 if (it.first < 3)
485 {
486 Dirs[it.first] = it.second->Evaluate(0., 0., 0., time);
487 }
488 else if (it.first == 5)
489 {
490 Dirs[m_spacedim] = it.second->Evaluate(0., 0., 0., time);
491 }
492 else if (it.first < 9)
493 {
494 Dirs[NumDof + it.first - 6] = it.second->Evaluate(0., 0., 0., time);
495 }
496 else if (it.first == 11)
497 {
498 Dirs[NumDof + m_spacedim] = it.second->Evaluate(0., 0., 0., time);
499 }
500 else if (it.first < 15)
501 {
502 Dirs[(NumDof << 1) + it.first - 12] =
503 it.second->Evaluate(0., 0., 0., time);
504 }
505 else if (it.first == 17)
506 {
507 Dirs[(NumDof << 1) + m_spacedim] =
508 it.second->Evaluate(0., 0., 0., time);
509 }
510 }
511 for (auto i : m_dirDoFs)
512 {
513 if (Dirs.find(i) == Dirs.end())
514 {
515 Dirs[i] = 0.;
516 Dirs[i + NumDof] = 0.;
517 Dirs[i + (NumDof << 1)] = 0.;
518 }
519 }
520}

References m_dirDoFs, m_frameVelFunction, and m_spacedim.

Referenced by SetInitialConditions(), and UpdateFrameVelocity().

Member Data Documentation

◆ m_beta

NekDouble Nektar::RigidSolver::m_beta
private

Definition at line 170 of file RigidSolver.h.

Referenced by InitBodySolver(), and SetNewmarkBetaSolver().

◆ m_bodySolver

Newmark_BetaSolver Nektar::RigidSolver::m_bodySolver
private

◆ m_C

Array<OneD, NekDouble> Nektar::RigidSolver::m_C
private

Definition at line 197 of file RigidSolver.h.

Referenced by CheckParameters(), InitBodySolver(), and SetNewmarkBetaSolver().

◆ m_currentTime

NekDouble Nektar::RigidSolver::m_currentTime
private

Definition at line 168 of file RigidSolver.h.

Referenced by InitObject(), and UpdateFrameVelocity().

◆ m_dirDoFs

std::set<int> Nektar::RigidSolver::m_dirDoFs
private

◆ m_extForceFunction

std::map<int, LibUtilities::EquationSharedPtr> Nektar::RigidSolver::m_extForceFunction
private

Definition at line 186 of file RigidSolver.h.

Referenced by LoadParameters(), and UpdateFrameVelocity().

◆ m_extForceXYZ

Array<OneD, NekDouble> Nektar::RigidSolver::m_extForceXYZ
private

◆ m_frame

FrameTransform Nektar::RigidSolver::m_frame
private

◆ m_frameVelFunction

std::map<int, LibUtilities::EquationSharedPtr> Nektar::RigidSolver::m_frameVelFunction
private

Definition at line 187 of file RigidSolver.h.

Referenced by LoadParameters(), SetMovableDoFs(), and UpdatePrescribed().

◆ m_gamma

NekDouble Nektar::RigidSolver::m_gamma
private

Definition at line 171 of file RigidSolver.h.

Referenced by InitBodySolver(), and SetNewmarkBetaSolver().

◆ m_hasFreeMotion

bool Nektar::RigidSolver::m_hasFreeMotion
private

◆ m_hasRotation

bool Nektar::RigidSolver::m_hasRotation
private

◆ m_index

int Nektar::RigidSolver::m_index
private

Definition at line 167 of file RigidSolver.h.

Referenced by InitObject(), and UpdateFrameVelocity().

◆ m_inertialPosition

Array<OneD, NekDouble> Nektar::RigidSolver::m_inertialPosition
private

◆ m_isRoot

bool Nektar::RigidSolver::m_isRoot
private

◆ m_K

Array<OneD, NekDouble> Nektar::RigidSolver::m_K
private

Definition at line 198 of file RigidSolver.h.

Referenced by CheckParameters(), InitBodySolver(), and SetNewmarkBetaSolver().

◆ m_M

Array<OneD, NekDouble> Nektar::RigidSolver::m_M
private

Definition at line 196 of file RigidSolver.h.

Referenced by InitBodySolver(), and SetNewmarkBetaSolver().

◆ m_mass

NekDouble Nektar::RigidSolver::m_mass
private

Definition at line 194 of file RigidSolver.h.

Referenced by InitBodySolver(), SolveBodyFrame(), and SolveRotOneFree().

◆ m_oldFvis

Array<OneD, NekDouble> Nektar::RigidSolver::m_oldFvis
private

Definition at line 192 of file RigidSolver.h.

Referenced by InitObject(), SetOldFvis(), and UpdateFrameVelocity().

◆ m_outputFrequency

int Nektar::RigidSolver::m_outputFrequency
private

Definition at line 176 of file RigidSolver.h.

Referenced by LoadParameters(), and UpdateFrameVelocity().

◆ m_outputStream

std::ofstream Nektar::RigidSolver::m_outputStream
private

Definition at line 177 of file RigidSolver.h.

Referenced by LoadParameters(), SetInitialConditions(), and UpdateFrameVelocity().

◆ m_pivot

Array<OneD, NekDouble> Nektar::RigidSolver::m_pivot
private

Definition at line 189 of file RigidSolver.h.

Referenced by InitBodySolver().

◆ m_pivotdistance

NekDouble Nektar::RigidSolver::m_pivotdistance
private

Definition at line 190 of file RigidSolver.h.

Referenced by InitBodySolver(), SolveBodyFrame(), and SolveRotOneFree().

◆ m_rotaionInertia

NekDouble Nektar::RigidSolver::m_rotaionInertia
private

Definition at line 195 of file RigidSolver.h.

Referenced by InitBodySolver().

◆ m_solveType

int Nektar::RigidSolver::m_solveType
private

Definition at line 152 of file RigidSolver.h.

Referenced by CheckParameters(), SetNewmarkBetaSolver(), and SolveBodyMotion().

◆ m_spacedim

int Nektar::RigidSolver::m_spacedim
private

◆ m_timestep

NekDouble Nektar::RigidSolver::m_timestep
private

Definition at line 169 of file RigidSolver.h.

Referenced by InitBodySolver(), SetNewmarkBetaSolver(), and UpdateFrameVelocity().

◆ m_vel

Array<OneD, Array<OneD, NekDouble> > Nektar::RigidSolver::m_vel
private