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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user