libMesh
src
apps
L2system.h
Go to the documentation of this file.
1
// The libMesh Finite Element Library.
2
// Copyright (C) 2002-2018 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner
3
4
// This library is free software; you can redistribute it and/or
5
// modify it under the terms of the GNU Lesser General Public
6
// License as published by the Free Software Foundation; either
7
// version 2.1 of the License, or (at your option) any later version.
8
9
// This library is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
// Lesser General Public License for more details.
13
14
// You should have received a copy of the GNU Lesser General Public
15
// License along with this library; if not, write to the Free Software
16
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
18
#include "libmesh/enum_fe_family.h"
19
#include "libmesh/fem_function_base.h"
20
#include "libmesh/fem_system.h"
21
22
#include <map>
23
24
// FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
25
// but we must specify element residuals
26
class
L2System
:
public
libMesh::FEMSystem
27
{
28
public
:
29
// Constructor
30
L2System
(
libMesh::EquationSystems
& es,
31
const
std::string &
name
,
32
const
unsigned
int
number
)
33
:
libMesh
::
FEMSystem
(es,
name
,
number
),
34
input_system
(nullptr),
35
_fe_family
(
"LAGRANGE"
),
36
_fe_order
(1) {}
37
38
// Destructor; deletes extra context objects
39
~L2System
();
40
41
std::string &
fe_family
() {
return
_fe_family
; }
42
unsigned
int
&
fe_order
() {
return
_fe_order
; }
43
44
// We want to be able to project functions based on *other* systems'
45
// values. For that we need not only a FEMFunction but also a
46
// reference to the system where it applies and a separate context
47
// object (or multiple separate context objects, in the threaded
48
// case) for that system.
49
std::unique_ptr<libMesh::FEMFunctionBase<libMesh::Number> >
goal_func
;
50
51
libMesh::System
*
input_system
;
52
53
std::map<libMesh::FEMContext *, libMesh::FEMContext *>
54
input_contexts
;
55
56
protected
:
57
// System initialization
58
virtual
void
init_data
();
59
60
// Context initialization
61
virtual
void
init_context
(
libMesh::DiffContext
& context);
62
63
// Element residual and jacobian calculations
64
// Time dependent parts
65
virtual
bool
element_time_derivative
(
bool
request_jacobian,
66
libMesh::DiffContext
& context);
67
68
// The FE type to use
69
std::string
_fe_family
;
70
unsigned
int
_fe_order
;
71
};
libMesh::System
Manages consistently variables, degrees of freedom, and coefficient vectors.
Definition:
system.h:100
L2System::init_data
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
Definition:
L2system.C:36
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Definition:
factoryfunction.C:55
L2System::input_contexts
std::map< libMesh::FEMContext *, libMesh::FEMContext * > input_contexts
Definition:
L2system.h:54
L2System::goal_func
std::unique_ptr< libMesh::FEMFunctionBase< libMesh::Number > > goal_func
Definition:
L2system.h:49
L2System::fe_order
unsigned int & fe_order()
Definition:
L2system.h:42
libMesh::System::number
unsigned int number() const
Definition:
system.h:2075
L2System::init_context
virtual void init_context(libMesh::DiffContext &context)
Definition:
L2system.C:47
libMesh::FEMSystem::FEMSystem
FEMSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
Definition:
fem_system.C:826
libMesh::FEMSystem
This class provides a specific system class.
Definition:
fem_system.h:53
L2System::fe_family
std::string & fe_family()
Definition:
L2system.h:41
L2System::element_time_derivative
virtual bool element_time_derivative(bool request_jacobian, libMesh::DiffContext &context)
Adds the time derivative contribution on elem to elem_residual.
Definition:
L2system.C:73
L2System
Definition:
L2system.h:26
L2System::L2System
L2System(libMesh::EquationSystems &es, const std::string &name, const unsigned int number)
Definition:
L2system.h:30
libMesh::DiffContext
This class provides all data required for a physics package (e.g.
Definition:
diff_context.h:55
libMesh::EquationSystems
This is the EquationSystems class.
Definition:
equation_systems.h:74
libMesh::System::name
const std::string & name() const
Definition:
system.h:2067
L2System::_fe_family
std::string _fe_family
Definition:
L2system.h:69
L2System::input_system
libMesh::System * input_system
Definition:
L2system.h:51
L2System::_fe_order
unsigned int _fe_order
Definition:
L2system.h:70
L2System::~L2System
~L2System()
Definition:
L2system.C:30
Generated on Sat Jan 25 2020 12:06:55 for libMesh by
1.8.16