src/OpenFOAM: Moved function documentation comments into .H files and removed duplicates

This commit is contained in:
Henry Weller
2016-03-01 12:29:01 +00:00
parent 3963149c05
commit 5db3116a74
28 changed files with 473 additions and 663 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -749,212 +749,211 @@ void Foam::CV2D::newPoints()
boundaryConform(); boundaryConform();
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Old Method // Old Method
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /*
for
(
Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
vit != finite_vertices_end();
++vit
)
{
if (vit->internalPoint())
{
// Current dual-cell defining vertex ("centre")
point2DFromPoint defVert0 = toPoint2D(vit->point());
// for Triangulation::Edge_circulator ec = incident_edges(vit);
// ( Triangulation::Edge_circulator ecStart = ec;
// Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
// vit != finite_vertices_end();
// ++vit
// )
// {
// if (vit->internalPoint())
// {
// // Current dual-cell defining vertex ("centre")
// point2DFromPoint defVert0 = toPoint2D(vit->point());
// Triangulation::Edge_circulator ec = incident_edges(vit); // Circulate around the edges to find the first which is not
// Triangulation::Edge_circulator ecStart = ec; // infinite
do
{
if (!is_infinite(ec)) break;
} while (++ec != ecStart);
// // Circulate around the edges to find the first which is not // Store the start-end of the first non-infinte edge
// // infinite point2D de0 = toPoint2D(circumcenter(ec->first));
// do
// {
// if (!is_infinite(ec)) break;
// } while (++ec != ecStart);
// // Store the start-end of the first non-infinte edge // Keep track of the maximum edge length^2
// point2D de0 = toPoint2D(circumcenter(ec->first)); scalar maxEdgeLen2 = 0.0;
// // Keep track of the maximum edge length^2 // Keep track of the index of the longest edge
// scalar maxEdgeLen2 = 0.0; label edgecd0i = -1;
// // Keep track of the index of the longest edge // Edge counter
// label edgecd0i = -1; label edgei = 0;
// // Edge counter do
// label edgei = 0; {
if (!is_infinite(ec))
{
// Get the end of the current edge
point2D de1 = toPoint2D
(
circumcenter(ec->first->neighbor(ec->second))
);
// do // Store the current edge vector
// { edges[edgei] = de1 - de0;
// if (!is_infinite(ec))
// {
// // Get the end of the current edge
// point2D de1 = toPoint2D
// (
// circumcenter(ec->first->neighbor(ec->second))
// );
// // Store the current edge vector // Store the edge mid-point in the vertices array
// edges[edgei] = de1 - de0; vertices[edgei] = 0.5*(de1 + de0);
// // Store the edge mid-point in the vertices array // Move the current edge end into the edge start for the
// vertices[edgei] = 0.5*(de1 + de0); // next iteration
de0 = de1;
// // Move the current edge end into the edge start for the // Keep track of the longest edge
// // next iteration
// de0 = de1;
// // Keep track of the longest edge scalar edgeLen2 = magSqr(edges[edgei]);
// scalar edgeLen2 = magSqr(edges[edgei]); if (edgeLen2 > maxEdgeLen2)
{
// if (edgeLen2 > maxEdgeLen2) maxEdgeLen2 = edgeLen2;
// { edgecd0i = edgei;
// maxEdgeLen2 = edgeLen2;
// edgecd0i = edgei;
// }
// edgei++;
// }
// } while (++ec != ecStart);
// // Initialise cd0 such that the mesh will align
// // in in the x-y directions
// vector2D cd0(1, 0);
// if (meshControls().relaxOrientation())
// {
// // Get the longest edge from the array and use as the primary
// // direction of the coordinate system of the "square" cell
// cd0 = edges[edgecd0i];
// }
// if (meshControls().nearWallAlignedDist() > 0)
// {
// pointIndexHit pHit = qSurf_.tree().findNearest
// (
// toPoint3D(defVert0),
// meshControls().nearWallAlignedDist2()
// );
// if (pHit.hit())
// {
// cd0 = toPoint2D(faceNormals[pHit.index()]);
// }
// }
// // Rotate by 45deg needed to create an averaging procedure which
// // encourages the cells to be square
// cd0 = vector2D(cd0.x() + cd0.y(), cd0.y() - cd0.x());
// // Normalise the primary coordinate direction
// cd0 /= mag(cd0);
// // Calculate the orthogonal coordinate direction
// vector2D cd1(-cd0.y(), cd0.x());
// // Restart the circulator
// ec = ecStart;
// // ... and the counter
// edgei = 0;
// // Initialise the displacement for the centre and sum-weights
// vector2D disp = vector2D::zero;
// scalar sumw = 0;
// do
// {
// if (!is_infinite(ec))
// {
// // Pick up the current edge
// const vector2D& ei = edges[edgei];
// // Calculate the centre to edge-centre vector
// vector2D deltai = vertices[edgei] - defVert0;
// // Set the weight for this edge contribution
// scalar w = 1;
// if (meshControls().squares())
// {
// w = magSqr(deltai.x()*ei.y() - deltai.y()*ei.x());
// // alternative weights
// //w = mag(deltai.x()*ei.y() - deltai.y()*ei.x());
// //w = magSqr(ei)*mag(deltai);
// // Use the following for an ~square mesh
// // Find the coordinate contributions for this edge delta
// scalar cd0deltai = cd0 & deltai;
// scalar cd1deltai = cd1 & deltai;
// // Create a "square" displacement
// if (mag(cd0deltai) > mag(cd1deltai))
// {
// disp += (w*cd0deltai)*cd0;
// }
// else
// {
// disp += (w*cd1deltai)*cd1;
// }
// }
// else
// {
// // Use this for a hexagon/pentagon mesh
// disp += w*deltai;
// }
// // Sum the weights
// sumw += w;
// }
// else
// {
// FatalErrorInFunction
// << "Infinite triangle found in internal mesh"
// << exit(FatalError);
// }
// edgei++;
// } while (++ec != ecStart);
// // Calculate the average displacement
// disp /= sumw;
// totalDisp += disp;
// totalDist += mag(disp);
// // Move the point by a fraction of the average displacement
// movePoint(vit, defVert0 + relaxation*disp);
// }
// }
// Info << "\nTotal displacement = " << totalDisp
// << " total distance = " << totalDist << endl;
} }
edgei++;
}
} while (++ec != ecStart);
//void Foam::CV2D::moveInternalPoints(const point2DField& newPoints) // Initialise cd0 such that the mesh will align
//{ // in in the x-y directions
// label pointI = 0; vector2D cd0(1, 0);
// for if (meshControls().relaxOrientation())
// ( {
// Triangulation::Finite_vertices_iterator vit = finite_vertices_begin(); // Get the longest edge from the array and use as the primary
// vit != finite_vertices_end(); // direction of the coordinate system of the "square" cell
// ++vit cd0 = edges[edgecd0i];
// ) }
// {
// if (vit->internalPoint())
// {
// movePoint(vit, newPoints[pointI++]);
// }
// }
//}
if (meshControls().nearWallAlignedDist() > 0)
{
pointIndexHit pHit = qSurf_.tree().findNearest
(
toPoint3D(defVert0),
meshControls().nearWallAlignedDist2()
);
if (pHit.hit())
{
cd0 = toPoint2D(faceNormals[pHit.index()]);
}
}
// Rotate by 45deg needed to create an averaging procedure which
// encourages the cells to be square
cd0 = vector2D(cd0.x() + cd0.y(), cd0.y() - cd0.x());
// Normalise the primary coordinate direction
cd0 /= mag(cd0);
// Calculate the orthogonal coordinate direction
vector2D cd1(-cd0.y(), cd0.x());
// Restart the circulator
ec = ecStart;
// ... and the counter
edgei = 0;
// Initialise the displacement for the centre and sum-weights
vector2D disp = vector2D::zero;
scalar sumw = 0;
do
{
if (!is_infinite(ec))
{
// Pick up the current edge
const vector2D& ei = edges[edgei];
// Calculate the centre to edge-centre vector
vector2D deltai = vertices[edgei] - defVert0;
// Set the weight for this edge contribution
scalar w = 1;
if (meshControls().squares())
{
w = magSqr(deltai.x()*ei.y() - deltai.y()*ei.x());
// alternative weights
//w = mag(deltai.x()*ei.y() - deltai.y()*ei.x());
//w = magSqr(ei)*mag(deltai);
// Use the following for an ~square mesh
// Find the coordinate contributions for this edge delta
scalar cd0deltai = cd0 & deltai;
scalar cd1deltai = cd1 & deltai;
// Create a "square" displacement
if (mag(cd0deltai) > mag(cd1deltai))
{
disp += (w*cd0deltai)*cd0;
}
else
{
disp += (w*cd1deltai)*cd1;
}
}
else
{
// Use this for a hexagon/pentagon mesh
disp += w*deltai;
}
// Sum the weights
sumw += w;
}
else
{
FatalErrorInFunction
<< "Infinite triangle found in internal mesh"
<< exit(FatalError);
}
edgei++;
} while (++ec != ecStart);
// Calculate the average displacement
disp /= sumw;
totalDisp += disp;
totalDist += mag(disp);
// Move the point by a fraction of the average displacement
movePoint(vit, defVert0 + relaxation*disp);
}
}
Info << "\nTotal displacement = " << totalDisp
<< " total distance = " << totalDist << endl;
*/
}
/*
void Foam::CV2D::moveInternalPoints(const point2DField& newPoints)
{
label pointI = 0;
for
(
Triangulation::Finite_vertices_iterator vit = finite_vertices_begin();
vit != finite_vertices_end();
++vit
)
{
if (vit->internalPoint())
{
movePoint(vit, newPoints[pointI++]);
}
}
}
*/
void Foam::CV2D::write() const void Foam::CV2D::write() const
{ {

View File

@ -62,17 +62,11 @@ class StaticAssertionTest {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Internal use:
// ~~~~~~~~~~~~~
// Paste together strings, even if an argument is itself a macro // Paste together strings, even if an argument is itself a macro
#define StaticAssertMacro(X,Y) StaticAssertMacro1(X,Y) #define StaticAssertMacro(X,Y) StaticAssertMacro1(X,Y)
#define StaticAssertMacro1(X,Y) StaticAssertMacro2(X,Y) #define StaticAssertMacro1(X,Y) StaticAssertMacro2(X,Y)
#define StaticAssertMacro2(X,Y) X##Y #define StaticAssertMacro2(X,Y) X##Y
// External use:
// ~~~~~~~~~~~~~
//- Assert that some test is true at compile-time //- Assert that some test is true at compile-time
#define StaticAssert(Test) \ #define StaticAssert(Test) \
typedef ::Foam::StaticAssertionTest \ typedef ::Foam::StaticAssertionTest \

View File

@ -42,12 +42,8 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Declare a run-time selection
// external use: #define declareRunTimeSelectionTable(autoPtr,baseType,argNames,argList,parList)\
// ~~~~~~~~~~~~~
// declare a run-time selection:
#define declareRunTimeSelectionTable\
(autoPtr,baseType,argNames,argList,parList) \
\ \
/* Construct from argList function pointer type */ \ /* Construct from argList function pointer type */ \
typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \ typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \
@ -134,11 +130,9 @@ Description
// external use: //- Declare a run-time selection for derived classes
// ~~~~~~~~~~~~~ #define declareRunTimeNewSelectionTable( \
// declare a run-time selection for derived classes: autoPtr,baseType,argNames,argList,parList) \
#define declareRunTimeNewSelectionTable\
(autoPtr,baseType,argNames,argList,parList) \
\ \
/* Construct from argList function pointer type */ \ /* Construct from argList function pointer type */ \
typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \ typedef autoPtr<baseType> (*argNames##ConstructorPtr)argList; \
@ -234,10 +228,8 @@ Description
}; };
// internal use: // Constructor aid
// constructor aid #define defineRunTimeSelectionTableConstructor(baseType,argNames) \
#define defineRunTimeSelectionTableConstructor\
(baseType,argNames) \
\ \
/* Table constructor called from the table add function */ \ /* Table constructor called from the table add function */ \
void baseType::construct##argNames##ConstructorTables() \ void baseType::construct##argNames##ConstructorTables() \
@ -252,10 +244,8 @@ Description
} }
// internal use: // Destructor aid
// destructor aid #define defineRunTimeSelectionTableDestructor(baseType,argNames) \
#define defineRunTimeSelectionTableDestructor\
(baseType,argNames) \
\ \
/* Table destructor called from the table add function destructor */ \ /* Table destructor called from the table add function destructor */ \
void baseType::destroy##argNames##ConstructorTables() \ void baseType::destroy##argNames##ConstructorTables() \
@ -268,44 +258,28 @@ Description
} }
// internal use: // Create pointer to hash-table of functions
// create pointer to hash-table of functions #define defineRunTimeSelectionTablePtr(baseType,argNames) \
#define defineRunTimeSelectionTablePtr\
(baseType,argNames) \
\ \
/* Define the constructor function table */ \ /* Define the constructor function table */ \
baseType::argNames##ConstructorTable* \ baseType::argNames##ConstructorTable* \
baseType::argNames##ConstructorTablePtr_ = NULL baseType::argNames##ConstructorTablePtr_ = NULL
// not much in use:
#define defineTemplateRunTimeSelectionTablePtr(baseType,argNames) \
\
/* Define the constructor function table */ \
typename baseType::argNames##ConstructorTable* \
baseType::argNames##ConstructorTablePtr_ = NULL
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Define run-time selection table
// external use: #define defineRunTimeSelectionTable(baseType,argNames) \
// ~~~~~~~~~~~~~
// define run-time selection table
#define defineRunTimeSelectionTable\
(baseType,argNames) \
\ \
defineRunTimeSelectionTablePtr(baseType,argNames); \ defineRunTimeSelectionTablePtr(baseType,argNames); \
defineRunTimeSelectionTableConstructor(baseType,argNames); \ defineRunTimeSelectionTableConstructor(baseType,argNames); \
defineRunTimeSelectionTableDestructor(baseType,argNames) defineRunTimeSelectionTableDestructor(baseType,argNames)
// external use: //- Define run-time selection table for template classes
// ~~~~~~~~~~~~~
// define run-time selection table for template classes
// use when baseType doesn't need a template argument (eg, is a typedef) // use when baseType doesn't need a template argument (eg, is a typedef)
#define defineTemplateRunTimeSelectionTable\ #define defineTemplateRunTimeSelectionTable(baseType,argNames) \
(baseType,argNames) \
\ \
template<> \ template<> \
defineRunTimeSelectionTablePtr(baseType,argNames); \ defineRunTimeSelectionTablePtr(baseType,argNames); \
@ -317,12 +291,8 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Constructor aid: use when baseType requires the Targ template argument
// internal use: #define defineTemplatedRunTimeSelectionTableConstructor(baseType,argNames,Targ)\
// constructor aid
// use when baseType requires the Targ template argument
#define defineTemplatedRunTimeSelectionTableConstructor\
(baseType,argNames,Targ) \
\ \
/* Table constructor called from the table add function */ \ /* Table constructor called from the table add function */ \
void baseType<Targ>::construct##argNames##ConstructorTables() \ void baseType<Targ>::construct##argNames##ConstructorTables() \
@ -337,11 +307,8 @@ Description
} }
// internal use: // Destructor aid: use when baseType requires the Targ template argument
// destructor aid #define defineTemplatedRunTimeSelectionTableDestructor(baseType,argNames,Targ) \
// use when baseType requires the Targ template argument
#define defineTemplatedRunTimeSelectionTableDestructor\
(baseType,argNames,Targ) \
\ \
/* Table destructor called from the table add function destructor */ \ /* Table destructor called from the table add function destructor */ \
void baseType<Targ>::destroy##argNames##ConstructorTables() \ void baseType<Targ>::destroy##argNames##ConstructorTables() \
@ -354,23 +321,18 @@ Description
} }
// internal use: //- Create pointer to hash-table of functions
// create pointer to hash-table of functions
// use when baseType requires the Targ template argument // use when baseType requires the Targ template argument
#define defineTemplatedRunTimeSelectionTablePtr\ #define defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ) \
(baseType,argNames,Targ) \
\ \
/* Define the constructor function table */ \ /* Define the constructor function table */ \
baseType<Targ>::argNames##ConstructorTable* \ baseType<Targ>::argNames##ConstructorTable* \
baseType<Targ>::argNames##ConstructorTablePtr_ = NULL baseType<Targ>::argNames##ConstructorTablePtr_ = NULL
// external use: //- Define run-time selection table for template classes
// ~~~~~~~~~~~~~
// define run-time selection table for template classes
// use when baseType requires the Targ template argument // use when baseType requires the Targ template argument
#define defineTemplatedRunTimeSelectionTable\ #define defineTemplatedRunTimeSelectionTable(baseType,argNames,Targ) \
(baseType,argNames,Targ) \
\ \
template<> \ template<> \
defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ); \ defineTemplatedRunTimeSelectionTablePtr(baseType,argNames,Targ); \

