Operator.h 97.2 KB
Newer Older
2001
    std::vector<DOFVectorBase<double>*> grads_;
2002
2003
2004
2005

    QuartAbstractFunction<WorldVector<double>, 
			  WorldVector<double>,
			  WorldVector<double>,
2006
2007
			  std::vector<double>, 
			  std::vector<WorldVector<double> > > *f_;
2008
2009
2010
2011

    WorldVector<double> *coordsAtQPs_;
    WorldVector<double> elementNormal_;

2012
    std::vector<double*> vecsAtQPs_;
2013

2014
    std::vector<WorldVector<double>*> gradsAtQPs_;
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
  };


  // ============================================================================
  // ===== class ZeroOrderTerm ==================================================
  // ============================================================================

  /**
   * \ingroup Assembler
   *
   * \brief
   * Describes zero order terms: \f$ cu(\vec{x}) \f$.
   */
  class ZeroOrderTerm : public OperatorTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2031
    /// Constructor.
Thomas Witkowski's avatar
Thomas Witkowski committed
2032
    ZeroOrderTerm(int deg) : OperatorTerm(deg) {}
2033
2034
2035
2036

    /** \brief
     * Destructor.
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2037
    virtual ~ZeroOrderTerm() {}
2038
2039
2040
2041
2042

    /** \brief
     * Evaluates \f$ c \f$
     */
    virtual void getC(const ElInfo *elInfo,
Thomas Witkowski's avatar
Thomas Witkowski committed
2043
		      int nPoints,
2044
		      std::vector<double> &C) const = 0;
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056

  };

  /**
   * \ingroup Assembler
   *
   * \brief
   * Simple zero order term
   */
  class Simple_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2057
    /// Constructor.
Thomas Witkowski's avatar
Thomas Witkowski committed
2058
    Simple_ZOT(double f = 1.0) : ZeroOrderTerm(0), factor(f) {}
2059

2060
2061
    /// Implements ZeroOrderTerm::getC().
    inline void getC(const ElInfo *, int nPoints, std::vector<double> &C) const 
2062
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
2063
      for (int iq = 0; iq < nPoints; iq++) {
2064
2065
	C[iq] += factor; 
      }
Thomas Witkowski's avatar
Thomas Witkowski committed
2066
    }
2067
2068
2069
2070

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2071
2072
    inline void eval(int nPoints,
		     const double *uhAtQP,
2073
2074
2075
2076
2077
		     const WorldVector<double> *,
		     const WorldMatrix<double> *,
		     double *result,
		     double fac) const 
    {
Thomas Witkowski's avatar
Thomas Witkowski committed
2078
      for (int iq = 0; iq < nPoints; iq++) {
2079
2080
	result[iq] += fac * factor * uhAtQP[iq];
      }
Thomas Witkowski's avatar
Thomas Witkowski committed
2081
    }
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
 
  protected:
    /** \brief
     * Constant factor of zero order term.
     */
    double factor;
  };

  /**
   * \ingroup Assembler
   *
   * \brief
   * Zero order term: \f$ f(v(\vec{x})) u(\vec{x})\f$
   */
  class VecAtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2099
    /// Constructor.
2100
    VecAtQP_ZOT(DOFVectorBase<double> *dv,
Thomas Witkowski's avatar
Thomas Witkowski committed
2101
		AbstractFunction<double, double> *ab);
2102

