mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
instance searching
This commit is contained in:
@ -1341,27 +1341,53 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
|
||||
dict_(io, dict)
|
||||
{
|
||||
read();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Constructed from triSurface:" << endl;
|
||||
writeStats(Info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh(const IOobject& io)
|
||||
:
|
||||
triSurfaceMesh(io),
|
||||
//triSurfaceMesh(io),
|
||||
triSurfaceMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
io.name(),
|
||||
io.time().findInstance(io.local(), word::null),
|
||||
io.local(),
|
||||
io.db(),
|
||||
io.readOpt(),
|
||||
io.writeOpt(),
|
||||
io.registerObject()
|
||||
)
|
||||
),
|
||||
dict_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
searchableSurface::name() + "Dict",
|
||||
searchableSurface::instance(),
|
||||
searchableSurface::local(),
|
||||
searchableSurface::db(),
|
||||
searchableSurface::readOpt(),
|
||||
searchableSurface::writeOpt(),
|
||||
searchableSurface::registerObject()
|
||||
triSurfaceMesh::name() + "Dict",
|
||||
triSurfaceMesh::instance(),
|
||||
triSurfaceMesh::local(),
|
||||
triSurfaceMesh::db(),
|
||||
triSurfaceMesh::readOpt(),
|
||||
triSurfaceMesh::writeOpt(),
|
||||
triSurfaceMesh::registerObject()
|
||||
)
|
||||
)
|
||||
{
|
||||
read();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Read distributedTriSurface from " << io.objectPath()
|
||||
<< ':' << endl;
|
||||
writeStats(Info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1371,22 +1397,43 @@ Foam::distributedTriSurfaceMesh::distributedTriSurfaceMesh
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
triSurfaceMesh(io, dict),
|
||||
//triSurfaceMesh(io, dict),
|
||||
triSurfaceMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
io.name(),
|
||||
io.time().findInstance(io.local(), word::null),
|
||||
io.local(),
|
||||
io.db(),
|
||||
io.readOpt(),
|
||||
io.writeOpt(),
|
||||
io.registerObject()
|
||||
),
|
||||
dict
|
||||
),
|
||||
dict_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
searchableSurface::name() + "Dict",
|
||||
searchableSurface::instance(),
|
||||
searchableSurface::local(),
|
||||
searchableSurface::db(),
|
||||
searchableSurface::readOpt(),
|
||||
searchableSurface::writeOpt(),
|
||||
searchableSurface::registerObject()
|
||||
triSurfaceMesh::name() + "Dict",
|
||||
triSurfaceMesh::instance(),
|
||||
triSurfaceMesh::local(),
|
||||
triSurfaceMesh::db(),
|
||||
triSurfaceMesh::readOpt(),
|
||||
triSurfaceMesh::writeOpt(),
|
||||
triSurfaceMesh::registerObject()
|
||||
)
|
||||
)
|
||||
{
|
||||
read();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Read distributedTriSurface from " << io.objectPath()
|
||||
<< " and dictionary:" << endl;
|
||||
writeStats(Info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -317,10 +317,11 @@ public:
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
//- Construct read
|
||||
//- Construct read. Does findInstance to find io.local().
|
||||
distributedTriSurfaceMesh(const IOobject& io);
|
||||
|
||||
//- Construct from dictionary (used by searchableSurface)
|
||||
//- Construct from dictionary (used by searchableSurface).
|
||||
// Does read. Does findInstance to find io.local().
|
||||
distributedTriSurfaceMesh
|
||||
(
|
||||
const IOobject& io,
|
||||
|
||||
@ -53,7 +53,14 @@ Foam::pointIndexHit Foam::searchableSphere::findNearest
|
||||
|
||||
if (nearestDistSqr > sqr(magN-radius_))
|
||||
{
|
||||
info.rawPoint() = centre_ + n/magN*radius_;
|
||||
if (magN < ROOTVSMALL)
|
||||
{
|
||||
info.rawPoint() = centre_ + vector(1,0,0)/magN*radius_;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.rawPoint() = centre_ + n/magN*radius_;
|
||||
}
|
||||
info.setHit();
|
||||
info.setIndex(0);
|
||||
}
|
||||
|
||||
@ -228,19 +228,19 @@ Foam::triSurfaceMesh::triSurfaceMesh(const IOobject& io, const triSurface& s)
|
||||
Foam::triSurfaceMesh::triSurfaceMesh(const IOobject& io)
|
||||
:
|
||||
// Find instance for triSurfaceMesh
|
||||
searchableSurface
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
io.name(),
|
||||
io.time().findInstance(io.local(), word::null),
|
||||
io.local(),
|
||||
io.db(),
|
||||
io.readOpt(),
|
||||
io.writeOpt(),
|
||||
io.registerObject()
|
||||
)
|
||||
),
|
||||
searchableSurface(io),
|
||||
//(
|
||||
// IOobject
|
||||
// (
|
||||
// io.name(),
|
||||
// io.time().findInstance(io.local(), word::null),
|
||||
// io.local(),
|
||||
// io.db(),
|
||||
// io.readOpt(),
|
||||
// io.writeOpt(),
|
||||
// io.registerObject()
|
||||
// )
|
||||
//),
|
||||
// Reused found instance in objectRegistry
|
||||
objectRegistry
|
||||
(
|
||||
@ -273,19 +273,19 @@ Foam::triSurfaceMesh::triSurfaceMesh
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
searchableSurface
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
io.name(),
|
||||
io.time().findInstance(io.local(), word::null),
|
||||
io.local(),
|
||||
io.db(),
|
||||
io.readOpt(),
|
||||
io.writeOpt(),
|
||||
io.registerObject()
|
||||
)
|
||||
),
|
||||
searchableSurface(io),
|
||||
//(
|
||||
// IOobject
|
||||
// (
|
||||
// io.name(),
|
||||
// io.time().findInstance(io.local(), word::null),
|
||||
// io.local(),
|
||||
// io.db(),
|
||||
// io.readOpt(),
|
||||
// io.writeOpt(),
|
||||
// io.registerObject()
|
||||
// )
|
||||
//),
|
||||
// Reused found instance in objectRegistry
|
||||
objectRegistry
|
||||
(
|
||||
|
||||
@ -117,7 +117,6 @@ public:
|
||||
triSurfaceMesh(const IOobject& io);
|
||||
|
||||
//- Construct from IO and dictionary (used by searchableSurface).
|
||||
// Does timeInstance search.
|
||||
// Dictionary may contain a 'scale' entry (eg, 0.001: mm -> m)
|
||||
triSurfaceMesh
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user