Loading...
Searching...
No Matches
IntegralFilter.C
Go to the documentation of this file.
1#include "IntegralFilter.H"
2#include "addToRunTimeSelectionTable.H"
3
4namespace Foam
5{
8}
9
10Foam::IntegralFilter::IntegralFilter(const dictionary& dict)
11 :
12 Filter(),
13 dict_(dict)
14{
15 Info << "Is IntegralFilter" << endl;
16}
17
18List<scalarList> Foam::IntegralFilter::apply(const List<labelList>& cells,
19 const List<point>& convPoints, const fvMesh& mesh) const
20{
21 List<scalarList> weights(cells.size());
22
23 for (label i = 0; i < cells.size(); i++)
24 {
25 scalarList weightsi(cells[i].size());
26 scalar factor = 0;
27
28 for (label j = 0; j < cells[i].size(); j++)
29 {
30 scalar factori = mesh.V()[cells[i][j]] * mag(convPoints[i] -
31 mesh.C()[cells[i][j]]);
32 weightsi[j] = factori;
33 factor += factori;
34 }
35
36 if (factor > VSMALL)
37 {
38 weights[i] = weightsi / factor;
39 }
40 }
41
42 return weights;
43}
Foam::fvMesh & mesh
Definition createMesh.H:47
virtual List< scalarList > apply(const List< labelList > &cells, const List< point > &convPoints, const fvMesh &mesh) const
addToRunTimeSelectionTable(Filter, IntegralFilter, dictionary)
defineTypeNameAndDebug(Filter, 0)
label i
Definition pEqn.H:46