mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: featureEdgeMesh IO now stream based, not dictionary lookup.
Allows binary IO without pain. labelListLists a problem for writeEntry().
This commit is contained in:
@ -90,32 +90,22 @@ Foam::featureEdgeMesh::featureEdgeMesh(const IOobject& io)
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
dictionary edgeMeshDict(readStream(typeName));
|
Istream& is = readStream(typeName);
|
||||||
|
|
||||||
edgeMesh::operator=
|
is >> *this
|
||||||
(
|
>> concaveStart_
|
||||||
edgeMesh
|
>> mixedStart_
|
||||||
(
|
>> nonFeatureStart_
|
||||||
pointField(edgeMeshDict.lookup("points")),
|
>> internalStart_
|
||||||
edgeList(edgeMeshDict.lookup("edges"))
|
>> flatStart_
|
||||||
)
|
>> openStart_
|
||||||
);
|
>> multipleStart_
|
||||||
|
>> normals_
|
||||||
|
>> edgeNormals_
|
||||||
|
>> featurePointNormals_
|
||||||
|
>> regionEdges_;
|
||||||
|
|
||||||
concaveStart_ = readLabel(edgeMeshDict.lookup("concaveStart"));
|
close();
|
||||||
|
|
||||||
mixedStart_ = readLabel(edgeMeshDict.lookup("mixedStart"));
|
|
||||||
|
|
||||||
nonFeatureStart_ = readLabel(edgeMeshDict.lookup("nonFeatureStart"));
|
|
||||||
|
|
||||||
internalStart_ = readLabel(edgeMeshDict.lookup("internalStart"));
|
|
||||||
|
|
||||||
flatStart_ = readLabel(edgeMeshDict.lookup("flatStart"));
|
|
||||||
|
|
||||||
openStart_ = readLabel(edgeMeshDict.lookup("openStart"));
|
|
||||||
|
|
||||||
multipleStart_ = readLabel(edgeMeshDict.lookup("multipleStart"));
|
|
||||||
|
|
||||||
normals_ = vectorField(edgeMeshDict.lookup("normals"));
|
|
||||||
|
|
||||||
{
|
{
|
||||||
// Calculate edgeDirections
|
// Calculate edgeDirections
|
||||||
@ -133,17 +123,6 @@ Foam::featureEdgeMesh::featureEdgeMesh(const IOobject& io)
|
|||||||
|
|
||||||
edgeDirections_ /= mag(edgeDirections_);
|
edgeDirections_ /= mag(edgeDirections_);
|
||||||
}
|
}
|
||||||
|
|
||||||
edgeNormals_ = labelListList(edgeMeshDict.lookup("edgeNormals"));
|
|
||||||
|
|
||||||
featurePointNormals_ = labelListList
|
|
||||||
(
|
|
||||||
edgeMeshDict.lookup("featurePointNormals")
|
|
||||||
);
|
|
||||||
|
|
||||||
regionEdges_ = labelList(edgeMeshDict.lookup("regionEdges"));
|
|
||||||
|
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -1016,44 +995,25 @@ void Foam::featureEdgeMesh::writeObj
|
|||||||
|
|
||||||
bool Foam::featureEdgeMesh::writeData(Ostream& os) const
|
bool Foam::featureEdgeMesh::writeData(Ostream& os) const
|
||||||
{
|
{
|
||||||
os.writeKeyword("concaveStart") << concaveStart_ << token::END_STATEMENT
|
os << "// points, edges, concaveStart, mixedStart, nonFeatureStart, " << nl
|
||||||
<< nl << nl;
|
<< "// internalStart, flatStart, openStart, multipleStart, " << nl
|
||||||
|
<< "// normals, edgeNormals, featurePointNormals, regionEdges" << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
os.writeKeyword("mixedStart") << mixedStart_ << token::END_STATEMENT
|
os << points() << nl
|
||||||
<< nl << nl;
|
<< edges() << nl
|
||||||
|
<< concaveStart_ << token::SPACE
|
||||||
os.writeKeyword("nonFeatureStart") << nonFeatureStart_
|
<< mixedStart_ << token::SPACE
|
||||||
<< token::END_STATEMENT << nl << nl;
|
<< nonFeatureStart_ << token::SPACE
|
||||||
|
<< internalStart_ << token::SPACE
|
||||||
os.writeKeyword("points") << points() << token::END_STATEMENT
|
<< flatStart_ << token::SPACE
|
||||||
<< nl << nl;
|
<< openStart_ << token::SPACE
|
||||||
|
<< multipleStart_ << nl
|
||||||
os.writeKeyword("internalStart") << internalStart_ << token::END_STATEMENT
|
<< normals_ << nl
|
||||||
<< nl << nl;
|
<< edgeNormals_ << nl
|
||||||
|
<< featurePointNormals_ << nl
|
||||||
os.writeKeyword("flatStart") << flatStart_ << token::END_STATEMENT
|
<< regionEdges_
|
||||||
<< nl << nl;
|
<< endl;
|
||||||
|
|
||||||
os.writeKeyword("openStart") << openStart_ << token::END_STATEMENT
|
|
||||||
<< nl << nl;
|
|
||||||
|
|
||||||
os.writeKeyword("multipleStart") << multipleStart_ << token::END_STATEMENT
|
|
||||||
<< nl << nl;
|
|
||||||
|
|
||||||
os.writeKeyword("edges") << edges() << token::END_STATEMENT
|
|
||||||
<< nl << nl;
|
|
||||||
|
|
||||||
os.writeKeyword("normals") << normals_ << token::END_STATEMENT
|
|
||||||
<< nl << nl;
|
|
||||||
|
|
||||||
os.writeKeyword("edgeNormals") << edgeNormals_ << token::END_STATEMENT
|
|
||||||
<< nl << nl;
|
|
||||||
|
|
||||||
os.writeKeyword("featurePointNormals") << featurePointNormals_
|
|
||||||
<< token::END_STATEMENT << nl << nl;
|
|
||||||
|
|
||||||
os.writeKeyword("regionEdges") << regionEdges_ << token::END_STATEMENT
|
|
||||||
<< nl << nl;
|
|
||||||
|
|
||||||
return os.good();
|
return os.good();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user