libMesh
Loading...
Searching...
No Matches
examples
vector_fe
vector_fe_ex2
laplace_system.h
Go to the documentation of this file.
1
// The libMesh Finite Element Library.
2
// Copyright (C) 2002-2026 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
#ifndef LAPLACE_SYSTEM_H
19
#define LAPLACE_SYSTEM_H
20
21
// DiffSystem framework files
22
#include "libmesh/fem_system.h"
23
#include "libmesh/vector_value.h"
24
#include "libmesh/tensor_value.h"
25
#include "libmesh/dirichlet_boundaries.h"
26
27
#include "solution_function.h"
28
29
using namespace
libMesh
;
30
31
// FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
32
// but we must specify element residuals
33
class
LaplaceSystem
:
public
FEMSystem
34
{
35
public
:
36
// Constructor
37
LaplaceSystem
(
EquationSystems
& es,
38
const
std::string &
name
,
39
const
unsigned
int
number
);
40
41
// System initialization
42
virtual
void
init_data
();
43
44
// Context initialization
45
virtual
void
init_context
(
DiffContext
& context);
46
47
// Element residual and jacobian calculations
48
// Time dependent parts
49
virtual
bool
element_time_derivative
(
bool
request_jacobian,
50
DiffContext
& context);
51
52
// Constraint part
53
// virtual bool side_constraint (bool request_jacobian,
54
// DiffContext & context);
55
56
protected
:
57
// Indices for each variable;
58
unsigned
int
u_var
;
59
60
void
init_dirichlet_bcs
();
61
62
// Returns the value of a forcing function at point p.
63
RealGradient
forcing
(
const
Point
& p);
64
65
LaplaceExactSolution
exact_solution
;
66
};
67
68
#endif
// LAPLACE_SYSTEM_H
LaplaceExactSolution
Definition
laplace_exact_solution.h:26
LaplaceSystem
Definition
L-shaped.h:12
LaplaceSystem::element_time_derivative
virtual bool element_time_derivative(bool request_jacobian, DiffContext &context)
Adds the time derivative contribution on elem to elem_residual.
LaplaceSystem::exact_solution
LaplaceExactSolution exact_solution
Definition
laplace_system.h:65
LaplaceSystem::LaplaceSystem
LaplaceSystem(EquationSystems &es, const std::string &name, const unsigned int number)
LaplaceSystem::init_dirichlet_bcs
void init_dirichlet_bcs()
Definition
laplace_system.C:64
LaplaceSystem::forcing
RealGradient forcing(const Point &p)
Definition
laplace_system.C:227
LaplaceSystem::init_data
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
LaplaceSystem::init_context
virtual void init_context(DiffContext &context)
LaplaceSystem::u_var
unsigned int u_var
Definition
laplace_system.h:58
libMesh::DiffContext
This class provides all data required for a physics package (e.g.
Definition
diff_context.h:56
libMesh::EquationSystems
This is the EquationSystems class.
Definition
equation_systems.h:72
libMesh::FEMSystem
This class provides a specific system class.
Definition
fem_system.h:55
libMesh::Point
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition
point.h:40
libMesh::System::name
const std::string & name() const
Definition
system.h:2385
libMesh::System::number
unsigned int number() const
Definition
system.h:2393
libMesh::VectorValue< Real >
libMesh
The libMesh namespace provides an interface to certain functionality in the library.
Generated on Fri Aug 21 2026 13:32:26 for libMesh by
1.9.8