This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/applications/solvers/stressAnalysis/contactStressFoam/tractionBoundaries.H

46 lines
1.2 KiB
C

{
volVectorField::GeometricBoundaryField& Upatches = U.boundaryField();
const volTensorField::GeometricBoundaryField& gradUpatches =
gradU.boundaryField();
const surfaceVectorField::GeometricBoundaryField& Apatches =
mesh.Sf().boundaryField();
const surfaceScalarField::GeometricBoundaryField& magApatches =
mesh.magSf().boundaryField();
forAll(Upatches, patchI)
{
if
(
Upatches[patchI].type()
== fixedGradientFvPatchVectorField::typeName
)
{
fixedGradientFvPatchVectorField& Upatch =
refCast<fixedGradientFvPatchVectorField>(Upatches[patchI]);
vectorField n = Apatches[patchI]/magApatches[patchI];
Upatch.gradient() =
# include "traction.H"
}
if
(
Upatches[patchI].type()
== directionMixedFvPatchVectorField::typeName
)
{
directionMixedFvPatchVectorField& Upatch =
refCast<directionMixedFvPatchVectorField>(Upatches[patchI]);
vectorField n = Apatches[patchI]/magApatches[patchI];
Upatch.refGrad() =
# include "traction.H"
}
}
}