Commit graph

89 commits

Author SHA1 Message Date
Henry Weller
a42ba9b50b Updated version to OpenFOAM-4.x 2016-06-28 11:59:45 +01:00
Henry Weller
c462ffac10 Created OpenFOAM-4.0 from OpenFOAM-dev 2016-06-22 11:19:35 +01:00
Henry Weller
8a5304edf6 Doxygen documentation: Standardized the 'See also' heading 2016-06-17 17:31:34 +01:00
Henry Weller
4500971827 Further standardization of loop index naming: pointI -> pointi, patchI -> patchi 2016-05-18 21:20:42 +01:00
Henry Weller
fe43b80536 GeometricField: Renamed internalField() -> primitiveField() and dimensionedInternalField() -> internalField()
These new names are more consistent and logical because:

primitiveField():
primitiveFieldRef():
    Provides low-level access to the Field<Type> (primitive field)
    without dimension or mesh-consistency checking.  This should only be
    used in the low-level functions where dimensional consistency is
    ensured by careful programming and computational efficiency is
    paramount.

internalField():
internalFieldRef():
    Provides access to the DimensionedField<Type, GeoMesh> of values on
    the internal mesh-type for which the GeometricField is defined and
    supports dimension and checking and mesh-consistency checking.
2016-04-30 21:40:09 +01:00
Henry Weller
e1e996746b GeometricField::internalField() -> GeometricField::internalFieldRef()
Non-const access to the internal field now obtained from a specifically
named access function consistent with the new names for non-canst access
to the boundary field boundaryFieldRef() and dimensioned internal field
dimensionedInternalFieldRef().

See also commit a4e2afa4b3
2016-04-30 14:25:21 +01:00
Henry Weller
53e13f10a5 Updated header 2016-04-29 17:18:33 +01:00
Henry Weller
064d3046b9 List: Removed unused constructor from iterators
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=2074
2016-04-29 17:17:45 +01:00
Henry Weller
f0d25904e4 GeometricField, volFields: Added experimental member function ".v()" and perfix operator "~"
both of which return the dimensionedInternalField for volFields only.

These will be useful in FV equation source term expressions which need
not evaluate boundary conditions.
2016-04-26 20:45:53 +01:00
Henry Weller
a8bf4be58a Standardized cell, patch, face and processor loop index names 2016-04-25 12:00:53 +01:00
Henry Weller
8c4f6b8fcb Standardized cell, patch and face loop index names 2016-04-25 10:28:32 +01:00
Henry Weller
6a27f7af46 boundaryField() -> boundaryFieldRef() 2016-04-24 22:07:37 +01:00
Henry Weller
40ec00b575 Updated header 2016-04-23 23:38:10 +01:00
Henry Weller
77cad08dfa boundaryField() -> boundaryFieldRef() 2016-04-23 23:37:53 +01:00
Henry Weller
76e22b44ea applications/test/rigidBodyDynamics/pendulumAndSpring: Another slightly more complex test 2016-04-17 15:47:03 +01:00
Henry Weller
287603474a vector::zero -> Zero 2016-04-16 18:34:41 +01:00
Henry Weller
fc32d53828 quaternion/septernion: Added multi- quaternion/septernion averaging
Using method based on
http://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20070017872.pdf
but simplified for the case where the quaternions are similar.
2016-04-16 15:59:05 +01:00
Henry Weller
6a5d5e903e septernion: Changed definition of the forward transformation for consistency with spatialTransform
inline Foam::vector Foam::septernion::transformPoint(const vector& v) const
{
    return r().transform(v - t());
}

Now there is a 1:1 correspondence between septernion and
spatialTransform and a septernion constructor from spatialTransform
provided.

