MCPcopy Create free account
hub / github.com/FreeFem/FreeFem-sources / findFillValue

Function findFillValue

plugin/seq/plotPDF.cpp:2912–2939  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2910
2911 break;
2912 }
2913 }
2914
2915 return;
2916}
2917
2918double findFillValue( const std::vector<double> &cx, const std::vector<double> &cy, const double *const phi )
2919{
2920 const double &a = phi[0]; const double &b = phi[1]; const double &c = phi[2];
2921 const double &d = phi[3]; const double &e = phi[4]; const double &f = phi[5];
2922
2923 int npoints = 0;
2924
2925 // find average of phi at nodal points
2926 double sum = 0;
2927 for(size_t i = 0; i < cx.size(); i += 3){
2928
2929 const double &x = cx[i];
2930 const double &y = cy[i];
2931
2932 sum += (a*x*x + b*x*y + c*y*y + d*x + e*y + f);
2933 npoints++;
2934
2935 if( (i+3 < cx.size()) && isSegment(cx,cy,i) ){
2936
2937 const double mx = ( cx[i]+cx[i+3] ) / 2;
2938 const double my = ( cy[i]+cy[i+3] ) / 2;
2939 sum += (a*mx*mx + b*mx*my + c*my*my + d*mx + e*my + f);
2940 npoints++;
2941 }
2942 }

Callers 1

plot_P2_fillFunction · 0.85

Calls 2

isSegmentFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected