Exemplo n.º 1
0
 virtual scalar value(int n, double *wt, Func<scalar> *u_ext[], Func<double> *u, 
              Func<double> *v, Geom<double> *e, ExtData<scalar> *ext) const {
   scalar result = 0;
   for (int i=0; i < n; i++) {
     double x = e->x[i];
     double y = e->y[i];
     result += (a_11(x, y)*u->dx[i]*v->dx[i] +
                a_12(x, y)*u->dy[i]*v->dx[i] +
                a_21(x, y)*u->dx[i]*v->dy[i] +
                a_22(x, y)*u->dy[i]*v->dy[i] +
                a_1(x, y)*u->dx[i]*v->val[i] +
                a_2(x, y)*u->dy[i]*v->val[i] +
                a_0(x, y)*u->val[i]*v->val[i]) * wt[i];
   }
   return result;
 }
Exemplo n.º 2
0
Scalar bilinear_form(int n, double *wt, Func<Real> *u, Func<Real> *v, Geom<Real> *e, ExtData<Scalar> *ext)
{
  Scalar result = 0;
  for (int i=0; i < n; i++) {
    double x = e->x[i];
    double y = e->y[i];
    result += (a_11(x, y)*u->dx[i]*v->dx[i] +
               a_12(x, y)*u->dy[i]*v->dx[i] +
               a_21(x, y)*u->dx[i]*v->dy[i] +
               a_22(x, y)*u->dy[i]*v->dy[i] +
               a_1(x, y)*u->dx[i]*v->val[i] +
               a_2(x, y)*u->dy[i]*v->val[i] +
               a_0(x, y)*u->val[i]*v->val[i]) * wt[i];
  }
  return result;
}
Exemplo n.º 3
0
double CustomWeakFormGeneral::MatrixFormVolGeneral::value(int n, double *wt, Func<double> *u_ext[], Func<double> *u, 
                                                          Func<double> *v, Geom<double> *e, Func<double> **ext) const 
{
  double result = 0;
  for (int i=0; i < n; i++) {
    double x = e->x[i];
    double y = e->y[i];
    result += (a_11(x, y) * u->dx[i] * v->dx[i] +
               a_12(x, y) * u->dy[i] * v->dx[i] +
               a_21(x, y) * u->dx[i] * v->dy[i] +
               a_22(x, y) * u->dy[i] * v->dy[i] +
               a_1(x, y) * u->dx[i] * v->val[i] +
               a_2(x, y) * u->dy[i] * v->val[i] +
               a_0(x, y) * u->val[i] * v->val[i]) * wt[i];
  }
  return result;
}