MFEM  v3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
linearform.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.googlecode.com.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11 
12 #ifndef MFEM_LINEARFORM
13 #define MFEM_LINEARFORM
14 
15 #include "../config/config.hpp"
16 #include "lininteg.hpp"
17 #include "fespace.hpp"
18 
19 namespace mfem
20 {
21 
23 class LinearForm : public Vector
24 {
25 private:
27  FiniteElementSpace * fes;
28 
31 
34 
37 
38 public:
40  LinearForm (FiniteElementSpace * f) : Vector (f -> GetVSize())
41  { fes = f; };
42 
43  LinearForm(){ fes = NULL; }
44 
45  FiniteElementSpace * GetFES() { return fes; };
46 
49 
52 
55 
57  void Assemble();
58 
60  void ConformingAssemble(Vector &b) const;
61 
63  void ConformingAssemble();
64 
65  void Update() { SetSize(fes->GetVSize()); }
66 
67  void Update(FiniteElementSpace *f) { fes = f; SetSize(f->GetVSize()); }
68 
69  void Update(FiniteElementSpace *f, Vector &v, int v_offset);
70 
72  ~LinearForm();
73 };
74 
75 }
76 
77 #endif
int GetVSize() const
Definition: fespace.hpp:151
void ConformingAssemble()
Apply the conforming interpolation matrix to 'this': this = P'*this.
Definition: linearform.cpp:103
LinearForm(FiniteElementSpace *f)
Creates linear form associated with FE space *f.
Definition: linearform.hpp:40
void SetSize(int s)
Resizes the vector if the new size is different.
Definition: vector.hpp:248
void Assemble()
Assembles the linear form i.e. sums over all domain/bdr integrators.
Definition: linearform.cpp:34
Abstract base class LinearFormIntegrator.
Definition: lininteg.hpp:22
void Update(FiniteElementSpace *f)
Definition: linearform.hpp:67
void AddBdrFaceIntegrator(LinearFormIntegrator *lfi)
Adds new Boundary Face Integrator.
Definition: linearform.cpp:29
void AddBoundaryIntegrator(LinearFormIntegrator *lfi)
Adds new Boundary Integrator.
Definition: linearform.cpp:24
void AddDomainIntegrator(LinearFormIntegrator *lfi)
Adds new Domain Integrator.
Definition: linearform.cpp:19
Abstract finite element space.
Definition: fespace.hpp:61
~LinearForm()
Destroys linear form.
Definition: linearform.cpp:119
Vector data type.
Definition: vector.hpp:29
Class for linear form - Vector with associated FE space and LFIntegrators.
Definition: linearform.hpp:23
FiniteElementSpace * GetFES()
Definition: linearform.hpp:45