36namespace ITHACAsurfacetools
42 List<label>* result =
new List<label>;
44 for (
size_t i = 0;
i < field.mesh().boundaryMesh()[patchInt].size();
i++) {
45 result->append(field.mesh().boundaryMesh()[patchInt].faceCells()[
i]);
51 template List<label>
surfaceIndexInt(volScalarField& field,
const label patchInt,
const label patchExt);
52 template List<label>
surfaceIndexInt(volVectorField& field,
const label patchInt,
const label patchExt);
53 template List<label>
surfaceIndexInt(volTensorField& field,
const label patchInt,
const label patchExt);
61 template List<label>
surfaceIndexExt(volScalarField& field,
const label patchInt,
const label patchExt);
62 template List<label>
surfaceIndexExt(volVectorField& field,
const label patchInt,
const label patchExt);
63 template List<label>
surfaceIndexExt(volTensorField& field,
const label patchInt,
const label patchExt);
65 template<
typename T,
typename V>
66 void surfaceValuesInt(
T& field,
const label patchInt,
const label patchExt, List<V>& result)
70 for (
size_t i = 0;
i < indexes.size();
i++) {
71 result.append(field[indexes[
i]]);
75 template void surfaceValuesInt(volScalarField& field,
const label patchInt,
const label patchExt, List<scalar>& result);
76 template void surfaceValuesInt(volVectorField& field,
const label patchInt,
const label patchExt, List<Foam::Vector<scalar>>& result);
77 template void surfaceValuesInt(volTensorField& field,
const label patchInt,
const label patchExt, List<Foam::Tensor<scalar>>& result);
79 template<
typename T,
typename V>
80 void surfaceValuesExt(
T& field,
const label patchInt,
const label patchExt, List<V>& result)
85 template void surfaceValuesExt(volScalarField& field,
const label patchInt,
const label patchExt, List<scalar>& result);
86 template void surfaceValuesExt(volVectorField& field,
const label patchInt,
const label patchExt, List<Foam::Vector<scalar>>& result);
87 template void surfaceValuesExt(volTensorField& field,
const label patchInt,
const label patchExt, List<Foam::Tensor<scalar>>& result);
92 Foam::Vector<scalar> result = *(
new Foam::Vector<scalar>);
95 result = 2.0 * field.mesh().boundaryMesh()[patchInt].faceCentres()[cellID] - field.mesh().C()[indexesInt[cellID]];
100 template Foam::Vector<scalar>
surfaceFindMirrorPoint(volScalarField& field,
const label patchInt,
const label patchExt,
const label cellID);
101 template Foam::Vector<scalar>
surfaceFindMirrorPoint(volVectorField& field,
const label patchInt,
const label patchExt,
const label cellID);
102 template Foam::Vector<scalar>
surfaceFindMirrorPoint(volTensorField& field,
const label patchInt,
const label patchExt,
const label cellID);
105 label
surfaceFindClosest(
T& field,
const label patchInt,
const label patchExt, Foam::Vector<scalar> point)
111 dist = mag(point - field.mesh().C()[indexesExt[0]]);
113 for(
int i = 1;
i < indexesExt.size();
i++)
115 scalar temp = mag(point - field.mesh().C()[indexesExt[
i]]);
122 result = indexesExt[result];
126 template label
surfaceFindClosest(volScalarField& field,
const label patchInt,
const label patchExt, Foam::Vector<scalar> point);
127 template label
surfaceFindClosest(volVectorField& field,
const label patchInt,
const label patchExt, Foam::Vector<scalar> point);
128 template label
surfaceFindClosest(volTensorField& field,
const label patchInt,
const label patchExt, Foam::Vector<scalar> point);
130 template<
typename T,
typename V>
131 void surfaceAverage(
T& field,
const label patchInt,
const label patchExt, List<V>& result)
136 for(
int i = 0;
i < indexesInt.size();
i++)
140 result.append(0.5 * field[closest] + 0.5 * field[indexesInt[
i]]);
144 template void surfaceAverage(volScalarField& field,
const label patchInt,
const label patchExt, List<scalar>& result);
145 template void surfaceAverage(volVectorField& field,
const label patchInt,
const label patchExt, List<Foam::Vector<scalar>>& result);
146 template void surfaceAverage(volTensorField& field,
const label patchInt,
const label patchExt, List<Foam::Tensor<scalar>>& result);
148 template<
typename T,
typename V>
149 void surfaceJump(
T& field,
const label patchInt,
const label patchExt, List<V>& result)
154 for(
int i = 0;
i < indexesInt.size();
i++)
158 result.append(field[closest] - field[indexesInt[
i]]);
162 template void surfaceJump(volScalarField& field,
const label patchInt,
const label patchExt, List<scalar>& result);
163 template void surfaceJump(volVectorField& field,
const label patchInt,
const label patchExt, List<Foam::Vector<scalar>>& result);
164 template void surfaceJump(volTensorField& field,
const label patchInt,
const label patchExt, List<Foam::Tensor<scalar>>& result);