Commit 00985638 authored by Mark Olesen's avatar Mark Olesen
Browse files

remove fvCFD.H usage from remaining library source

- exception calcType.H since it'll most likely be used for building
  applications anyhow

- use quailified names in more of the lagrangian code

- killed some tab indents in various places.
parent 2f8c7782
......@@ -6,5 +6,5 @@ EXE_INC = \
EXE_LIBS = \
-lfiniteVolume \
-lbasicThermophysicalModels \
-lspecie
-lspecie
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
......
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
......
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
......
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/errorEstimation/lnInclude
EXE_LIBS = \
......
......@@ -198,8 +198,11 @@ void ReadVertices
int dims = 1;
float scale;
CCMIOID mapID;
CCMIOReadVerticesf(&err, vertices, &dims, &scale, &mapID, verts.begin(),
offset, offsetPlusSize);
CCMIOReadVerticesf
(
&err, vertices, &dims, &scale, &mapID, verts.begin(),
offset, offsetPlusSize
);
CCMIOReadMap(&err, mapID, mapData.begin(), offset, offsetPlusSize);
//CCMIOSize size;
......@@ -245,35 +248,34 @@ void ReadProblem
== kCCMIONoErr
)
{
char *name;
int size;
char *name;
int size;
int cellType;
// ... if it has a material type. (Note that we do not pass in
// an array to get the name because we do not know how long the
// string is yet. Many parameters to CCMIO functions that
// ... if it has a material type. (Note that we do not pass in
// an array to get the name because we do not know how long the
// string is yet. Many parameters to CCMIO functions that
// return
// data can be NULL if that data is not needed.)
if
// data can be NULL if that data is not needed.)
if
(
CCMIOReadOptstr(NULL, next, "MaterialType", &size, NULL)
== kCCMIONoErr
)
{
name = new char[size + 1];
CCMIOReadOptstr(&err, next, "MaterialType", &size, name);
CCMIOGetEntityIndex(&err, next, &cellType);
{
name = new char[size + 1];
CCMIOReadOptstr(&err, next, "MaterialType", &size, name);
CCMIOGetEntityIndex(&err, next, &cellType);
foamCellTypeNames.insert(cellType, name);
Pout<< "Celltype:" << cellType << " name:" << name << endl;
delete [] name;
}
delete [] name;
}
}
// ... walk through each region description and print it...
CCMIOID boundary;
label regionI = 0;
int k = 0;
......@@ -320,13 +322,13 @@ void ReadProblem
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, NULL)
== kCCMIONoErr
)
{
char* s = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s);
{
char* s = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s);
s[size] = '\0';
foamPatchTypes[foamPatchI] = string::validate<word>(string(s));
delete [] s;
}
delete [] s;
}
//foamPatchMap.append(prostarI);
......@@ -342,28 +344,28 @@ void ReadProblem
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, NULL)
== kCCMIONoErr
)
{
char* name = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name);
{
char* name = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name);
name[size] = '\0';
foamPatchNames[foamPatchI] = string::validate<word>(string(name));
delete [] name;
}
delete [] name;
}
else if
(
CCMIOReadOptstr(NULL, boundary, "Label", &size, NULL)
== kCCMIONoErr
)
{
char* name = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "Label", &size, name);
{
char* name = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "Label", &size, name);
name[size] = '\0';
foamPatchNames[foamPatchI] = string::validate<word>(string(name));
delete [] name;
}
delete [] name;
}
else
{
foamPatchNames[foamPatchI] =
foamPatchNames[foamPatchI] =
foamPatchTypes[foamPatchI]
+ Foam::name(foamPatchI);
Pout<< "Made up name:" << foamPatchNames[foamPatchI]
......@@ -440,8 +442,8 @@ void ReadCells
== kCCMIONoErr
)
{
CCMIOSize size;
CCMIOEntitySize(&err, id, &size, NULL);
CCMIOSize size;
CCMIOEntitySize(&err, id, &size, NULL);
Pout<< "Read kCCMIOBoundaryFaces entry with " << size
<< " faces." << endl;
......@@ -461,13 +463,13 @@ void ReadCells
CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id);
CCMIOSize size;
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, NULL, &size, NULL,
kCCMIOStart, kCCMIOEnd);
kCCMIOStart, kCCMIOEnd);
std::vector<int> faces(size);
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, NULL, &faces[0],
kCCMIOStart, kCCMIOEnd);
kCCMIOStart, kCCMIOEnd);
std::vector<int> faceCells(2*nInternalFaces);
CCMIOReadFaceCells(&err, id, kCCMIOInternalFaces, &faceCells[0],
kCCMIOStart, kCCMIOEnd);
kCCMIOStart, kCCMIOEnd);
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
CheckError(err, "Error reading internal faces");
......@@ -505,19 +507,19 @@ void ReadCells
)
{
CCMIOSize nFaces;
CCMIOEntitySize(&err, id, &nFaces, NULL);
mapData.resize(nFaces);
faceCells.resize(nFaces);
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, NULL, &size, NULL,
kCCMIOStart, kCCMIOEnd);
faces.resize(size);
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, NULL, &faces[0],
kCCMIOStart, kCCMIOEnd);
CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0],
kCCMIOStart, kCCMIOEnd);
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
CheckError(err, "Error reading boundary faces");
CCMIOEntitySize(&err, id, &nFaces, NULL);
mapData.resize(nFaces);
faceCells.resize(nFaces);
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, NULL, &size, NULL,
kCCMIOStart, kCCMIOEnd);
faces.resize(size);
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, NULL, &faces[0],
kCCMIOStart, kCCMIOEnd);
CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0],
kCCMIOStart, kCCMIOEnd);
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
CheckError(err, "Error reading boundary faces");
// Read prostar id
int prostarI;
......@@ -672,9 +674,9 @@ int main(int argc, char *argv[])
if (err != kCCMIONoErr)
{
// Maybe no solution; try again
err = kCCMIONoErr;
CCMIOReadProcessor
// Maybe no solution; try again
err = kCCMIONoErr;
CCMIOReadProcessor
(
&err,
processor,
......@@ -683,12 +685,12 @@ int main(int argc, char *argv[])
NULL,
NULL
);
if (err != kCCMIONoErr)
{
FatalErrorIn(args.executable())
if (err != kCCMIONoErr)
{
FatalErrorIn(args.executable())
<< "Could not read the file."
<< exit(FatalError);
}
}
}
ReadVertices(err, vertices, foamPointMap, foamPoints);
......
......@@ -30,33 +30,34 @@ Description
and run tetgen with -f option.
Sample smesh file:
@verbatim
# cube.smesh -- A 10x10x10 cube
8 3
1 0 0 0
2 0 10 0
3 10 10 0
4 10 0 0
5 0 0 10
6 0 10 10
7 10 10 10
8 10 0 10
1 0 0 0
2 0 10 0
3 10 10 0
4 10 0 0
5 0 0 10
6 0 10 10
7 10 10 10
8 10 0 10
6 1 # 1 for boundary info present
4 1 2 3 4 11 # region number 11
4 5 6 7 8 21 # region number 21
4 1 2 6 5 3
4 4 3 7 8 43
4 1 5 8 4 5
4 2 6 7 3 65
4 1 2 3 4 11 # region number 11
4 5 6 7 8 21 # region number 21
4 1 2 6 5 3
4 4 3 7 8 43
4 1 5 8 4 5
4 2 6 7 3 65
0
0
NOTE:
- for some reason boundary faces point inwards. I just reverse them
always. Might use some geometric check instead.
- marked faces might not actually be boundary faces of mesh.
This is hopefully handled now by first constructing without boundaries
and then reconstructing with boundary faces.
@endverbatim
Note
- for some reason boundary faces point inwards. I just reverse them
always. Might use some geometric check instead.
- marked faces might not actually be boundary faces of mesh.
This is hopefully handled now by first constructing without boundaries
and then reconstructing with boundary faces.
\*---------------------------------------------------------------------------*/
......
......@@ -3,5 +3,5 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-ldynamicMesh \
-ldynamicMesh \
-lmeshTools
......@@ -34,12 +34,10 @@ License
#include "OFstream.H"
#include "IOmanip.H"
namespace Foam
{
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void ensightCaseEntry
void Foam::ensightCaseEntry
(
OFstream& caseFile,
const string& ensightType,
......@@ -89,7 +87,7 @@ void ensightCaseEntry
}
void ensightParticlePositions
void Foam::ensightParticlePositions
(
const polyMesh& mesh,
const fileName& dataDir,
......@@ -113,7 +111,7 @@ void ensightParticlePositions
os.newline();
os.write("particle coordinates");
os.newline();
os.write(parcels.size(), 8); // unusual width
os.write(parcels.size(), 8); // unusual width
os.newline();
// binary write is Ensight6 - first ids, then positions
......@@ -141,7 +139,7 @@ void ensightParticlePositions
{
const vector& p = elmnt().position();
os.write(++nParcels, 8); // unusual width
os.write(++nParcels, 8); // unusual width
os.write(p.x());
os.write(p.y());
os.write(p.z());
......@@ -153,7 +151,7 @@ void ensightParticlePositions
template<class Type>
void ensightLagrangianField
void Foam::ensightLagrangianField
(
const IOobject& fieldObject,
const fileName& dataDir,
......@@ -211,7 +209,7 @@ void ensightLagrangianField
//- write generalized field components
template <class Type>
void ensightVolField
void Foam::ensightVolField
(
const ensightParts& partsList,
const IOobject& fieldObject,
......@@ -241,9 +239,5 @@ void ensightVolField
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // namespace Foam
// ************************************************************************* //
......@@ -1195,16 +1195,15 @@ void register_data_readers()
/*
** like this for combined unstructured grids & results in a single file
*/
reg_single_unstruct_reader (
"Foam Reader", /* title you want for data reader */
user_query_file_function, /* whatever you called this */
user_read_one_grid_function /* whatever you called this */
);
reg_single_unstruct_reader
(
"Foam Reader", /* title you want for data reader */
user_query_file_function, /* whatever you called this */
user_read_one_grid_function /* whatever you called this */
);
}
}
......
......@@ -38,9 +38,9 @@ setFormat raw;
surfaceFormat vtk;
// interpolationScheme. choice of
// cell : use cell-centre value only; constant over cells (default)
// cellPoint : use cell-centre and vertex values
// cellPointFace : use cell-centre, vertex and face values.
// cell : use cell-centre value only; constant over cells (default)
// cellPoint : use cell-centre and vertex values
// cellPointFace : use cell-centre, vertex and face values.
// 1] vertex values determined from neighbouring cell-centre values
// 2] face values determined using the current face interpolation scheme
// for the field (linear, gamma, etc.)
......
......@@ -223,7 +223,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp)
{
unmappedSource.erase(sourceParticleI);
addParticles.append(sourceParticleI);
iter().cell()=targetCell;
iter().cell()=targetCell;
targetParcels.addParticle
(
sourceParcels.remove(&iter())
......
......@@ -25,10 +25,10 @@ License
Description
Surface coarsening using 'bunnylod':
Polygon Reduction Demo
By Stan Melax (c) 1998
mailto:melax@cs.ualberta.ca
http://www.cs.ualberta.ca/~melax
Polygon Reduction Demo
By Stan Melax (c) 1998
mailto:melax@cs.ualberta.ca
http://www.cs.ualberta.ca/~melax
\*---------------------------------------------------------------------------*/
......@@ -55,7 +55,7 @@ int mapVertex(::List<int>& collapse_map, int a, int mx)
}
while (a >= mx)
{
a = collapse_map[a];
a = collapse_map[a];
}
return a;
}
......
......@@ -192,7 +192,7 @@ SunOS)
export WM_MPLIB=FJMPI
;;
*) # an unsupported operating system
*) # an unsupported operating system
cat <<USAGE
Your "$WM_ARCH" operating system is not supported by this release
......
......@@ -29,10 +29,9 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(Foam::RK, 0);
namespace Foam
{
defineTypeNameAndDebug(Foam::RK, 0);
addToRunTimeSelectionTable(ODESolver, RK, ODE);
const scalar
......@@ -85,28 +84,28 @@ void Foam::RK::solve
{
forAll(yTemp_, i)
{
yTemp_[i] = y[i] + b21*h*dydx[i];
yTemp_[i] = y[i] + b21*h*dydx[i];
}
ode.derivatives(x + a2*h, yTemp_, ak2_);
forAll(yTemp_, i)
{
yTemp_[i] = y[i] + h*(b31*dydx[i] + b32*ak2_[i]);
yTemp_[i] = y[i] + h*(b31*dydx[i] + b32*ak2_[i]);
}
ode.derivatives(x + a3*h, yTemp_, ak3_);
forAll(yTemp_, i)
{
yTemp_[i] = y[i] + h*(b41*dydx[i] + b42*ak2_[i] + b43*ak3_[i]);
yTemp_[i] = y[i] + h*(b41*dydx[i] + b42*ak2_[i] + b43*ak3_[i]);
}
ode.derivatives(x + a4*h, yTemp_, ak4_);
forAll(yTemp_, i)
{
yTemp_[i] = y[i]
yTemp_[i] = y[i]
+ h*(b51*dydx[i] + b52*ak2_[i] + b53*ak3_[i] + b54*ak4_[i]);
}
......@@ -114,7 +113,7 @@ void Foam::RK::solve
forAll(yTemp_, i)
{
yTemp_[i] = y[i]
yTemp_[i] = y[i]
+ h*
(
b61*dydx[i] + b62*ak2_[i] + b63*ak3_[i]
......@@ -126,13 +125,13 @@ void Foam::RK::solve
forAll(yout, i)
{
yout[i] = y[i]
yout[i] = y[i]
+ h*(c1*dydx[i] + c3*ak3_[i] + c4*ak4_[i] + c6*ak6_[i]);
}
forAll(yerr, i)
{
yerr[i] =
yerr[i] =
h*
(
dc1*dydx[i] + dc3*ak3_[i] + dc4*ak4_[i]
......@@ -160,16 +159,16 @@ void Foam::RK::solve
for (;;)
{
solve(ode, x, y, dydx, h, yTemp2_, yErr_);
solve(ode, x, y, dydx, h, yTemp2_, yErr_);
maxErr = 0.0;
for (register label i=0; i<n_; i++)
maxErr = 0.0;
for (register label i=0; i<n_; i++)
{
maxErr = max(maxErr, mag(yErr_[i]/yScale[i]));
}
maxErr /= eps;
maxErr /= eps;
if (maxErr <= 1.0)
if (maxErr <= 1.0)
{
break;
}
......@@ -179,7 +178,7 @@ void Foam::RK::solve
h = (h >= 0.0 ? max(hTemp, 0.1*h) : min(hTemp, 0.1*h));
}
if (h < VSMALL)
if (h < VSMALL)
{
FatalErrorIn("RK::solve")
<< "stepsize underflow"
......
......@@ -26,7 +26,7 @@ Class
Foam::RK
Description
Foam::RK
Runge-Kutta ODE solver
SourceFiles
RKCK.C
......@@ -53,6 +53,15 @@ class RK
public ODESolver
{
// Private data
static const scalar safety, pGrow, pShrink, errCon;
static const scalar
a2, a3, a4, a5, a6,
b21, b31, b32, b41, b42, b43,
b51, b52, b53, b54, b61, b62, b63, b64, b65,
c1, c3, c4, c6,
dc1, dc3, dc4, dc5, dc6;
mutable scalarField yTemp_;
mutable scalarField ak2_;
......@@ -64,16 +73,6 @@ class RK
mutable scalarField yErr_;
mutable scalarField yTemp2_;
static const scalar safety, pGrow, pShrink, errCon;
static const scalar
a2, a3, a4, a5, a6,