View File

@ -38,12 +38,9 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Declare a run-time selection:
// external use: #define declareMemberFunctionSelectionTable( \
// ~~~~~~~~~~~~~ returnType,baseType,memberFunction,argNames,argList,parList) \
// declare a run-time selection:
#define declareMemberFunctionSelectionTable\
(returnType,baseType,memberFunction,argNames,argList,parList) \
\ \
/* Construct from argList function pointer type */ \ /* Construct from argList function pointer type */ \
typedef returnType (*memberFunction##argNames##MemberFunctionPtr)argList; \ typedef returnType (*memberFunction##argNames##MemberFunctionPtr)argList; \
@ -89,10 +86,9 @@ Description
static void destroy##memberFunction##argNames##MemberFunctionTables() static void destroy##memberFunction##argNames##MemberFunctionTables()
// internal use: // Constructor aid
// constructor aid #define defineMemberFunctionSelectionTableMemberFunction( \
#define defineMemberFunctionSelectionTableMemberFunction\ baseType,memberFunction,argNames) \
(baseType,memberFunction,argNames) \
\ \
/* Table memberFunction called from the table add function */ \ /* Table memberFunction called from the table add function */ \
void baseType::construct##memberFunction##argNames##MemberFunctionTables() \ void baseType::construct##memberFunction##argNames##MemberFunctionTables() \
@ -107,10 +103,9 @@ Description
} }
// internal use: // Destructor aid
// destructor aid #define defineMemberFunctionSelectionTableDestructor( \
#define defineMemberFunctionSelectionTableDestructor\ baseType,memberFunction,argNames) \
(baseType,memberFunction,argNames) \
\ \
/* Table destructor called from the table add function destructor */ \ /* Table destructor called from the table add function destructor */ \
void baseType::destroy##memberFunction##argNames##MemberFunctionTables() \ void baseType::destroy##memberFunction##argNames##MemberFunctionTables() \
@ -123,32 +118,19 @@ Description
} }
// internal use: // Create pointer to hash-table of functions
// create pointer to hash-table of functions #define defineMemberFunctionSelectionTablePtr(baseType,memberFunction,argNames)\
#define defineMemberFunctionSelectionTablePtr\
(baseType,memberFunction,argNames) \
\ \
/* Define the memberFunction table */ \ /* Define the memberFunction table */ \
baseType::memberFunction##argNames##MemberFunctionTable* \ baseType::memberFunction##argNames##MemberFunctionTable* \
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
// not much in use:
#define defineTemplateMemberFunctionSelectionTablePtr\
(baseType,memberFunction,argNames) \
\
/* Define the memberFunction table */ \
typename baseType::memberFunction##argNames##MemberFunctionTable* \
baseType::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// external use: //- Define run-time selection table
// ~~~~~~~~~~~~~ #define defineMemberFunctionSelectionTable(baseType,memberFunction,argNames) \
// define run-time selection table
#define defineMemberFunctionSelectionTable\
(baseType,memberFunction,argNames) \
\ \
defineMemberFunctionSelectionTablePtr \ defineMemberFunctionSelectionTablePtr \
(baseType,memberFunction,argNames); \ (baseType,memberFunction,argNames); \
@ -158,12 +140,10 @@ Description
(baseType,memberFunction,argNames) (baseType,memberFunction,argNames)
// external use: //- Define run-time selection table for template classes
// ~~~~~~~~~~~~~
// define run-time selection table for template classes
// use when baseType doesn't need a template argument (eg, is a typedef) // use when baseType doesn't need a template argument (eg, is a typedef)
#define defineTemplateMemberFunctionSelectionTable\ #define defineTemplateMemberFunctionSelectionTable( \
(baseType,memberFunction,argNames) \ baseType,memberFunction,argNames) \
\ \
template<> \ template<> \
defineMemberFunctionSelectionTablePtr \ defineMemberFunctionSelectionTablePtr \
@ -178,11 +158,9 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// internal use: // Constructor aid: use when baseType requires the Targ template argument
// constructor aid #define defineTemplatedMemberFunctionSelectionTableMemberFunction( \
// use when baseType requires the Targ template argument baseType,memberFunction,argNames,Targ) \
#define defineTemplatedMemberFunctionSelectionTableMemberFunction\
(baseType,memberFunction,argNames,Targ) \
\ \
/* Table memberFunction called from the table add function */ \ /* Table memberFunction called from the table add function */ \
void baseType<Targ>::construct##memberFunction##argNames## \ void baseType<Targ>::construct##memberFunction##argNames## \
@ -199,11 +177,10 @@ Description
} }
// internal use: // Destructor aid
// destructor aid
// use when baseType requires the Targ template argument // use when baseType requires the Targ template argument
#define defineTemplatedMemberFunctionSelectionTableDestructor\ #define defineTemplatedMemberFunctionSelectionTableDestructor( \
(baseType,memberFunction,argNames,Targ) \ baseType,memberFunction,argNames,Targ) \
\ \
/* Table destructor called from the table add function destructor */ \ /* Table destructor called from the table add function destructor */ \
void baseType<Targ>::destroy##memberFunction##argNames## \ void baseType<Targ>::destroy##memberFunction##argNames## \
@ -222,23 +199,20 @@ Description
} }
// internal use: // Create pointer to hash-table of functions
// create pointer to hash-table of functions
// use when baseType requires the Targ template argument // use when baseType requires the Targ template argument
#define defineTemplatedMemberFunctionSelectionTablePtr\ #define defineTemplatedMemberFunctionSelectionTablePtr( \
(baseType,memberFunction,argNames,Targ) \ baseType,memberFunction,argNames,Targ) \
\ \
/* Define the memberFunction table */ \ /* Define the memberFunction table */ \
baseType<Targ>::memberFunction##argNames##MemberFunctionTable* \ baseType<Targ>::memberFunction##argNames##MemberFunctionTable* \
baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ = NULL baseType<Targ>::memberFunction##argNames##MemberFunctionTablePtr_ = NULL
// external use: //- Define run-time selection table for template classes
// ~~~~~~~~~~~~~
// define run-time selection table for template classes
// use when baseType requires the Targ template argument // use when baseType requires the Targ template argument
#define defineTemplatedMemberFunctionSelectionTable\ #define defineTemplatedMemberFunctionSelectionTable( \
(baseType,memberFunction,argNames,Targ) \ baseType,memberFunction,argNames,Targ) \
\ \
template<> \ template<> \
defineTemplatedMemberFunctionSelectionTablePtr \ defineTemplatedMemberFunctionSelectionTablePtr \

