MFEM
v3.3.2
Finite element discretization library
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Pages
fem
nonlinearform.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_NONLINEARFORM
13
#define MFEM_NONLINEARFORM
14
15
#include "../config/config.hpp"
16
#include "
nonlininteg.hpp
"
17
#include "
fespace.hpp
"
18
19
namespace
mfem
20
{
21
22
class
NonlinearForm
:
public
Operator
23
{
24
protected
:
25
/// FE space on which the form lives.
26
FiniteElementSpace
*
fes
;
// not owned
27
28
/// Set of Domain Integrators to be assembled (added).
29
Array<NonlinearFormIntegrator*>
dnfi
;
// owned
30
31
/// Set of interior face Integrators to be assembled (added).
32
Array<NonlinearFormIntegrator*>
fnfi
;
// owned
33
34
/// Set of boundary face Integrators to be assembled (added).
35
Array<NonlinearFormIntegrator*>
bfnfi
;
// owned
36
Array<Array<int>
*>
bfnfi_marker
;
// not owned
37
38
mutable
SparseMatrix
*
Grad
;
// owned
39
40
// A list of all essential vdofs
41
Array<int>
ess_vdofs
;
42
43
public
:
44
NonlinearForm
(
FiniteElementSpace
*f)
45
:
Operator
(f->GetVSize()) {
fes
= f;
Grad
= NULL; }
46
47
FiniteElementSpace
*
FESpace
() {
return
fes
; }
48
const
FiniteElementSpace
*
FESpace
()
const
{
return
fes
; }
49
50
/// Adds new Domain Integrator.
51
void
AddDomainIntegrator
(
NonlinearFormIntegrator
*nlfi)
52
{
dnfi
.Append(nlfi); }
53
54
/// Adds new Interior Face Integrator.
55
void
AddInteriorFaceIntegrator
(
NonlinearFormIntegrator
*nlfi)
56
{
fnfi
.Append(nlfi); }
57
58
/// Adds new Boundary Face Integrator.
59
void
AddBdrFaceIntegrator
(
NonlinearFormIntegrator
*nlfi)
60
{
bfnfi
.Append(nlfi);
bfnfi_marker
.Append(NULL); }
61
62
/** @brief Adds new Boundary Face Integrator, restricted to specific boundary
63
attributes. */
64
void
AddBdrFaceIntegrator
(
NonlinearFormIntegrator
*nfi,
65
Array<int>
&bdr_marker)
66
{
bfnfi
.Append(nfi);
bfnfi_marker
.Append(&bdr_marker); }
67
68
virtual
void
SetEssentialBC
(
const
Array<int>
&bdr_attr_is_ess,
69
Vector
*rhs = NULL);
70
71
void
SetEssentialVDofs
(
const
Array<int>
&ess_vdofs_list)
72
{
73
ess_vdofs_list.
Copy
(
ess_vdofs
);
// ess_vdofs_list --> ess_vdofs
74
}
75
76
virtual
double
GetEnergy
(
const
Vector
&x)
const
;
77
78
virtual
void
Mult
(
const
Vector
&x,
Vector
&y)
const
;
79
80
virtual
Operator
&
GetGradient
(
const
Vector
&x)
const
;
81
82
virtual
~NonlinearForm
();
83
};
84
85
}
86
87
#endif
mfem::NonlinearForm::dnfi
Array< NonlinearFormIntegrator * > dnfi
Set of Domain Integrators to be assembled (added).
Definition:
nonlinearform.hpp:29
mfem::NonlinearForm::FESpace
const FiniteElementSpace * FESpace() const
Definition:
nonlinearform.hpp:48
mfem::NonlinearForm::AddDomainIntegrator
void AddDomainIntegrator(NonlinearFormIntegrator *nlfi)
Adds new Domain Integrator.
Definition:
nonlinearform.hpp:51
mfem::Array::Copy
void Copy(Array ©) const
Create a copy of the current array.
Definition:
array.hpp:161
mfem::NonlinearForm::AddBdrFaceIntegrator
void AddBdrFaceIntegrator(NonlinearFormIntegrator *nfi, Array< int > &bdr_marker)
Adds new Boundary Face Integrator, restricted to specific boundary attributes.
Definition:
nonlinearform.hpp:64
mfem::NonlinearForm::bfnfi
Array< NonlinearFormIntegrator * > bfnfi
Set of boundary face Integrators to be assembled (added).
Definition:
nonlinearform.hpp:35
mfem::NonlinearForm::fes
FiniteElementSpace * fes
FE space on which the form lives.
Definition:
nonlinearform.hpp:26
mfem::NonlinearForm::AddInteriorFaceIntegrator
void AddInteriorFaceIntegrator(NonlinearFormIntegrator *nlfi)
Adds new Interior Face Integrator.
Definition:
nonlinearform.hpp:55
mfem::NonlinearForm::AddBdrFaceIntegrator
void AddBdrFaceIntegrator(NonlinearFormIntegrator *nlfi)
Adds new Boundary Face Integrator.
Definition:
nonlinearform.hpp:59
mfem::SparseMatrix
Data type sparse matrix.
Definition:
sparsemat.hpp:38
mfem::NonlinearForm::fnfi
Array< NonlinearFormIntegrator * > fnfi
Set of interior face Integrators to be assembled (added).
Definition:
nonlinearform.hpp:32
mfem::Array
Definition:
array.hpp:53
mfem::NonlinearForm::NonlinearForm
NonlinearForm(FiniteElementSpace *f)
Definition:
nonlinearform.hpp:44
mfem::NonlinearForm::ess_vdofs
Array< int > ess_vdofs
Definition:
nonlinearform.hpp:41
mfem::NonlinearForm::bfnfi_marker
Array< Array< int > * > bfnfi_marker
Definition:
nonlinearform.hpp:36
fespace.hpp
mfem::NonlinearForm
Definition:
nonlinearform.hpp:22
mfem::NonlinearForm::FESpace
FiniteElementSpace * FESpace()
Definition:
nonlinearform.hpp:47
mfem::NonlinearForm::Mult
virtual void Mult(const Vector &x, Vector &y) const
Operator application: y=A(x).
Definition:
nonlinearform.cpp:82
mfem::FiniteElementSpace
Definition:
fespace.hpp:60
mfem::NonlinearForm::~NonlinearForm
virtual ~NonlinearForm()
Definition:
nonlinearform.cpp:330
mfem::NonlinearFormIntegrator
Definition:
nonlininteg.hpp:26
mfem::NonlinearForm::GetGradient
virtual Operator & GetGradient(const Vector &x) const
Evaluate the gradient operator at the point x. The default behavior in class Operator is to generate ...
Definition:
nonlinearform.cpp:198
mfem::NonlinearForm::SetEssentialBC
virtual void SetEssentialBC(const Array< int > &bdr_attr_is_ess, Vector *rhs=NULL)
Definition:
nonlinearform.cpp:17
mfem::Vector
Vector data type.
Definition:
vector.hpp:41
mfem::NonlinearForm::Grad
SparseMatrix * Grad
Definition:
nonlinearform.hpp:38
mfem::NonlinearForm::GetEnergy
virtual double GetEnergy(const Vector &x) const
Definition:
nonlinearform.cpp:48
mfem::NonlinearForm::SetEssentialVDofs
void SetEssentialVDofs(const Array< int > &ess_vdofs_list)
Definition:
nonlinearform.hpp:71
nonlininteg.hpp
mfem::Operator
Abstract operator.
Definition:
operator.hpp:21
Generated on Fri Feb 18 2022 19:42:04 for MFEM by
1.8.5