Commit c5998b70 authored by mattijs's avatar mattijs
Browse files

improved matching

parent 105f09b6
......@@ -225,6 +225,8 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
// Dump halves
{
OFstream str(prefix+cycPatch.name()+"_half0.obj");
Pout<< "Dumping cycPatch.name() half0 faces to " << str.name()
<< endl;
meshTools::writeOBJ
(
str,
......@@ -241,6 +243,8 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
}
{
OFstream str(prefix+cycPatch.name()+"_half1.obj");
Pout<< "Dumping cycPatch.name() half1 faces to " << str.name()
<< endl;
meshTools::writeOBJ
(
str,
......@@ -262,6 +266,9 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
OFstream str(prefix+cycPatch.name()+"_match.obj");
label vertI = 0;
Pout<< "Dumping cyclic match as lines between face centres to "
<< str.name() << endl;
for (label faceI = 0; faceI < halfSize; faceI++)
{
const point& fc0 = mesh.faceCentres()[cycPatch.start()+faceI];
......@@ -773,6 +780,8 @@ int main(int argc, char *argv[])
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, true);
mesh.movePoints(map().preMotionPoints());
dumpCyclicMatch("coupled_", mesh);
// Synchronise points.
if (!pointSync)
{
......@@ -890,6 +899,8 @@ int main(int argc, char *argv[])
filterPatches(mesh);
dumpCyclicMatch("final_", mesh);
// Set the precision of the points data to 10
IOstream::defaultPrecision(10);
......
/*---------------------------------------------------------------------------*\
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\ / O peration | Version: 1.5 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "";
case "";
instance "system";
local "";
class dictionary;
object createPatcheDict;
version 2.0;
format ascii;
class dictionary;
object createPatchDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Tolerance used in matching faces. Absolute tolerance is span of
// face times this factor.
matchTolerance 1E-6;
// face times this factor. To load incorrectly matches meshes set this
// to a higher value.
matchTolerance 1E-3;
// Do a synchronisation of coupled points.
// Do a synchronisation of coupled points after creation of any patches.
pointSync true;
// Patches to create.
// If no patches does a coupled point and face synchronisation anyway.
patches
(
{
// Name of new patch
name sidePatches;
// Dictionary for new patch
dictionary
{
// Type of new patch
dictionary
{
type cyclic;
// Optional: used when matching and synchronising points.
// Optional: explicitly set transformation tensor.
// Used when matching and synchronising points.
//transform translational;
//separationVector (-2289 0 0);
}
transform rotational;
rotationAxis (1 0 0);
rotationCentre (0 0 0);
}
// How to construct: either 'patches' or 'set'
// How to construct: either from 'patches' or 'set'
constructFrom patches;
// If constructFrom = patches : names of patches
//patches (periodic-1 periodic-2);
patches (outlet-side1 outlet-side2);
patches (periodic-1 periodic-2);
// If constructFrom = set : name of faceSet
set f0;
}
//{
// name bottom;
// // Dictionary for new patch
// dictionary
// {
// type patch;
// }
//
// constructFrom set;
//
// patches (half0 half1);
//
// set bottomFaces;
//}
{
name bottom;
// Type of new patch
dictionary
{
type wall;
}
constructFrom set;
patches ();
set bottomFaces;
}
);
......
......@@ -320,9 +320,9 @@ void Foam::coupledPolyPatch::calcTransformTensors
if (debug)
{
Pout<< " rotation " << sum(mag(forwardT_ - forwardT_[0]))
<< " more than local tolerance " << error
<< ". Assuming uniform rotation." << endl;
Pout<< " difference in rotation less than"
<< " local tolerance "
<< error << ". Assuming uniform rotation." << endl;
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment