mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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.
This commit is contained in:
@ -6,5 +6,5 @@ EXE_INC = \
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-lbasicThermophysicalModels \
|
||||
-lspecie
|
||||
-lspecie
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
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);
|
||||
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");
|
||||
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
|
||||
@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.
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user