View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003204 | OpenFOAM | Bug | public | 2019-03-20 04:34 | 2019-03-20 11:30 |
Reporter | handrake0724 | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Summary | 0003204: model_ member variable of restraint class shows different behaviors in constructor and restrain member function | ||||
Description | In the restraint class in rigidBodyDynamics, restraint class has different values for reference to rigidBodyModel. for example, in linearSpring class, the following two functions gives different values. //// constructor //// Foam::RBD::restraints::linearSpring::linearSpring ( const word& name, const dictionary& dict, const rigidBodyModel& model ) : restraint(name, dict, model) { ... // Info << refCast<const rigidBodyMotion>(model_).state().t() << endl; // not working // Info << refCast<const rigidBodyMotion>(model_).state().deltaT() << endl; // not working Info << static_cast<const rigidBodyMotion&>(model_).state().t() << endl; Info << static_cast<const rigidBodyMotion&>(model_).state().deltaT() << endl; } //// member function //// void Foam::RBD::restraints::linearSpring::restrain ( scalarField& tau, Field<spatialVector>& fx ) const { ... Info << refCast<const rigidBodyMotion>(model_).state().t() << endl; Info << refCast<const rigidBodyMotion>(model_).state().deltaT() << endl; } In the constructor, refCast is not working and static_cast looks working but the casted model_ does not give the right values (time step and current time) in rigidBodyModelState. On the other hand, in the restrain member function, refCast is working and gives right values of curent time and time step defined in system/controlDict. | ||||
Tags | No tags attached. | ||||
|
It is not clear what change you are proposing. |
|
In the constructor, there is no way to get time step and current time. I am not sure if this behavior is intended or not but it would be good to have a way to get time step and current time in constructor as in restraint member function. I am working on coupling restraint class with mooring library. the library need initialization with time step and the constructor is a proper place for it in my opinion. So I tested if the model_ is a rigidBodyMotion class or rigidBodyModel class because if model_ is a rigidBodyMotion object then I can get access to rigidBodyMotionState object. It turned out that time step and current time is not available in constructor. |
|
User support request |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-03-20 04:34 | handrake0724 | New Issue | |
2019-03-20 08:21 | henry | Note Added: 0010385 | |
2019-03-20 11:12 | handrake0724 | Note Added: 0010386 | |
2019-03-20 11:30 | henry | Assigned To | => henry |
2019-03-20 11:30 | henry | Status | new => closed |
2019-03-20 11:30 | henry | Resolution | open => no change required |
2019-03-20 11:30 | henry | Note Added: 0010387 |