View File

@ -32,10 +32,7 @@ Description
#include "defineDebugSwitch.H" #include "defineDebugSwitch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Declarations (without debug information)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// declarations (without debug information)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//- Add typeName information from argument \a TypeNameString to a class. //- Add typeName information from argument \a TypeNameString to a class.
// Without debug information // Without debug information
@ -60,9 +57,8 @@ public: \
} }
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// declarations (with debug information) // Declarations (with debug information)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//- Add typeName information from argument \a TypeNameString to a class. //- Add typeName information from argument \a TypeNameString to a class.
// Also declares debug information. // Also declares debug information.
@ -87,9 +83,8 @@ public: \
} }
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// definitions (without debug information) // Definitions (without debug information)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//- Define the typeName, with alternative lookup as \a Name //- Define the typeName, with alternative lookup as \a Name
#define defineTypeNameWithName(Type, Name) \ #define defineTypeNameWithName(Type, Name) \
@ -117,9 +112,8 @@ public: \
defineTemplateTypeNameWithName(Type, Type::typeName_()) defineTemplateTypeNameWithName(Type, Type::typeName_())
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// definitions (with debug information) // Definitions (with debug information)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//- Define the typeName and debug information //- Define the typeName and debug information
#define defineTypeNameAndDebug(Type, DebugSwitch) \ #define defineTypeNameAndDebug(Type, DebugSwitch) \
@ -141,7 +135,9 @@ public: \
defineNamedTemplateTypeName(Type); \ defineNamedTemplateTypeName(Type); \
defineNamedTemplateDebugSwitch(Type, DebugSwitch) defineNamedTemplateDebugSwitch(Type, DebugSwitch)
// for templated sub-classes
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// For templated sub-classes
//- Define the typeName and debug information, lookup as \a Name //- Define the typeName and debug information, lookup as \a Name
#define defineTemplate2TypeNameAndDebugWithName(Type, Name, DebugSwitch) \ #define defineTemplate2TypeNameAndDebugWithName(Type, Name, DebugSwitch) \