Thomas Witkowski's avatar
Thomas Witkowski committed
2103
2104
2105
2106
2107
2108
2109
2110
2111
    /// Implementation of \ref OperatorTerm::initElement().
    void initElement(const ElInfo* elInfo, 
		     SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /// Implementation of \ref OperatorTerm::initElement() for multilpe meshes.
    void initElement(const ElInfo* smallElInfo,
		     const ElInfo* largeElInfo,
		     SubAssembler* subAssembler,
2112
2113
		     Quadrature *quad = NULL);

2114
2115
    /// Implements ZeroOrderTerm::getC().
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2116
2117
2118
2119

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2120
2121
    void eval(int nPoints,
	      const double *uhAtQP,
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    /** \brief
     * DOFVector to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec;

    /** \brief
     * Vector v at quadrature points.
     */
    double *vecAtQPs;

    /** \brief
     * Function for c.
     */
    AbstractFunction<double, double> *f;
  };

  /**
   * \ingroup Assembler
   *
   * \brief
   * Zero order term: \f$ f(v(\vec{x})) g(w(\vec{x})) u(\vec{x})\f$
   */
  class MultVecAtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2153
    /// Constructor.
2154
2155
    MultVecAtQP_ZOT(DOFVectorBase<double> *dv1,
		    DOFVectorBase<double> *dv2,
Thomas Witkowski's avatar
Thomas Witkowski committed
2156
2157
		    AbstractFunction<double, double> *f1,
		    AbstractFunction<double, double> *f2);
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2168
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2169
2170
2171
2172

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2173
2174
    void eval(int nPoints,
	      const double *uhAtQP,
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    /** \brief
     * DOFVectorBase to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec1;
    DOFVectorBase<double>* vec2;

    /** \brief
     * Vector v at quadrature points.
     */
    double *vecAtQPs1;
    double *vecAtQPs2;

    /** \brief
     * Function for c.
     */
    AbstractFunction<double, double> *f1;
    AbstractFunction<double, double> *f2;
  };

  /**
   * \ingroup Assembler
   *
   * \brief
   * Zero order term: \f$ f(v(\vec{x}), w(\vec{x})) u(\vec{x})\f$
   */
  class Vec2AtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2209
    /// Constructor.
2210
2211
    Vec2AtQP_ZOT(DOFVectorBase<double> *dv1,
		 DOFVectorBase<double> *dv2,
Thomas Witkowski's avatar
Thomas Witkowski committed
2212
		 BinaryAbstractFunction<double, double, double> *f);
2213

Thomas Witkowski's avatar
Thomas Witkowski committed
2214
    /// Implementation of \ref OperatorTerm::initElement().
2215
2216
2217
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

Thomas Witkowski's avatar
Thomas Witkowski committed
2218
2219
2220
2221
2222
    /// Implementation of \ref OperatorTerm::initElement() for multilpe meshes.
    void initElement(const ElInfo* smallElInfo,
		     const ElInfo* largeElInfo,
		     SubAssembler* subAssembler,
		     Quadrature *quad = NULL);
2223

Thomas Witkowski's avatar
Thomas Witkowski committed
2224
    /// Implements ZeroOrderTerm::getC().
2225
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
Thomas Witkowski's avatar
Thomas Witkowski committed
2226
2227
2228
2229

    /// Implements ZeroOrderTerm::eval().
    void eval(int nPoints,
	      const double *uhAtQP,
2230
2231
2232
2233
2234
2235
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
Thomas Witkowski's avatar
Thomas Witkowski committed
2236
    /// First DOFVector to be evaluated at quadrature points.
2237
    DOFVectorBase<double>* vec1;
Thomas Witkowski's avatar
Thomas Witkowski committed
2238
    /// Second DOFVector to be evaluated at quadrature points.
2239
2240
    DOFVectorBase<double>* vec2;

Thomas Witkowski's avatar
Thomas Witkowski committed
2241
    /// Values of the first DOFVector at the quadrature points.
2242
    double *vecAtQPs1;
Thomas Witkowski's avatar
Thomas Witkowski committed
2243
    /// Values of the second DOFVector at the quadrature points.
2244
2245
    double *vecAtQPs2;

Thomas Witkowski's avatar
Thomas Witkowski committed
2246
    /// Function for c.
2247
2248
2249
    BinaryAbstractFunction<double, double, double> *f;
  };

2250
2251
2252
2253
2254
2255
2256
2257
2258
2259

  /**
   * \ingroup Assembler
   *
   * \brief
   * Zero order term: \f$ f(v(\vec{x}), w(\vec{x})) u(\vec{x})\f$
   */
  class Vec3AtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2260
    /// Constructor.
2261
2262
2263
    Vec3AtQP_ZOT(DOFVectorBase<double> *dv1,
		 DOFVectorBase<double> *dv2,
		 DOFVectorBase<double> *dv3,
Thomas Witkowski's avatar
Thomas Witkowski committed
2264
		 TertiaryAbstractFunction<double, double, double, double> *f);
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2275
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2276
2277
2278
2279

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2280
    void eval(int nPoints,
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
	      const double *uhAtQP,
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    /** \brief
     * DOFVector to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec1;
    DOFVectorBase<double>* vec2;
    DOFVectorBase<double>* vec3;

    /** \brief
     * Vector v at quadrature points.
     */
    double *vecAtQPs1;
    double *vecAtQPs2;
    double *vecAtQPs3;

    /** \brief
     * Function for c.
     */
    TertiaryAbstractFunction<double, double, double, double> *f;
  };

2308
2309
2310
2311
2312
2313
2314
2315
2316
2317

  /**
   * \ingroup Assembler
   *
   * \brief
   * 
   */
  class FctGradientCoords_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2318
    /// Constructor.
2319
    FctGradientCoords_ZOT(DOFVectorBase<double> *dv,
Thomas Witkowski's avatar
Thomas Witkowski committed
2320
			  BinaryAbstractFunction<double, WorldVector<double>, WorldVector<double> > *f);
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements SecondOrderTerm::getC().
     */
2331
    void getC(const ElInfo *elInfo, int nPoints, std::vector<double> &C) const;
2332
2333
2334
2335

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2336
2337
    void eval(int nPoints,
	      const double *uhAtQP,
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    DOFVectorBase<double>* vec;

    /** \brief
     * Function wich maps \ref gradAtQPs to a double.
     */
    BinaryAbstractFunction<double, WorldVector<double>, WorldVector<double> > *f;

    /** \brief
     * Pointer to a WorldVector<double> array containing the gradients of the DOFVector
     * at each quadrature point.
     */
    WorldVector<double>* gradAtQPs;

    WorldVector<double>* coordsAtQPs;

  };

  /**
   * \ingroup Assembler
   *
   * \brief
   */
  class VecGradCoordsAtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2369
    /// Constructor.
2370
    VecGradCoordsAtQP_ZOT(DOFVectorBase<double> *dv,
Thomas Witkowski's avatar
Thomas Witkowski committed
2371
			  TertiaryAbstractFunction<double, double, WorldVector<double>, WorldVector<double> > *f);
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2382
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2383
2384
2385
2386

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2387
2388
    void eval(int nPoints,
	      const double *uhAtQP,
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    /** \brief
     * DOFVector to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec;

    /** \brief
     * Vector v at quadrature points.
     */
    double *vecAtQPs;

    /** \brief
     * Gradient at quadrature points.
     */
    WorldVector<double>* gradAtQPs;

    WorldVector<double>* coordsAtQPs;

    /** \brief
     * Function for c.
     */
    TertiaryAbstractFunction<double, double, WorldVector<double>, WorldVector<double> > *f;
  };

  /**
   * \ingroup Assembler
   *
   * \brief
   */
  class VecAndCoordsAtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2426
    /// Constructor.
2427
    VecAndCoordsAtQP_ZOT(DOFVectorBase<double> *dv,
Thomas Witkowski's avatar
Thomas Witkowski committed
2428
			 BinaryAbstractFunction<double, double, WorldVector<double> > *f);
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2439
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2440
2441
2442
2443

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2444
2445
    void eval(int nPoints,
	      const double *uhAtQP,
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    /** \brief
     * DOFVector to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec;

    /** \brief
     * Vector v at quadrature points.
     */
    double *vecAtQPs;

    /** \brief
     * Gradient at quadrature points.
     */
    WorldVector<double>* coordsAtQPs;

    /** \brief
     * Function for c.
     */
    BinaryAbstractFunction<double, double, WorldVector<double> > *f;
  };


2474
2475
2476
2477
2478
2479
2480
2481
  /**
   * \ingroup Assembler
   *
   * \brief
   */
  class Vec2AndGradAtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2482
    /// Constructor.
2483
    Vec2AndGradAtQP_ZOT(DOFVectorBase<double> *dv1, DOFVectorBase<double> *dv2,
Thomas Witkowski's avatar
Thomas Witkowski committed
2484
			TertiaryAbstractFunction<double, double, WorldVector<double>, double > *af);
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2495
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2496
2497
2498
2499

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2500
2501
    void eval(int nPoints,
	      const double *uhAtQP,
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    /** \brief
     * DOFVector to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec1;
    DOFVectorBase<double>* vec2;

    /** \brief
     * Vector v at quadrature points.
     */
    double *vecAtQPs1;
    double *vecAtQPs2;

    /** \brief
     * Gradient at quadrature points.
     */
    WorldVector<double> *gradAtQPs;

    /** \brief
     * Function for c.
     */
    TertiaryAbstractFunction<double, double, WorldVector<double>, double > *f;
  };
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540


  /**
   * \ingroup Assembler
   *
   * \brief
   * 
   */
  class FctGradient_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2541
    /// Constructor.
2542
    FctGradient_ZOT(DOFVectorBase<double> *dv,
Thomas Witkowski's avatar
Thomas Witkowski committed
2543
		    AbstractFunction<double, WorldVector<double> > *f);
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements SecondOrderTerm::getC().
     */
2554
    void getC(const ElInfo *elInfo, int nPoints, std::vector<double> &C) const;
2555
2556
2557
2558

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2559
2560
    void eval(int nPoints,
	      const double *uhAtQP,
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    DOFVectorBase<double>* vec;

    /** \brief
     * Function wich maps \ref gradAtQPs to a double.
     */
    AbstractFunction<double, WorldVector<double> > *f;

    /** \brief
     * Pointer to a WorldVector<double> array containing the gradients of the DOFVector
     * at each quadrature point.
     */
    WorldVector<double>* gradAtQPs;

  };

  /**
   * \ingroup Assembler
   *
   * \brief
   */
  class VecAndGradAtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2590
    /// Constructor.
2591
    VecAndGradAtQP_ZOT(DOFVectorBase<double> *dv,
Thomas Witkowski's avatar
Thomas Witkowski committed
2592
		       BinaryAbstractFunction<double, double, WorldVector<double> > *f);
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2603
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2604
2605
2606
2607

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2608
2609
    void eval(int nPoints,
	      const double *uhAtQP,
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    /** \brief
     * DOFVector to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec;

    /** \brief
     * Vector v at quadrature points.
     */
    double *vecAtQPs;

    /** \brief
     * Gradient at quadrature points.
     */
    WorldVector<double> *gradAtQPs;

    /** \brief
     * Function for c.
     */
    BinaryAbstractFunction<double, double, WorldVector<double> > *f;
  };

  /**
   * \ingroup Assembler
   *
   * \brief
   */
  class VecAndGradAtQP_SOT : public SecondOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2645
    /// Constructor.
2646
    VecAndGradAtQP_SOT(DOFVectorBase<double> *dv,
Thomas Witkowski's avatar
Thomas Witkowski committed
2647
		       BinaryAbstractFunction<double, double, WorldVector<double> > *af);
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);


    /** \brief
     * Implements SecondOrderTerm::getLALt().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2659
    inline void getLALt(const ElInfo *elInfo, int nPoints, DimMat<double> **LALt) const;
2660
2661
2662
2663

    /** \brief
     * Implements SecondOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2664
2665
    void eval(int nPoints,
	      const double *uhAtQP,
2666
2667
2668
2669
2670
2671
2672
2673
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double factor) const;

    /** \brief
     * Implements SecondOrderTerm::weakEval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2674
    void weakEval(int nPoints,
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
		  const WorldVector<double> *grdUhAtQP,
		  WorldVector<double> *result) const;
  
  protected:
    /** \brief
     * DOFVector to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec;

    /** \brief
     * Vector v at quadrature points.
     */
    double *vecAtQPs;

    /** \brief
     * Gradient at quadrature points.
     */
    WorldVector<double> *gradAtQPs;

    /** \brief
     * Function for c.
     */
    BinaryAbstractFunction<double, double, WorldVector<double> > *f;
  };

  /* 
   * \ingroup Assembler
   *
   * \brief
   * Zero order term: \f$ f(\vec{x}) u(\vec{x})\f$
   */
  class CoordsAtQP_ZOT : public ZeroOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2709
