diff --git a/src/dynamicMesh/motionSolver/motionSolver/motionSolver.C b/src/dynamicMesh/motionSolver/motionSolver/motionSolver.C index 01f37cbf62247749acc5cdf0b650df385a2c795a..5613ac6b4103f435b47868192734bd63237e8065 100644 --- a/src/dynamicMesh/motionSolver/motionSolver/motionSolver.C +++ b/src/dynamicMesh/motionSolver/motionSolver/motionSolver.C @@ -190,4 +190,19 @@ bool Foam::motionSolver::writeObject } +bool Foam::motionSolver::read() +{ + if (regIOobject::read()) + { + coeffDict_ = subDict(type() + "Coeffs"); + + return true; + } + else + { + return false; + } +} + + // ************************************************************************* // diff --git a/src/dynamicMesh/motionSolver/motionSolver/motionSolver.H b/src/dynamicMesh/motionSolver/motionSolver/motionSolver.H index 7a53d4e81d7bd7582bd4a0195cb7772f76f4452f..651c0d9d1831f399c8bc5bf25188a762ef0d31d3 100644 --- a/src/dynamicMesh/motionSolver/motionSolver/motionSolver.H +++ b/src/dynamicMesh/motionSolver/motionSolver/motionSolver.H @@ -156,6 +156,9 @@ public: IOstream::versionNumber ver, IOstream::compressionType cmp ) const; + + //- Read dynamicMeshDict dictionary + virtual bool read(); }; diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C index 99d3728c06eebadf95415a7b33f3a49a9e021ff5..db88b739620712c0a6211dc9f6b0106aa37473ba 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C @@ -493,4 +493,22 @@ Foam::tmp<Foam::pointField> Foam::sixDoFRigidBodyMotion::scaledPosition } +bool Foam::sixDoFRigidBodyMotion::read(const dictionary& dict) +{ + dict.lookup("momentOfInertia") >> momentOfInertia_; + dict.lookup("mass") >> mass_; + aRelax_ = dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0); + aDamp_ = dict.lookupOrDefault<scalar>("accelerationDamping", 1.0); + report_ = dict.lookupOrDefault<Switch>("report", false); + + restraints_.clear(); + addRestraints(dict); + + constraints_.clear(); + addConstraints(dict); + + return true; +} + + // ************************************************************************* // diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H index 0e4ab39da268d4d82762f72be90fd1de5640065d..a2d4c3236ffec8697047cc945ae52f5399a31537 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H @@ -404,6 +404,11 @@ public: void write(Ostream&) const; + //- Read coefficients dictionary and update system parameters, + // constraints and restraints but not the current state + bool read(const dictionary& dict); + + // IOstream Operators friend Istream& operator>>(Istream&, sixDoFRigidBodyMotion&); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C index 2e208340428d4b3207d8f0bf6efe83c9b601a8aa..d19ac3fb158e2c0981eafded4df971e17ac8c35a 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C @@ -250,4 +250,19 @@ bool Foam::sixDoFRigidBodyMotionSolver::writeObject } +bool Foam::sixDoFRigidBodyMotionSolver::read() +{ + if (displacementMotionSolver::read()) + { + motion_.read(coeffDict()); + + return true; + } + else + { + return false; + } +} + + // ************************************************************************* // diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.H index 410745d96cddebc793cdd1f8d07c632866d246fb..4f4e1ca31c5a80e14eaee7ab06f00cbfa8ae8685 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.H @@ -133,6 +133,9 @@ public: IOstream::versionNumber ver, IOstream::compressionType cmp ) const; + + //- Read dynamicMeshDict dictionary + virtual bool read(); };