View File

@ -300,9 +300,6 @@ dimensioned<Type> operator/
); );
// Products
// ~~~~~~~~
#define PRODUCT_OPERATOR(product, op, opFunc) \ #define PRODUCT_OPERATOR(product, op, opFunc) \
\ \
template<class Type1, class Type2> \ template<class Type1, class Type2> \

View File

@ -35,10 +35,6 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// definitions (debug information only)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
namespace Foam namespace Foam
{ {
@ -74,6 +70,8 @@ public:
} // End namespace Foam } // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define registerTemplateDebugSwitchWithName(Type,Name) \ #define registerTemplateDebugSwitchWithName(Type,Name) \
template<> \ template<> \
const Foam::RegisterDebugSwitch<Type> \ const Foam::RegisterDebugSwitch<Type> \
@ -119,6 +117,7 @@ public:
template<> \ template<> \
defineDebugSwitchWithName(Type, Name, DebugSwitch); \ defineDebugSwitchWithName(Type, Name, DebugSwitch); \
registerTemplateDebugSwitchWithName(Type, Name) registerTemplateDebugSwitchWithName(Type, Name)
//- Define the debug information for templates sub-classes, lookup as \a Name //- Define the debug information for templates sub-classes, lookup as \a Name
#define defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) \ #define defineTemplate2DebugSwitchWithName(Type, Name, DebugSwitch) \
template<> \ template<> \
@ -135,8 +134,6 @@ public:
defineTemplateDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch) defineTemplateDebugSwitchWithName(Type, Type::typeName_(), DebugSwitch)
// For templated sub-classes
//- Define the debug information for templates //- Define the debug information for templates
// Useful with typedefs // Useful with typedefs
#define defineTemplate2DebugSwitch(Type, DebugSwitch) \ #define defineTemplate2DebugSwitch(Type, DebugSwitch) \

