MFEM v2.0
lininteg.hpp
Go to the documentation of this file.
00001 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
00002 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
00003 // reserved. See file COPYRIGHT for details.
00004 //
00005 // This file is part of the MFEM library. For more information and source code
00006 // availability see http://mfem.googlecode.com.
00007 //
00008 // MFEM is free software; you can redistribute it and/or modify it under the
00009 // terms of the GNU Lesser General Public License (as published by the Free
00010 // Software Foundation) version 2.1 dated February 1999.
00011 
00012 #ifndef MFEM_LININTEG
00013 #define MFEM_LININTEG
00014 
00016 class LinearFormIntegrator
00017 {
00018 public:
00021    virtual void AssembleRHSElementVect(const FiniteElement &el,
00022                                        ElementTransformation &Tr,
00023                                        Vector &elvect) = 0;
00024    virtual void AssembleRHSElementVect(const FiniteElement &el,
00025                                        FaceElementTransformations &Tr,
00026                                        Vector &elvect);
00027    virtual ~LinearFormIntegrator() { };
00028 };
00029 
00030 
00032 class DomainLFIntegrator : public LinearFormIntegrator
00033 {
00034    Vector shape;
00035    Coefficient &Q;
00036    const IntegrationRule *IntRule;
00037    int oa, ob;
00038 public:
00040    DomainLFIntegrator(Coefficient &QF, int a = 2, int b = 0)
00041       // the old default was a = 1, b = 1
00042       // for simple elliptic problems a = 2, b = -2 is ok
00043       : Q(QF), oa(a), ob(b) { IntRule = NULL; }
00044 
00046    DomainLFIntegrator(Coefficient &QF, const IntegrationRule *ir)
00047       : Q(QF), oa(1), ob(1) { IntRule = ir; }
00048 
00051    virtual void AssembleRHSElementVect(const FiniteElement &el,
00052                                        ElementTransformation &Tr,
00053                                        Vector &elvect);
00054 
00055    using LinearFormIntegrator::AssembleRHSElementVect;
00056 };
00057 
00059 class BoundaryLFIntegrator : public LinearFormIntegrator
00060 {
00061    Vector shape;
00062    Coefficient &Q;
00063    int oa, ob;
00064 public:
00066    BoundaryLFIntegrator(Coefficient &QG, int a = 1, int b = 1)
00067       : Q(QG), oa(a), ob(b) {};
00068 
00071    virtual void AssembleRHSElementVect(const FiniteElement &el,
00072                                        ElementTransformation &Tr,
00073                                        Vector &elvect);
00074 
00075    using LinearFormIntegrator::AssembleRHSElementVect;
00076 };
00077 
00080 class VectorDomainLFIntegrator : public LinearFormIntegrator
00081 {
00082 private:
00083    Vector shape, Qvec;
00084    VectorCoefficient &Q;
00085 
00086 public:
00088    VectorDomainLFIntegrator(VectorCoefficient &QF) : Q(QF) {};
00089 
00092    virtual void AssembleRHSElementVect(const FiniteElement &el,
00093                                        ElementTransformation &Tr,
00094                                        Vector &elvect);
00095 
00096    using LinearFormIntegrator::AssembleRHSElementVect;
00097 };
00098 
00101 class VectorBoundaryLFIntegrator : public LinearFormIntegrator
00102 {
00103 private:
00104    Vector shape, vec;
00105    VectorCoefficient &Q;
00106 
00107 public:
00109    VectorBoundaryLFIntegrator(VectorCoefficient &QG) : Q(QG) {};
00110 
00113    virtual void AssembleRHSElementVect(const FiniteElement &el,
00114                                        ElementTransformation &Tr,
00115                                        Vector &elvect);
00116 
00117    using LinearFormIntegrator::AssembleRHSElementVect;
00118 };
00119 
00121 class VectorFEDomainLFIntegrator : public LinearFormIntegrator
00122 {
00123 private:
00124    VectorCoefficient &QF;
00125    DenseMatrix vshape;
00126    Vector vec;
00127 
00128 public:
00129    VectorFEDomainLFIntegrator (VectorCoefficient &F) : QF(F) { }
00130 
00131    virtual void AssembleRHSElementVect(const FiniteElement &el,
00132                                        ElementTransformation &Tr,
00133                                        Vector &elvect);
00134 
00135    using LinearFormIntegrator::AssembleRHSElementVect;
00136 };
00137 
00138 
00142 class VectorBoundaryFluxLFIntegrator : public LinearFormIntegrator
00143 {
00144 private:
00145    double Sign;
00146    Coefficient *F;
00147    Vector shape, nor;
00148    const IntegrationRule *IntRule;
00149 
00150 public:
00151    VectorBoundaryFluxLFIntegrator (Coefficient &f, double s = 1.0, const IntegrationRule *ir = NULL)
00152       : Sign(s), F(&f), IntRule(ir) { };
00153 
00154    virtual void AssembleRHSElementVect(const FiniteElement &el,
00155                                        ElementTransformation &Tr,
00156                                        Vector &elvect);
00157 
00158    using LinearFormIntegrator::AssembleRHSElementVect;
00159 };
00160 
00164 class VectorFEBoundaryFluxLFIntegrator : public LinearFormIntegrator
00165 {
00166 private:
00167    Coefficient &F;
00168    Vector shape;
00169 
00170 public:
00171    VectorFEBoundaryFluxLFIntegrator(Coefficient &f) : F(f) { }
00172 
00173    virtual void AssembleRHSElementVect(const FiniteElement &el,
00174                                        ElementTransformation &Tr,
00175                                        Vector &elvect);
00176 
00177    using LinearFormIntegrator::AssembleRHSElementVect;
00178 };
00179 
00180 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines