mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -734,7 +734,8 @@ private:
|
||||
//- edge conformation location
|
||||
bool nearFeatureEdgeLocation
|
||||
(
|
||||
pointIndexHit& pHit
|
||||
const pointIndexHit& pHit,
|
||||
pointIndexHit& nearestEdgeHit
|
||||
) const;
|
||||
|
||||
//- Build or rebuild the edge location tree
|
||||
|
||||
@ -1897,87 +1897,87 @@ void Foam::conformalVoronoiMesh::indexDualVertices
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
// Snapping points far outside
|
||||
if (cit->boundaryDualVertex() && !cit->parallelDualVertex())
|
||||
{
|
||||
pointFromPoint dual = cit->dual();
|
||||
|
||||
pointIndexHit hitInfo;
|
||||
label surfHit;
|
||||
|
||||
// Find nearest surface point
|
||||
geometryToConformTo_.findSurfaceNearest
|
||||
(
|
||||
dual,
|
||||
sqr(targetCellSize(dual)),
|
||||
hitInfo,
|
||||
surfHit
|
||||
);
|
||||
|
||||
if (!hitInfo.hit())
|
||||
{
|
||||
// Project dual to nearest point on tet
|
||||
|
||||
tetPointRef tet
|
||||
(
|
||||
topoint(cit->vertex(0)->point()),
|
||||
topoint(cit->vertex(1)->point()),
|
||||
topoint(cit->vertex(2)->point()),
|
||||
topoint(cit->vertex(3)->point())
|
||||
);
|
||||
|
||||
pointFromPoint nearestPointOnTet =
|
||||
tet.nearestPoint(dual).rawPoint();
|
||||
|
||||
// Get nearest point on surface from tet.
|
||||
geometryToConformTo_.findSurfaceNearest
|
||||
(
|
||||
nearestPointOnTet,
|
||||
sqr(targetCellSize(nearestPointOnTet)),
|
||||
hitInfo,
|
||||
surfHit
|
||||
);
|
||||
|
||||
vector snapDir = nearestPointOnTet - dual;
|
||||
snapDir /= mag(snapDir) + SMALL;
|
||||
|
||||
drawDelaunayCell(tetToSnapTo, cit, offset);
|
||||
offset += 1;
|
||||
|
||||
vectorField norm(1);
|
||||
allGeometry_[surfHit].getNormal
|
||||
(
|
||||
List<pointIndexHit>(1, hitInfo),
|
||||
norm
|
||||
);
|
||||
norm[0] /= mag(norm[0]) + SMALL;
|
||||
|
||||
if
|
||||
(
|
||||
hitInfo.hit()
|
||||
&& (mag(snapDir & norm[0]) > 0.5)
|
||||
)
|
||||
{
|
||||
snapping1.write
|
||||
(
|
||||
linePointRef(dual, nearestPointOnTet)
|
||||
);
|
||||
|
||||
snapping2.write
|
||||
(
|
||||
linePointRef
|
||||
(
|
||||
nearestPointOnTet,
|
||||
hitInfo.hitPoint()
|
||||
)
|
||||
);
|
||||
|
||||
pts[cit->cellIndex()] = hitInfo.hitPoint();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// {
|
||||
// // Snapping points far outside
|
||||
// if (cit->boundaryDualVertex() && !cit->parallelDualVertex())
|
||||
// {
|
||||
// pointFromPoint dual = cit->dual();
|
||||
//
|
||||
// pointIndexHit hitInfo;
|
||||
// label surfHit;
|
||||
//
|
||||
// // Find nearest surface point
|
||||
// geometryToConformTo_.findSurfaceNearest
|
||||
// (
|
||||
// dual,
|
||||
// sqr(targetCellSize(dual)),
|
||||
// hitInfo,
|
||||
// surfHit
|
||||
// );
|
||||
//
|
||||
// if (!hitInfo.hit())
|
||||
// {
|
||||
// // Project dual to nearest point on tet
|
||||
//
|
||||
// tetPointRef tet
|
||||
// (
|
||||
// topoint(cit->vertex(0)->point()),
|
||||
// topoint(cit->vertex(1)->point()),
|
||||
// topoint(cit->vertex(2)->point()),
|
||||
// topoint(cit->vertex(3)->point())
|
||||
// );
|
||||
//
|
||||
// pointFromPoint nearestPointOnTet =
|
||||
// tet.nearestPoint(dual).rawPoint();
|
||||
//
|
||||
// // Get nearest point on surface from tet.
|
||||
// geometryToConformTo_.findSurfaceNearest
|
||||
// (
|
||||
// nearestPointOnTet,
|
||||
// sqr(targetCellSize(nearestPointOnTet)),
|
||||
// hitInfo,
|
||||
// surfHit
|
||||
// );
|
||||
//
|
||||
// vector snapDir = nearestPointOnTet - dual;
|
||||
// snapDir /= mag(snapDir) + SMALL;
|
||||
//
|
||||
// drawDelaunayCell(tetToSnapTo, cit, offset);
|
||||
// offset += 1;
|
||||
//
|
||||
// vectorField norm(1);
|
||||
// allGeometry_[surfHit].getNormal
|
||||
// (
|
||||
// List<pointIndexHit>(1, hitInfo),
|
||||
// norm
|
||||
// );
|
||||
// norm[0] /= mag(norm[0]) + SMALL;
|
||||
//
|
||||
// if
|
||||
// (
|
||||
// hitInfo.hit()
|
||||
// && (mag(snapDir & norm[0]) > 0.5)
|
||||
// )
|
||||
// {
|
||||
// snapping1.write
|
||||
// (
|
||||
// linePointRef(dual, nearestPointOnTet)
|
||||
// );
|
||||
//
|
||||
// snapping2.write
|
||||
// (
|
||||
// linePointRef
|
||||
// (
|
||||
// nearestPointOnTet,
|
||||
// hitInfo.hitPoint()
|
||||
// )
|
||||
// );
|
||||
//
|
||||
// pts[cit->cellIndex()] = hitInfo.hitPoint();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
if (cit->boundaryDualVertex())
|
||||
{
|
||||
|
||||
@ -1928,14 +1928,16 @@ bool Foam::conformalVoronoiMesh::pointIsNearSurfaceLocation
|
||||
|
||||
bool Foam::conformalVoronoiMesh::nearFeatureEdgeLocation
|
||||
(
|
||||
pointIndexHit& pHit
|
||||
const pointIndexHit& pHit,
|
||||
pointIndexHit& nearestEdgeHit
|
||||
) const
|
||||
{
|
||||
Foam::point pt = pHit.hitPoint();
|
||||
const Foam::point& pt = pHit.hitPoint();
|
||||
|
||||
const scalar exclusionRangeSqr = featureEdgeExclusionDistanceSqr(pt);
|
||||
|
||||
bool closeToFeatureEdge = pointIsNearFeatureEdgeLocation(pt);
|
||||
bool closeToFeatureEdge =
|
||||
pointIsNearFeatureEdgeLocation(pt, nearestEdgeHit);
|
||||
|
||||
if (closeToFeatureEdge)
|
||||
{
|
||||
@ -1978,15 +1980,11 @@ bool Foam::conformalVoronoiMesh::nearFeatureEdgeLocation
|
||||
if
|
||||
(
|
||||
mag(cosAngle) < searchConeAngle
|
||||
&& (
|
||||
mag(lineBetweenPoints)
|
||||
> foamyHexMeshControls().pointPairDistanceCoeff()
|
||||
*targetCellSize(pt)
|
||||
)
|
||||
&& (mag(lineBetweenPoints) > pointPairDistance(pt))
|
||||
)
|
||||
{
|
||||
pt = edgeHit.hitPoint();
|
||||
pHit.setPoint(pt);
|
||||
//pt = edgeHit.hitPoint();
|
||||
//pHit.setPoint(pt);
|
||||
closeToFeatureEdge = false;
|
||||
}
|
||||
else
|
||||
@ -2183,12 +2181,12 @@ void Foam::conformalVoronoiMesh::addSurfaceAndEdgeHits
|
||||
|
||||
if
|
||||
(
|
||||
!pointIsNearFeatureEdgeLocation
|
||||
(
|
||||
edPt,
|
||||
nearestEdgeHit
|
||||
)
|
||||
// !nearFeatureEdgeLocation(edHit)
|
||||
// !pointIsNearFeatureEdgeLocation
|
||||
// (
|
||||
// edPt,
|
||||
// nearestEdgeHit
|
||||
// )
|
||||
!nearFeatureEdgeLocation(edHit, nearestEdgeHit)
|
||||
)
|
||||
{
|
||||
appendToEdgeLocationTree(edPt);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -122,6 +122,7 @@ void Foam::regionModels::regionModel1D::initialise()
|
||||
|
||||
surfaceScalarField& nMagSf = nMagSfPtr_();
|
||||
|
||||
localPyrolysisFaceI = 0;
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label patchI = intCoupledPatchIDs_[i];
|
||||
@ -132,7 +133,7 @@ void Foam::regionModels::regionModel1D::initialise()
|
||||
forAll(pNormals, localFaceI)
|
||||
{
|
||||
const vector& n = pNormals[localFaceI];
|
||||
const labelList& faces = boundaryFaceFaces_[localFaceI];
|
||||
const labelList& faces = boundaryFaceFaces_[localPyrolysisFaceI++];
|
||||
forAll (faces, faceI)
|
||||
{
|
||||
const label faceID = faces[faceI];
|
||||
|
||||
@ -47,8 +47,8 @@ namespace Foam
|
||||
defineTemplateTypeNameAndDebugWithName \
|
||||
( \
|
||||
SS##Schem##Comp##SThermo##GThermo, \
|
||||
(#SS"<" + word(Schem::typeName_()) +"<"#Comp"," + SThermo::typeName() \
|
||||
+ "," + GThermo::typeName() + ">>").c_str(), \
|
||||
(#SS"<"#Schem"<"#Comp"," + SThermo::typeName() + "," \
|
||||
+ GThermo::typeName() + ">>").c_str(), \
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
|
||||
Reference in New Issue
Block a user