From 50dcc40e9aeceafd3bfa117a8e1229d0abdadd49 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 20 Oct 2008 15:31:39 +0100 Subject: [PATCH 01/10] new interval syntax --- tutorials/interDyMFoam/sloshingTank2D/system/controlDict | 9 +++++++-- .../interDyMFoam/sloshingTank2D3DoF/system/controlDict | 9 +++++++-- tutorials/interDyMFoam/sloshingTank3D/system/controlDict | 9 +++++++-- .../interDyMFoam/sloshingTank3D3DoF/system/controlDict | 9 +++++++-- .../interDyMFoam/sloshingTank3D6DoF/system/controlDict | 9 +++++++-- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/tutorials/interDyMFoam/sloshingTank2D/system/controlDict b/tutorials/interDyMFoam/sloshingTank2D/system/controlDict index 8d7fb44aa4..e3e7167169 100644 --- a/tutorials/interDyMFoam/sloshingTank2D/system/controlDict +++ b/tutorials/interDyMFoam/sloshingTank2D/system/controlDict @@ -57,6 +57,10 @@ functions // Type of functionObject type probes; + // Output every + outputControl timeStep; + outputInterval 1; + // Name of the directory for the probe data name probes; @@ -82,8 +86,9 @@ functions // Where to load it from (if not already in solver) functionObjectLibs ("libsampling.so"); - // Output every 10th time step - interval 10; + // Output every + outputControl timeStep; + outputInterval 10; surfaceFormat raw; diff --git a/tutorials/interDyMFoam/sloshingTank2D3DoF/system/controlDict b/tutorials/interDyMFoam/sloshingTank2D3DoF/system/controlDict index 8d7fb44aa4..410cb58d6d 100644 --- a/tutorials/interDyMFoam/sloshingTank2D3DoF/system/controlDict +++ b/tutorials/interDyMFoam/sloshingTank2D3DoF/system/controlDict @@ -57,6 +57,10 @@ functions // Type of functionObject type probes; + // Output every 10th time step + outputControl timeStep; + outputInterval 10; + // Name of the directory for the probe data name probes; @@ -82,8 +86,9 @@ functions // Where to load it from (if not already in solver) functionObjectLibs ("libsampling.so"); - // Output every 10th time step - interval 10; + // Output every 10th time step + outputControl timeStep; + outputInterval 10; surfaceFormat raw; diff --git a/tutorials/interDyMFoam/sloshingTank3D/system/controlDict b/tutorials/interDyMFoam/sloshingTank3D/system/controlDict index b721c9c058..208bb1c29a 100644 --- a/tutorials/interDyMFoam/sloshingTank3D/system/controlDict +++ b/tutorials/interDyMFoam/sloshingTank3D/system/controlDict @@ -57,6 +57,10 @@ functions // Type of functionObject type probes; + // Output every + outputControl timeStep; + outputInterval 1; + // Name of the directory for the probe data name probes; @@ -83,8 +87,9 @@ functions // Where to load it from (if not already in solver) functionObjectLibs ("libsampling.so"); - // Output every 10th time step - interval 10; + // Output every 10th time step + outputControl timeStep; + outputInterval 10; surfaceFormat raw; diff --git a/tutorials/interDyMFoam/sloshingTank3D3DoF/system/controlDict b/tutorials/interDyMFoam/sloshingTank3D3DoF/system/controlDict index b721c9c058..208bb1c29a 100644 --- a/tutorials/interDyMFoam/sloshingTank3D3DoF/system/controlDict +++ b/tutorials/interDyMFoam/sloshingTank3D3DoF/system/controlDict @@ -57,6 +57,10 @@ functions // Type of functionObject type probes; + // Output every + outputControl timeStep; + outputInterval 1; + // Name of the directory for the probe data name probes; @@ -83,8 +87,9 @@ functions // Where to load it from (if not already in solver) functionObjectLibs ("libsampling.so"); - // Output every 10th time step - interval 10; + // Output every 10th time step + outputControl timeStep; + outputInterval 10; surfaceFormat raw; diff --git a/tutorials/interDyMFoam/sloshingTank3D6DoF/system/controlDict b/tutorials/interDyMFoam/sloshingTank3D6DoF/system/controlDict index b721c9c058..208bb1c29a 100644 --- a/tutorials/interDyMFoam/sloshingTank3D6DoF/system/controlDict +++ b/tutorials/interDyMFoam/sloshingTank3D6DoF/system/controlDict @@ -57,6 +57,10 @@ functions // Type of functionObject type probes; + // Output every + outputControl timeStep; + outputInterval 1; + // Name of the directory for the probe data name probes; @@ -83,8 +87,9 @@ functions // Where to load it from (if not already in solver) functionObjectLibs ("libsampling.so"); - // Output every 10th time step - interval 10; + // Output every 10th time step + outputControl timeStep; + outputInterval 10; surfaceFormat raw; From 9b15a7e249d87e2a80a6dbc29478426b92c94a2e Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 21 Oct 2008 13:45:50 +0100 Subject: [PATCH 02/10] foamAddLib does not like multiple paths --- etc/settings.csh | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/etc/settings.csh b/etc/settings.csh index 5eb326c5a5..1958e71787 100644 --- a/etc/settings.csh +++ b/etc/settings.csh @@ -78,11 +78,6 @@ _foamMkDir $FOAM_USER_LIBBIN _foamMkDir $FOAM_USER_APPBIN -# Compiler settings -# ~~~~~~~~~~~~~~~~~ -set compilerBin= -set compilerLib= - # Select compiler installation # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # compilerInstall = OpenFOAM | System @@ -111,19 +106,13 @@ case OpenFOAM: echo endif - set compilerBin=$WM_COMPILER_DIR/bin - set compilerLib=$WM_COMPILER_DIR/lib${WM_COMPILER_LIB_ARCH}:$WM_COMPILER_DIR/lib + _foamAddPath ${WM_COMPILER_DIR}/bin + _foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH} + _foamAddLib ${WM_COMPILER_DIR}/lib + breaksw endsw -if ($?compilerBin) then - _foamAddPath $compilerBin - _foamAddLib $compilerLib -endif - -unset compilerBin -unset compilerLib - # Communications library # ~~~~~~~~~~~~~~~~~~~~~~ From 99e9ffa46fc7a315c298881ecc0df5f35921d7fb Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 21 Oct 2008 13:46:32 +0100 Subject: [PATCH 03/10] deletion of owned objects --- .../db/objectRegistry/objectRegistry.C | 8 +++++-- src/OpenFOAM/meshes/MeshObject/MeshObject.C | 23 +++++++++++++++++++ src/OpenFOAM/meshes/MeshObject/MeshObject.H | 2 ++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.C b/src/OpenFOAM/db/objectRegistry/objectRegistry.C index dbbf8a82e5..df9da24055 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.C @@ -177,12 +177,16 @@ bool Foam::objectRegistry::checkOut(regIOobject& io) const } else { + regIOobject* object = iter(); + + bool hasErased = const_cast(*this).erase(iter); + if (io.ownedByRegistry()) { - delete iter(); + delete object; } - return const_cast(*this).erase(iter); + return hasErased; } } else diff --git a/src/OpenFOAM/meshes/MeshObject/MeshObject.C b/src/OpenFOAM/meshes/MeshObject/MeshObject.C index fddfadfa59..ba67517700 100644 --- a/src/OpenFOAM/meshes/MeshObject/MeshObject.C +++ b/src/OpenFOAM/meshes/MeshObject/MeshObject.C @@ -105,6 +105,29 @@ const Type& Foam::MeshObject::New // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * // +template +bool Foam::MeshObject::Delete(const Mesh& mesh) +{ + if (mesh.db().objectRegistry::foundObject(Type::typeName)) + { + return mesh.db().objectRegistry::checkOut + ( + const_cast + ( + mesh.db().objectRegistry::lookupObject + ( + Type::typeName + ) + ) + ); + } + else + { + return false; + } +} + + template Foam::MeshObject::~MeshObject() { diff --git a/src/OpenFOAM/meshes/MeshObject/MeshObject.H b/src/OpenFOAM/meshes/MeshObject/MeshObject.H index b142b47f96..ee20ccfa3e 100644 --- a/src/OpenFOAM/meshes/MeshObject/MeshObject.H +++ b/src/OpenFOAM/meshes/MeshObject/MeshObject.H @@ -78,6 +78,8 @@ public: // Destructor + static bool Delete(const Mesh& mesh); + virtual ~MeshObject(); From 5640ed63c289dcbcd6f8450f355801c7e88f2b54 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 21 Oct 2008 13:49:25 +0100 Subject: [PATCH 04/10] writing --- src/meshTools/searchableSurface/distributedTriSurfaceMesh.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C index 5abc758ad3..0b2d8d1bde 100644 --- a/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C +++ b/src/meshTools/searchableSurface/distributedTriSurfaceMesh.C @@ -2188,6 +2188,9 @@ bool Foam::distributedTriSurfaceMesh::writeObject IOstream::compressionType cmp ) const { + // Make sure dictionary goes to same directory as surface + const_cast(dict_.instance()) = searchableSurface::instance(); + return triSurfaceMesh::writeObject(fmt, ver, cmp) && dict_.writeObject(fmt, ver, cmp); From 20e528e8bd7d15cdc7425eb19becf6e787e2b6e9 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 21 Oct 2008 14:01:18 +0100 Subject: [PATCH 05/10] xfer constructors --- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 464 ++++++++++++++++++++++++ 1 file changed, 464 insertions(+) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 3b7961979d..31ff85bf2c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -35,6 +35,8 @@ License #include "OSspecific.H" #include "demandDrivenData.H" +#include "pointMesh.H" + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -425,6 +427,162 @@ Foam::polyMesh::polyMesh } +Foam::polyMesh::polyMesh +( + const IOobject& io, + const xfer& points, + const xfer& faces, + const xfer& owner, + const xfer& neighbour, + const bool syncPar +) +: + objectRegistry(io), + primitiveMesh(), + points_ + ( + IOobject + ( + "points", + instance(), + meshSubDir, + *this, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + points + ), + faces_ + ( + IOobject + ( + "faces", + instance(), + meshSubDir, + *this, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + faces + ), + owner_ + ( + IOobject + ( + "owner", + instance(), + meshSubDir, + *this, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + owner + ), + neighbour_ + ( + IOobject + ( + "neighbour", + instance(), + meshSubDir, + *this, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + neighbour + ), + clearedPrimitives_(false), + boundary_ + ( + IOobject + ( + "boundary", + instance(), + meshSubDir, + *this, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + *this, + 0 + ), + bounds_(points_, syncPar), + directions_(Vector