Commit 09143ab9 authored by mattijs's avatar mattijs
Browse files

ENH: new cyclicSlip variant of cyclic with assorted fields

parent febecdcc
......@@ -341,6 +341,7 @@ $(constraintPolyPatches)/empty/emptyPolyPatch.C
$(constraintPolyPatches)/symmetry/symmetryPolyPatch.C
$(constraintPolyPatches)/wedge/wedgePolyPatch.C
$(constraintPolyPatches)/cyclic/cyclicPolyPatch.C
$(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
$(constraintPolyPatches)/processor/processorPolyPatch.C
......@@ -452,6 +453,7 @@ $(constraintPointPatches)/empty/emptyPointPatch.C
$(constraintPointPatches)/symmetry/symmetryPointPatch.C
$(constraintPointPatches)/wedge/wedgePointPatch.C
$(constraintPointPatches)/cyclic/cyclicPointPatch.C
$(constraintPointPatches)/cyclicSlip/cyclicSlipPointPatch.C
$(constraintPointPatches)/processor/processorPointPatch.C
$(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C
......
......@@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
......@@ -19,12 +19,12 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "cyclicSlipPointPatchField.H"
#include "pointConstraint.H"
#include "transformField.H"
#include "symmTransformField.H"
......@@ -104,17 +104,6 @@ void cyclicSlipPointPatchField<Type>::evaluate(const Pstream::commsTypes)
}
template<class Type>
void cyclicSlipPointPatchField<Type>::applyConstraint
(
const label pointi,
pointConstraint& pc
) const
{
pc.applyConstraint(this->patch().pointNormals()[pointi]);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
......
......@@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
......@@ -19,13 +19,14 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::cyclicSlipPointPatchField
Description
Specialisation of cyclic that constrains to the patch
Cyclic + slip constraints
SourceFiles
cyclicSlipPointPatchField.C
......@@ -36,6 +37,7 @@ SourceFiles
#define cyclicSlipPointPatchField_H
#include "cyclicPointPatchField.H"
#include "cyclicSlipPointPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -55,7 +57,7 @@ class cyclicSlipPointPatchField
public:
//- Runtime type information
TypeName("cyclicSlip");
TypeName(cyclicSlipPointPatch::typeName_());
// Constructors
......@@ -121,18 +123,13 @@ public:
// Member functions
//- Update the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
// Evaluation functions
//- Accumulate the effect of constraint direction of this patch
virtual void applyConstraint
(
const label pointi,
pointConstraint&
) const;
//- Evaluate the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
};
......
......@@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
......@@ -19,7 +19,8 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
......
......@@ -8,10 +8,10 @@
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
......@@ -19,7 +19,8 @@ License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
......
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "cyclicSlipPointPatch.H"
#include "pointConstraint.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(cyclicSlipPointPatch, 0);
// Add the patch constructor functions to the hash tables
addToRunTimeSelectionTable
(
facePointPatch,
cyclicSlipPointPatch,
polyPatch
);
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const vectorField& cyclicSlipPointPatch::pointNormals() const
{
// Use underlying patch normals
return refCast<const facePointPatch>
(
*this
).facePointPatch::pointNormals();
}
void cyclicSlipPointPatch::applyConstraint
(
const label pointi,
pointConstraint& pc
) const
{
pc.applyConstraint(pointNormals()[pointi]);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::cyclicSlipPointPatch
Description
Cyclic patch with slip constraint
SourceFiles
cyclicSlipPointPatch.C
\*---------------------------------------------------------------------------*/
#ifndef cyclicSlipPointPatch_H
#define cyclicSlipPointPatch_H
#include "cyclicPointPatch.H"
#include "cyclicSlipPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cyclicSlipPointPatch Declaration
\*---------------------------------------------------------------------------*/
class cyclicSlipPointPatch
:
public cyclicPointPatch
{
public:
//- Runtime type information
TypeName(cyclicSlipPolyPatch::typeName_());
// Constructors
//- Construct from components
cyclicSlipPointPatch
(
const polyPatch& patch,
const pointBoundaryMesh& bm
)
:
cyclicPointPatch(patch, bm)
{}
// Destructor
virtual ~cyclicSlipPointPatch()
{}
// Member Functions
//- Return point unit normals.
virtual const vectorField& pointNormals() const;
//- Accumulate the effect of constraint direction of this patch
virtual void applyConstraint
(
const label pointi,
pointConstraint&
) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "cyclicSlipPolyPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(cyclicSlipPolyPatch, 0);
addToRunTimeSelectionTable(polyPatch, cyclicSlipPolyPatch, word);
addToRunTimeSelectionTable(polyPatch, cyclicSlipPolyPatch, dictionary);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::cyclicSlipPolyPatch
Description
Copy of cyclicSlip - used to be able to instantiate cyclicSlip pointPatch
which is cyclicSlip with slip constraints
SourceFiles
cyclicSlipPolyPatch.C
\*---------------------------------------------------------------------------*/
#ifndef cyclicSlipPolyPatch_H
#define cyclicSlipPolyPatch_H
#include "cyclicPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class cyclicSlipPolyPatch Declaration
\*---------------------------------------------------------------------------*/
class cyclicSlipPolyPatch
:
public cyclicPolyPatch
{
public:
//- Runtime type information
TypeName("cyclicSlip");
// Constructors
//- Construct from components
cyclicSlipPolyPatch
(
const word& name,
const label size,
const label start,
const label index,
const polyBoundaryMesh& bm
)
:
cyclicPolyPatch(name, size, start, index, bm)
{}
//- Construct from dictionary
cyclicSlipPolyPatch
(
const word& name,
const dictionary& dict,
const label index,
const polyBoundaryMesh& bm
)
:
cyclicPolyPatch(name, dict, index, bm)
{}
//- Construct as copy, resetting the boundary mesh
cyclicSlipPolyPatch
(
const cyclicSlipPolyPatch& pp,
const polyBoundaryMesh& bm
)
:
cyclicPolyPatch(pp, bm)
{}
//- Construct given the original patch and resetting the
// face list and boundary mesh information
cyclicSlipPolyPatch
(
const cyclicSlipPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart,
const word& neighbPatchName
)
:
cyclicPolyPatch(pp, bm, index, newSize, newStart, neighbPatchName)
{}
//- Construct given the original patch and a map
cyclicSlipPolyPatch
(
const cyclicPolyPatch& pp,
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
)
:
cyclicPolyPatch(pp, bm, index, mapAddressing, newStart)
{}
//- Construct and return a clone, resetting the boundary mesh
virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
{
return autoPtr<polyPatch>(new cyclicSlipPolyPatch(*this, bm));
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new cyclicSlipPolyPatch
(
*this,
bm,
index,
newSize,
newStart,
neighbPatchName()
)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const unallocLabelList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new cyclicSlipPolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
// Destructor
virtual ~cyclicSlipPolyPatch()