Additionally "septernion::transform" has been renamed
"septernion::transformPoint" to clarify that it transforms coordinate
points rather than displacements or other relative vectors.
2016-04-15 11:27:18 +01:00
Henry Weller
bc70e36915 rigidBodyDynamics: Removed quaternion counter and index: 'nw', 'wIndex'
Replaced with 'unitQuaterion()' virtual function to indicate if the
joint uses a unit quaternion to represent rotation.
2016-04-12 22:17:52 +01:00
Henry Weller
df1cb90dc6 rigidBodyDynamics: Simplify handling of quaternions by maintaining a unit quaternion in the joint state field 'q'
'w' is now obtained from 'v' using the relation w = sqrt(1 - |sqr(v)|)
and 'v' is stored in the joint state field 'q' and integrated in the
usual manner but corrected using quaternion transformations.
2016-04-12 21:44:34 +01:00
Henry Weller
4a7f5ed19a applications/test/rigidBodyDynamics/sphericalJoint: Test for the quaternion-based spherical joint 2016-04-12 16:37:52 +01:00
Henry Weller
b2563a8f1b applications/test/rigidBodyDynamics/spring: Updated comment 2016-04-12 16:37:26 +01:00
Henry Weller
ab6fcff621 applications/test/rigidBodyDynamics/spring: Correct typo 2016-04-12 16:16:30 +01:00
Henry Weller
9e24a9b5e2 rigidBodyDynamics: Simplified the interface to the solvers 2016-04-12 12:57:31 +01:00
Henry Weller
c07bc87f95 rigidBodyDynamics/rigidBodySolvers: Added run-time selectable solvers to integrate the rigid-body motion
Currently supported solvers: symplectic, Newmark, CrankNicolson

The symplectic solver should only be used if iteration over the forces
and body-motion is not required.  Newmark and CrankNicolson both require
iteration to provide 2nd-order behavior.

See applications/test/rigidBodyDynamics/spring for an example of the
application of the Newmark solver.

This development is sponsored by Carnegie Wave Energy Ltd.
2016-04-12 11:33:20 +01:00
Henry Weller
81eec80d5d rigidBodyDynamics/rigidBodyModelState: New class to hold the motion state of the rigid-body model
This is a more convenient way of maintaining the state or multiple
states (for higher-order integration), storing, retrieving and passing
between processors.
2016-04-11 19:01:16 +01:00
Henry Weller
1177554029 rigidBodyDynamics/restraints: Complete dictionary IO 2016-04-11 11:45:51 +01:00
Henry Weller
c019071604 rigidBodyDynamics: Added support for restraints and a linear spring with damper
applications/test/rigidBodyDynamics/spring: Test of the linear spring with damper restraint
Damped simple harmonic motion of a weight on a spring is simulated and
the results compared with analytical solution

    Test-spring
    gnuplot spring.gnuplot
    evince spring.eps

This development is sponsored by Carnegie Wave Energy Ltd.
2016-04-10 23:12:07 +01:00
Henry Weller
7d757a7960 applications/test/rigidBodyDynamics/pendulum: Cleanup 2016-04-10 23:07:23 +01:00
Henry Weller
48427f7a4e applications/test/rigidBodyDynamics/pendulum/pendulum: Corrected joint type 2016-04-08 18:03:51 +01:00
Henry Weller
8df5ca61d2 rigidBodyDynamics/bodies/jointBody: Special body to support elements of composite joints 2016-04-08 17:16:01 +01:00
Henry Weller
0c48b153de rigidBodyModel: Added operator<<(Ostream&, const rigidBodyModel&) 2016-04-08 17:02:02 +01:00
Henry Weller
33a97bb848 rigidBodyDynamics: Simplified the IO of bodies 2016-04-08 16:56:48 +01:00
Henry Weller
b701ec9f3d rigidBodyDynamics/bodies: Complete set of clone functions to support copy construction and assignment 2016-04-07 23:04:17 +01:00
Henry Weller
8ffd700ca6 rigidBodyDynamics: Added dictionary-based IO of the rigidBodyModel 2016-04-07 21:47:08 +01:00
Henry Weller
19a93cc696 applications/test/rigidBodyDynamics/pendulum: Simplified using sphere constructor and body lookup by name 2016-04-04 17:08:20 +01:00
Henry Weller
736c47d4dc applications/test/rigidBodyDynamics/pendulum: Add a test for merging bodies 2016-04-04 09:26:37 +01:00
Henry Weller
9891a0ccf9 applications/test/rigidBodyDynamics/pendulum: Very simple test/demonstration of the rigidBodyDynamics library
Simple swinging pendulum simulation with 1-DoF.  The motion is integrated
    using a symplectic method for just over 2-periods.
2016-04-03 22:17:10 +01:00
Henry Weller
ac71f86574 UList: Rationalize assignment (shallow-copy vs deep-copy)
//- Disallow default shallow-copy assignment
    //
    //  Assignment of UList<T> may need to be either shallow (copy pointer)
    //  or deep (copy elements) depending on context or the particular type
    //  of list derived from UList and it is confusing and prone to error
    //  for the default assignment to be either.  The solution is to
    //  disallow default assignment and provide separate 'shallowCopy' and
    //  'deepCopy' member functions.
    void operator=(const UList<T>&) = delete;

    //- Copy the pointer held by the given UList.
    inline void shallowCopy(const UList<T>&);

    //- Copy elements of the given UList.
    void deepCopy(const UList<T>&);
2016-04-03 10:26:05 +01:00
Henry Weller
06f7682413 applications/test/Matrix/Test-Matrix.C: Corrected typo 2016-04-02 23:28:03 +01:00
Henry Weller
56668b2406 Pstream: optimisation of data exchange
Contributed by Mattijs Janssens.

1. Any non-blocking data exchange needs to know in advance the sizes to
   receive so it can size the buffer.  For "halo" exchanges this is not
   a problem since the sizes are known in advance but or all other data
   exchanges these sizes need to be exchanged in advance.

   This was previously done by having all processors send the sizes of data to
   send to the master and send it back such that all processors
   - had the same information
   - all could work out who was sending what to where and hence what needed to
     be received.

   This is now changed such that we only send the size to the
   destination processor (instead of to all as previously). This means
   that
   - the list of sizes to send is now of size nProcs v.s. nProcs*nProcs before
   - we cut out the route to the master and back by using a native MPI
     call

   It causes a small change to the API of exchange and PstreamBuffers -
   they now return the sizes of the local buffers only (a labelList) and
   not the sizes of the buffers on all processors (labelListList)

2. Reversing the order of the way in which the sending is done when
   scattering information from the master processor to the other
   processors. This is done in a tree like fashion. Each processor has a
   set of processors to receive from/ send to. When receiving it will
   first receive from the processors with the least amount of
   sub-processors (i.e. the ones which return first). When sending it
   needs to do the opposite: start sending to the processor with the
   most amount of sub-tree since this is the critical path.
2016-04-02 18:32:11 +01:00
Henry Weller
ff8e666099 LLTMatrix, LUscalarMatrix, QRMatrix: Provided consistent 'solve' interface 2016-03-24 19:13:04 +00:00
Henry Weller
523b01c1b2 QRMatrix: New class to provide QR-decomposition by Householder reflection
This development is sponsored by Carnegie Wave Energy Ltd.
2016-03-24 14:49:25 +00:00
Henry Weller
ddbd5f3d11 LLTMatrix: New matrix form to support Cholesky decomposition
of symmetric positive-definite matrices and the solution of associated
linear systems.
2016-03-23 15:33:03 +00:00
Henry Weller
fa8929df6d Use Zero rather than pTraits<Type>::zero unless a static typed '0' is required 2016-03-22 17:46:52 +00:00
Henry Weller
055a113f10 SquareMatrix, SymmetricSquareMatrix: Changed the constructor from size to require only n
This avoids the need to check that the m and n dimensions are the same.
2016-03-22 14:13:48 +00:00
Henry Weller
71da87b11f Test-Matrix: Removed timing test 2016-03-20 19:50:23 +00:00
Henry Weller
c13421b10a Matrix: Added (i, j) addressing to allow support for addressing blocks of the matrix
This change brings OpenFOAM into line with the standard matrix
addressing in other C++ libraries for better interoperability.
2016-03-20 19:44:29 +00:00
Henry Weller
dbe5d5288b quaternion: Added generalized construction from and conversion to Euler-angles
The particular rotation sequence is specified via the enumeration:

    //- Euler-angle rotation sequence
    enum rotationSequence
    {
        ZYX, ZYZ, ZXY, ZXZ, YXZ, YXY, YZX, YZY, XYZ, XYX, XZY, XZX
    };

and provided as an argument to the constructor from Euler-angles

    //- Construct a quaternion given the three Euler angles:
    inline quaternion
    (
        const rotationSequence rs,
        const vector& angles
    );

and conversion to Euler-angles:

    //- Return a vector of euler angles corresponding to the
    //  specified rotation sequence
    inline vector eulerAngles(const rotationSequence rs) const;
2016-03-14 08:07:42 +00:00
Henry Weller
e0451c75ec messageStream: Added DebugInfo and DebugInFunction:
DebugInfo:
    Report an information message using Foam::Info if the local debug
    switch is true

DebugInFunction:
    Report an information message using Foam::Info for FUNCTION_NAME in
    file __FILE__ at line __LINE__ if the local debug switch is true
2016-03-04 11:30:13 +00:00