2710
2711
    /// Constructor.
    CoordsAtQP_ZOT(AbstractFunction<double, WorldVector<double> > *af)
      : ZeroOrderTerm(af->getDegree()), g(af) 
Thomas Witkowski's avatar
Thomas Witkowski committed
2712
    {}
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, 
		     SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2724
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2725
2726
2727
2728

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2729
2730
    void eval(int nPoints,
	      const double *uhAtQP,
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected:
    /** \brief
     * Stores coordinates at quadrature points. Set in \ref initElement().
     */
    WorldVector<double>* coordsAtQPs;

    /** \brief
     * Function for c.
     */
    AbstractFunction<double, WorldVector<double> > *g;
  };

  /** 
   * \ingroup Assembler
   *
   * \brief
   * SecondOrderTerm where A(x) is a WorldMatrix having a in all positions
   * except possibly the position IJ
   * \f$ \nabla \cdot A(x) \nabla u(\vec{x}) \f$
   */
  class CoordsAtQP_IJ_SOT : public SecondOrderTerm 
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2759
2760
    /// Constructor.
    CoordsAtQP_IJ_SOT(AbstractFunction<double, WorldVector<double> > *af,
2761
		      int x_i, int x_j) 
Thomas Witkowski's avatar
Thomas Witkowski committed
2762
      : SecondOrderTerm(af->getDegree()), g(af), xi(x_i), xj(x_j)