View File

@ -1,7 +1,3 @@
//
// addDictOption.H
// ~~~~~~~~~~~~~~~~~
Foam::argList::addOption Foam::argList::addOption
( (
"dict", "dict",

View File

@ -1,10 +1,5 @@
//
// addOverwriteOption.H
// ~~~~~~~~~~~~~~~~~~~~
Foam::argList::addBoolOption Foam::argList::addBoolOption
( (
"overwrite", "overwrite",
"overwrite existing mesh/results files" "overwrite existing mesh/results files"
); );

View File

@ -1,11 +1,6 @@
//
// addRegionOption.H
// ~~~~~~~~~~~~~~~~~
Foam::argList::addOption Foam::argList::addOption
( (
"region", "region",
"name", "name",
"specify alternative mesh region" "specify alternative mesh region"
); );

View File

@ -1,7 +1,3 @@
//
// addTimeOptions.H
// ~~~~~~~~~~~~~~~~
Foam::argList::addBoolOption Foam::argList::addBoolOption
( (
"constant", "constant",
@ -26,4 +22,3 @@
"time", "time",
"specify a single time value to select" "specify a single time value to select"
); );

View File

@ -1,7 +1,4 @@
// // Unless -constant is present, skip startTime if it is "constant"
// checkConstantOption.H
// ~~~~~~~~~~~~~~~~~~~~~
// unless -constant is present, skip startTime if it is "constant"
if if
( (

View File

@ -1,6 +1,3 @@
//
// checkTimeOption.H
// ~~~~~~~~~~~~~~~~~
// Check -time and -latestTime options // Check -time and -latestTime options
if (args.optionFound("time")) if (args.optionFound("time"))

View File

@ -1,7 +1,3 @@
//
// checkTimeOptions.H
// ~~~~~~~~~~~~~~~~~~
Foam::label startTime = 0; Foam::label startTime = 0;
// Unless -constant is present, skip startTime if it is "constant" // Unless -constant is present, skip startTime if it is "constant"

View File

@ -1,7 +1,3 @@
//
// checkTimeOptionsNoConstant.H
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Foam::label startTime = 0; Foam::label startTime = 0;
// Check -time and -latestTime options // Check -time and -latestTime options

View File

@ -1,7 +1,3 @@
//
// createMesh.H
// ~~~~~~~~~~~~
Foam::Info Foam::Info
<< "Create mesh for time = " << "Create mesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl; << runTime.timeName() << Foam::nl << Foam::endl;

View File

@ -1,7 +1,4 @@
// // Currently identical to createMesh.H
// createMeshNoClear.H
// ~~~~~~~~~~~~~~~~~~~
// currently identical to createMesh.H
Foam::Info Foam::Info
<< "Create mesh, no clear-out for time = " << "Create mesh, no clear-out for time = "

View File

@ -1,7 +1,3 @@
//
// createNamedMesh.H
// ~~~~~~~~~~~~~~~~~
Foam::word regionName; Foam::word regionName;
if (args.optionReadIfPresent("region", regionName)) if (args.optionReadIfPresent("region", regionName))

View File

@ -1,7 +1,3 @@
//
// createNamedPolyMesh.H
// ~~~~~~~~~~~~~~~~~~~~~
Foam::word regionName; Foam::word regionName;
if (args.optionReadIfPresent("region", regionName)) if (args.optionReadIfPresent("region", regionName))

View File

@ -1,7 +1,3 @@
//
// createPolyMesh.H
// ~~~~~~~~~~~~~~~~
Foam::Info Foam::Info
<< "Create polyMesh for time = " << "Create polyMesh for time = "
<< runTime.timeName() << Foam::nl << Foam::endl; << runTime.timeName() << Foam::nl << Foam::endl;

View File

@ -1,7 +1,3 @@
//
// createTime.H
// ~~~~~~~~~~~~
Foam::Info<< "Create time\n" << Foam::endl; Foam::Info<< "Create time\n" << Foam::endl;
Foam::Time runTime(Foam::Time::controlDictName, args); Foam::Time runTime(Foam::Time::controlDictName, args);

View File

@ -1,7 +1,3 @@
//
// setConstantMeshDictionaryIO.H
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fileName dictPath = ""; fileName dictPath = "";
if (args.optionFound("dict")) if (args.optionFound("dict"))
{ {

View File

@ -1,7 +1,3 @@
//
// setRootCase.H
// ~~~~~~~~~~~~~
Foam::argList args(argc, argv); Foam::argList args(argc, argv);
if (!args.checkRootCase()) if (!args.checkRootCase())
{ {

View File

@ -1,7 +1,3 @@
//
// setSystemMeshDictionaryIO.H
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fileName dictPath = ""; fileName dictPath = "";
if (args.optionFound("dict")) if (args.optionFound("dict"))
{ {

View File

@ -1,7 +1,3 @@
//
// setSystemRunTimeDictionaryIO.H
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fileName dictPath = ""; fileName dictPath = "";
if (args.optionFound("dict")) if (args.optionFound("dict"))
{ {

View File

@ -5118,13 +5118,6 @@ const Foam::cellShapeList& Foam::hexRef8::cellShapes() const
} }
//
// Unrefinement
// ~~~~~~~~~~~~
//
Foam::labelList Foam::hexRef8::getSplitPoints() const Foam::labelList Foam::hexRef8::getSplitPoints() const
{ {
if (debug) if (debug)

View File

@ -87,20 +87,6 @@ class autoSnapDriver
const List<labelPair>& const List<labelPair>&
); );
//static tmp<pointField> avg
//(
// const indirectPrimitivePatch&,
// const pointField&
//);
//- Calculate displacement per patch point. Wip.
//static tmp<pointField> smoothLambdaMuPatchDisplacement
//(
// const motionSmoother& meshMover,
// const List<labelPair>& baffles
//);
//- Check that face zones are synced //- Check that face zones are synced
void checkCoupledFaceZones() const; void checkCoupledFaceZones() const;
@ -155,13 +141,7 @@ class autoSnapDriver
const List<pointConstraint>& constraints, const List<pointConstraint>& constraints,
vectorField& disp vectorField& disp
) const; ) const;
//void smoothAndConstrain2
//(
// const bool applyConstraints,
// const indirectPrimitivePatch& pp,
// const List<pointConstraint>& constraints,
// vectorField& disp
//) const;
void calcNearest void calcNearest
( (
const label iter, const label iter,
@ -170,6 +150,7 @@ class autoSnapDriver
vectorField& pointSurfaceNormal, vectorField& pointSurfaceNormal,
vectorField& pointRotation vectorField& pointRotation
) const; ) const;
void calcNearestFace void calcNearestFace
( (
const label iter, const label iter,
@ -180,6 +161,12 @@ class autoSnapDriver
labelList& faceSurfaceRegion, labelList& faceSurfaceRegion,
vectorField& faceRotation vectorField& faceRotation
) const; ) const;
//- Collect (possibly remote) per point data of all surrounding
// faces
// - faceSurfaceNormal
// - faceDisp
// - faceCentres&faceNormal
void calcNearestFacePointProperties void calcNearestFacePointProperties
( (
const label iter, const label iter,
@ -194,6 +181,11 @@ class autoSnapDriver
List<List<point>>& pointFaceCentres, List<List<point>>& pointFaceCentres,
List<labelList>& pointFacePatchID List<labelList>& pointFacePatchID
) const; ) const;
//- Gets passed in offset to nearest point on feature
// edge. Calculates if the point has a different number of
// faces on either side of the feature and if so attracts the
// point to that non-dominant plane.
void correctAttraction void correctAttraction
( (
const DynamicList<point>& surfacePoints, const DynamicList<point>& surfacePoints,
@ -274,6 +266,12 @@ class autoSnapDriver
//- Return hit if faces-on-the-same-normalplane are on multiple //- Return hit if faces-on-the-same-normalplane are on multiple
// patches // patches
// - false, index=-1 : single patch
// - true , index=0 : multiple patches but on different
// normals planes (so geometric feature
// edge is also a region edge)
// - true , index=1 : multiple patches on same normals plane
// i.e. flat region edge
pointIndexHit findMultiPatchPoint pointIndexHit findMultiPatchPoint
( (
const point& pt, const point& pt,
@ -381,6 +379,7 @@ class autoSnapDriver
vectorField& patchAttraction, vectorField& patchAttraction,
List<pointConstraint>& patchConstraints List<pointConstraint>& patchConstraints
) const; ) const;
void reverseAttractMeshPoints void reverseAttractMeshPoints
( (
const label iter, const label iter,
@ -465,6 +464,7 @@ class autoSnapDriver
vectorField& patchAttraction, vectorField& patchAttraction,
List<pointConstraint>& patchConstraints List<pointConstraint>& patchConstraints
) const; ) const;
void preventFaceSqueeze void preventFaceSqueeze
( (
const label iter, const label iter,
@ -582,16 +582,6 @@ public:
vectorField& nearestNormal vectorField& nearestNormal
); );
////- Per patch point calculate point on nearest surface. Set as
//// boundary conditions of motionSmoother displacement field.
//// Return displacement of patch points.
//static vectorField calcNearestLocalSurface
//(
// const meshRefinement& meshRefiner,
// const scalarField& snapDist,
// const indirectPrimitivePatch&
//);
//- Smooth the displacement field to the internal. //- Smooth the displacement field to the internal.
void smoothDisplacement void smoothDisplacement
( (
@ -626,7 +616,6 @@ public:
const scalar planarAngle, const scalar planarAngle,
const snapParameters& snapParams const snapParameters& snapParams
); );
}; };

View File

@ -436,11 +436,6 @@ void Foam::autoSnapDriver::calcNearestFace
} }
// Collect (possibly remote) per point data of all surrounding faces
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// - faceSurfaceNormal
// - faceDisp
// - faceCentres&faceNormal
void Foam::autoSnapDriver::calcNearestFacePointProperties void Foam::autoSnapDriver::calcNearestFacePointProperties
( (
const label iter, const label iter,
@ -639,9 +634,6 @@ void Foam::autoSnapDriver::calcNearestFacePointProperties
} }
// Gets passed in offset to nearest point on feature edge. Calculates
// if the point has a different number of faces on either side of the feature
// and if so attracts the point to that non-dominant plane.
void Foam::autoSnapDriver::correctAttraction void Foam::autoSnapDriver::correctAttraction
( (
const DynamicList<point>& surfacePoints, const DynamicList<point>& surfacePoints,
@ -731,12 +723,6 @@ Foam::label Foam::autoSnapDriver::findNormal
} }
// Detect multiple patches. Returns pointIndexHit:
// - false, index=-1 : single patch
// - true , index=0 : multiple patches but on different normals planes
// (so geometric feature edge is also a region edge)
// - true , index=1 : multiple patches on same normals plane i.e. flat region
// edge
Foam::pointIndexHit Foam::autoSnapDriver::findMultiPatchPoint Foam::pointIndexHit Foam::autoSnapDriver::findMultiPatchPoint
( (
const point& pt, const point& pt,
@ -1009,7 +995,6 @@ void Foam::autoSnapDriver::featureAttractionUsingReconstruction
} }
// Special version that calculates attraction in one go
void Foam::autoSnapDriver::featureAttractionUsingReconstruction void Foam::autoSnapDriver::featureAttractionUsingReconstruction
( (
const label iter, const label iter,
@ -1437,7 +1422,6 @@ void Foam::autoSnapDriver::releasePointsNextToMultiPatch
} }
// If only two attractions and across face return the face indices
Foam::labelPair Foam::autoSnapDriver::findDiagonalAttraction Foam::labelPair Foam::autoSnapDriver::findDiagonalAttraction
( (
const indirectPrimitivePatch& pp, const indirectPrimitivePatch& pp,
@ -1447,6 +1431,7 @@ Foam::labelPair Foam::autoSnapDriver::findDiagonalAttraction
) const ) const
{ {
const face& f = pp.localFaces()[faceI]; const face& f = pp.localFaces()[faceI];
// For now just detect any attraction. Improve this to look at // For now just detect any attraction. Improve this to look at
// actual attraction position and orientation // actual attraction position and orientation
@ -1771,8 +1756,6 @@ Foam::autoSnapDriver::findNearFeaturePoint
} }
// Determines for every pp point - that is on multiple faces that form
// a feature - the nearest feature edge/point.
void Foam::autoSnapDriver::determineFeatures void Foam::autoSnapDriver::determineFeatures
( (
const label iter, const label iter,
@ -2184,17 +2167,6 @@ void Foam::autoSnapDriver::determineFeatures
} }
// Baffle handling
// ~~~~~~~~~~~~~~~
// Override pointAttractor, edgeAttractor, patchAttration etc. to
// implement 'baffle' handling.
// Baffle: the mesh pp point originates from a loose standing
// baffle.
// Sampling the surface with the surrounding face-centres only picks up
// a single triangle normal so above determineFeatures will not have
// detected anything. So explicitly pick up feature edges on the pp
// (after duplicating points & smoothing so will already have been
// expanded) and match these to the features.
void Foam::autoSnapDriver::determineBaffleFeatures void Foam::autoSnapDriver::determineBaffleFeatures
( (
const label iter, const label iter,
@ -2214,6 +2186,16 @@ void Foam::autoSnapDriver::determineBaffleFeatures
List<pointConstraint>& patchConstraints List<pointConstraint>& patchConstraints
) const ) const
{ {
// Override pointAttractor, edgeAttractor, patchAttration etc. to
// implement 'baffle' handling.
// Baffle: the mesh pp point originates from a loose standing
// baffle.
// Sampling the surface with the surrounding face-centres only picks up
// a single triangle normal so above determineFeatures will not have
// detected anything. So explicitly pick up feature edges on the pp
// (after duplicating points & smoothing so will already have been
// expanded) and match these to the features.
const fvMesh& mesh = meshRefiner_.mesh(); const fvMesh& mesh = meshRefiner_.mesh();
const refinementFeatures& features = meshRefiner_.features(); const refinementFeatures& features = meshRefiner_.features();
@ -2966,7 +2948,6 @@ void Foam::autoSnapDriver::featureAttractionUsingFeatureEdges
} }
// Correct for squeezing of face
void Foam::autoSnapDriver::preventFaceSqueeze void Foam::autoSnapDriver::preventFaceSqueeze
( (
const label iter, const label iter,