cyclicGAMGInterfaceField.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "cyclicGAMGInterfaceField.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "lduMatrix.H"
00030
00031
00032
00033 namespace Foam
00034 {
00035 defineTypeNameAndDebug(cyclicGAMGInterfaceField, 0);
00036 addToRunTimeSelectionTable
00037 (
00038 GAMGInterfaceField,
00039 cyclicGAMGInterfaceField,
00040 lduInterface
00041 );
00042 }
00043
00044
00045
00046
00047 Foam::cyclicGAMGInterfaceField::cyclicGAMGInterfaceField
00048 (
00049 const GAMGInterface& GAMGCp,
00050 const lduInterfaceField& fineInterface
00051 )
00052 :
00053 GAMGInterfaceField(GAMGCp, fineInterface),
00054 cyclicInterface_(refCast<const cyclicGAMGInterface>(GAMGCp)),
00055 doTransform_(false),
00056 rank_(0)
00057 {
00058 const cyclicLduInterfaceField& p =
00059 refCast<const cyclicLduInterfaceField>(fineInterface);
00060
00061 doTransform_ = p.doTransform();
00062 rank_ = p.rank();
00063 }
00064
00065
00066
00067
00068 Foam::cyclicGAMGInterfaceField::~cyclicGAMGInterfaceField()
00069 {}
00070
00071
00072
00073
00074 void Foam::cyclicGAMGInterfaceField::updateInterfaceMatrix
00075 (
00076 const scalarField& psiInternal,
00077 scalarField& result,
00078 const lduMatrix&,
00079 const scalarField& coeffs,
00080 const direction cmpt,
00081 const Pstream::commsTypes
00082 ) const
00083 {
00084 scalarField pnf(size());
00085
00086 label sizeby2 = size()/2;
00087
00088 const unallocLabelList& faceCells = cyclicInterface_.faceCells();
00089
00090 for (label facei=0; facei<sizeby2; facei++)
00091 {
00092 pnf[facei] = psiInternal[faceCells[facei + sizeby2]];
00093 pnf[facei + sizeby2] = psiInternal[faceCells[facei]];
00094 }
00095
00096 transformCoupleField(pnf, cmpt);
00097
00098 forAll(faceCells, elemI)
00099 {
00100 result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
00101 }
00102 }
00103
00104
00105
Copyright © 2000-2009 OpenCFD Ltd