2763
2764
    {
      setSymmetric(xi == xj);
Thomas Witkowski's avatar
Thomas Witkowski committed
2765
    }
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements SecondOrderTerm::getLALt().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2776
    inline void getLALt(const ElInfo *elInfo, int nPoints, DimMat<double> **LALt) const;
2777
2778
2779
2780

    /** \brief
     * Implements SecondOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2781
2782
    void eval(int nPoints,
	      const double *uhAtQP,
2783
2784
2785
2786
2787
2788
2789
2790
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double factor) const;

    /** \brief
     * Implements SecondOrderTerm::weakEval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2791
    void weakEval(int nPoints,
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
		  const WorldVector<double> *grdUhAtQP,
		  WorldVector<double> *result) const;
  
  private:
    /** \brief
     * Stores coordinates at quadrature points. Set in \ref initElement().
     */
    WorldVector<double>* coordsAtQPs;

    /** \brief
     * Function evaluated at quadrature points.
     */
    AbstractFunction<double, WorldVector<double> > *g;

    /** \brief
     * Directions for the derivatives.
     */
    int xi, xj;
  };

  /**
   * \ingroup Assembler
   *  
   * \brief
   * SecondOrderTerm where A is a WorldMatrix having a in all positions
   * except possibly the position IJ, multiplied with a function
   * evaluated at the quadrature points of a given DOFVector:
   * \f$ \nabla \cdot f(v(\vec{x})) A \nabla u(\vec{x}) \f$
   */
  class VecAtQP_IJ_SOT : public SecondOrderTerm
  {
  public:
Thomas Witkowski's avatar
Thomas Witkowski committed
2824
2825
2826
    /// Constructor.
    VecAtQP_IJ_SOT(DOFVectorBase<double> *dv, AbstractFunction<double, double> *af,
		   int x_i, int x_j);
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements SecondOrderTerm::getLALt().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2837
    void getLALt(const ElInfo *elInfo, int nPoints, DimMat<double> **LALt) const;    
2838
2839
2840
2841

    /** \brief
     * Implements SecondOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2842
2843
    void eval(int nPoints,
	      const double *uhAtQP,
2844
2845
2846
2847
2848
2849
2850
2851
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double factor) const;

    /** \brief
     * Implements SecondOrderTerm::weakEval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2852
    void weakEval(int nPoints,
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
		  const WorldVector<double> *grdUhAtQP,
		  WorldVector<double> *result) const; 
  
  protected:
    /** \brief
     * DOFVector to be evaluated at quadrature points.
     */
    DOFVectorBase<double>* vec;

    /** \brief
     * Pointer to an array containing the DOFVector evaluated at quadrature
     * points.
     */
    double* vecAtQPs;

    /** \brief
     * Function evaluated at \ref vecAtQPs.
     */
    AbstractFunction<double, double> *f;

  private:
    /** \brief
     * Directions for the derivatives.
     */
    int xi, xj;
  };

  class VecAndGradVecAtQP_ZOT : public ZeroOrderTerm 
  { 
  public: 
Thomas Witkowski's avatar
Thomas Witkowski committed
2883
    /// Constructor. 
2884
2885
    VecAndGradVecAtQP_ZOT(DOFVectorBase<double> *dv, 
			  DOFVectorBase<double> *dGrd,
Thomas Witkowski's avatar
Thomas Witkowski committed
2886
			  BinaryAbstractFunction<double, double, WorldVector<double> > *f);
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2897
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2898
2899
2900
2901

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2902
2903
    void eval(int nPoints,
	      const double *uhAtQP,
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected: 
    /** \brief 
     * DOFVector to be evaluated at quadrature points. 
     */ 
    DOFVectorBase<double>* vec; 

    /** \brief 
     * Vector v at quadrature points. 
     */ 
    double *vecAtQPs; 

    /** \brief 
     * First DOFVector whose gradient is evaluated at quadrature points. 
     */ 
    DOFVectorBase<double>* vecGrd; 

    /** \brief 
     * Gradient of first vector at quadrature points. 
     */ 
    WorldVector<double> *gradAtQPs; 

    /** \brief 
     * Function for c. 
     */ 
    BinaryAbstractFunction<double, double, WorldVector<double> > *f; 
  }; 

  class VecAndGradVec2AtQP_ZOT : public ZeroOrderTerm 
  { 
  public: 
Thomas Witkowski's avatar
Thomas Witkowski committed
2939
    /// Constructor. 
2940
    VecAndGradVec2AtQP_ZOT(DOFVectorBase<double> *dv, 
Thomas Witkowski's avatar
Thomas Witkowski committed
2941
2942
2943
			   DOFVectorBase<double> *dGrd1, 
			   DOFVectorBase<double> *dGrd2, 
			   TertiaryAbstractFunction<double, double, WorldVector<double>, WorldVector<double> > *af);
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953

    /** \brief
     * Implementation of \ref OperatorTerm::initElement().
     */
    void initElement(const ElInfo* elInfo, SubAssembler* subAssembler,
		     Quadrature *quad = NULL);

    /** \brief
     * Implements ZeroOrderTerm::getC().
     */
2954
    void getC(const ElInfo *, int nPoints, std::vector<double> &C) const;
2955
2956
2957
2958

    /** \brief
     * Implements ZeroOrderTerm::eval().
     */
Thomas Witkowski's avatar
Thomas Witkowski committed
2959
2960
    void eval(int nPoints,
	      const double *uhAtQP,
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
	      const WorldVector<double> *grdUhAtQP,
	      const WorldMatrix<double> *D2UhAtQP,
	      double *result,
	      double fac) const;

  protected: 
    /** \brief 
     * DOFVector to be evaluated at quadrature points. 
     */ 
    DOFVectorBase<double>* vec; 

    /** \brief 
     * Vector v at quadrature points. 
     */ 
    double *vecAtQPs; 

    /** \brief 
     * First DOFVector whose gradient is evaluated at quadrature points. 
     */ 
    DOFVectorBase<double>* vecGrd1; 

    /** \brief 
     * Gradient of first vector at quadrature points. 
     */ 
    WorldVector<double> *grad1AtQPs; 

    /** \brief 
     * Second DOFVector whose gradient is evaluated at quadrature points. 
     */ 
    DOFVectorBase<double>* vecGrd2; 

    /** \brief 
     * Gradient of second vector at quadrature points. 
     */ 
    WorldVector<double> *grad2AtQPs; 

    /** \brief 
     * Function for c. 
     */ 
    TertiaryAbstractFunction<double, double, WorldVector<double>, WorldVector<double> > *f; 
For faster browsing, not all history is shown. View entire blame