MFEM
v3.3
Finite element discretization library
Main Page
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Pages
fem
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.org.
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
22
/// Class for linear form - Vector with associated FE space and LFIntegrators.
23
class
LinearForm
:
public
Vector
24
{
25
private
:
26
/// FE space on which LF lives.
27
FiniteElementSpace
* fes;
28
29
/// Set of Domain Integrators to be applied.
30
Array<LinearFormIntegrator*>
dlfi;
31
32
/// Set of Boundary Integrators to be applied.
33
Array<LinearFormIntegrator*>
blfi;
34
35
/// Set of Boundary Face Integrators to be applied.
36
Array<LinearFormIntegrator*>
flfi;
37
Array<Array<int>
*> flfi_marker;
38
39
public
:
40
/// Creates linear form associated with FE space *f.
41
LinearForm
(
FiniteElementSpace
* f) :
Vector
(f -> GetVSize())
42
{ fes = f; }
43
44
LinearForm
() { fes = NULL; }
45
46
FiniteElementSpace
*
GetFES
() {
return
fes; }
47
48
/// Adds new Domain Integrator.
49
void
AddDomainIntegrator
(
LinearFormIntegrator
* lfi);
50
51
/// Adds new Boundary Integrator.
52
void
AddBoundaryIntegrator
(
LinearFormIntegrator
* lfi);
53
54
/// Adds new Boundary Face Integrator.
55
void
AddBdrFaceIntegrator
(
LinearFormIntegrator
* lfi);
56
57
/** @brief Add new Boundary Face Integrator, restricted to the given boundary
58
attributes. */
59
void
AddBdrFaceIntegrator
(
LinearFormIntegrator
*lfi,
60
Array<int>
&bdr_attr_marker);
61
62
/// Assembles the linear form i.e. sums over all domain/bdr integrators.
63
void
Assemble
();
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
71
/// Destroys linear form.
72
~LinearForm
();
73
};
74
75
}
76
77
#endif
mfem::FiniteElementSpace::GetVSize
int GetVSize() const
Definition:
fespace.hpp:163
mfem::LinearForm::LinearForm
LinearForm(FiniteElementSpace *f)
Creates linear form associated with FE space *f.
Definition:
linearform.hpp:41
mfem::Vector::SetSize
void SetSize(int s)
Resize the vector to size s.
Definition:
vector.hpp:310
mfem::LinearForm::Assemble
void Assemble()
Assembles the linear form i.e. sums over all domain/bdr integrators.
Definition:
linearform.cpp:42
lininteg.hpp
mfem::LinearFormIntegrator
Abstract base class LinearFormIntegrator.
Definition:
lininteg.hpp:22
mfem::LinearForm::Update
void Update(FiniteElementSpace *f)
Definition:
linearform.hpp:67
mfem::Array
Definition:
array.hpp:52
mfem::LinearForm::AddBdrFaceIntegrator
void AddBdrFaceIntegrator(LinearFormIntegrator *lfi)
Adds new Boundary Face Integrator.
Definition:
linearform.cpp:29
mfem::LinearForm::AddBoundaryIntegrator
void AddBoundaryIntegrator(LinearFormIntegrator *lfi)
Adds new Boundary Integrator.
Definition:
linearform.cpp:24
fespace.hpp
mfem::LinearForm::LinearForm
LinearForm()
Definition:
linearform.hpp:44
mfem::LinearForm::AddDomainIntegrator
void AddDomainIntegrator(LinearFormIntegrator *lfi)
Adds new Domain Integrator.
Definition:
linearform.cpp:19
mfem::FiniteElementSpace
Definition:
fespace.hpp:60
mfem::LinearForm::Update
void Update()
Definition:
linearform.hpp:65
mfem::LinearForm::~LinearForm
~LinearForm()
Destroys linear form.
Definition:
linearform.cpp:131
mfem::Vector
Vector data type.
Definition:
vector.hpp:36
mfem::LinearForm
Class for linear form - Vector with associated FE space and LFIntegrators.
Definition:
linearform.hpp:23
mfem::LinearForm::GetFES
FiniteElementSpace * GetFES()
Definition:
linearform.hpp:46
Generated on Fri Feb 18 2022 19:01:55 for MFEM by
1.8.5