libMesh
Loading...
Searching...
No Matches
L-shaped.h
Go to the documentation of this file.
1#include "libmesh/enum_fe_family.h"
2#include "libmesh/fem_system.h"
3#include "libmesh/parameter_vector.h"
4#include "libmesh/qoi_set.h"
5#include "libmesh/system.h"
6#include "libmesh/parameter_pointer.h"
7
8#include <memory>
9
10// Bring in everything from the libMesh namespace
11using namespace libMesh;
12
13// FEMSystem, TimeSolver and NewtonSolver will handle most tasks,
14// but we must specify element residuals
15class LaplaceSystem : public FEMSystem
16{
17public:
18 // Constructor
20 const std::string & name_in,
21 const unsigned int number_in)
22 : FEMSystem(es, name_in, number_in),
23 _fe_family("LAGRANGE"),
24 _fe_order(1),
26 {}
27
28 std::string & fe_family() { return _fe_family; }
29 unsigned int & fe_order() { return _fe_order; }
31
32 Number & get_parameter_value(unsigned int parameter_index)
33 {
34 return parameters[parameter_index];
35 }
36
38 {
40 for (std::size_t i = 0; i != parameters.size(); ++i)
42
43 return parameter_vector;
44 }
45
46protected:
47 // System initialization
48 virtual void init_data ();
49
50 // Context initialization
51 virtual void init_context (DiffContext & context);
52
53 // Element residual and jacobian calculations
54 // Time dependent parts
55 virtual bool element_time_derivative (bool request_jacobian,
56 DiffContext & context);
57
58 // Constraint parts
59 virtual bool side_constraint (bool request_jacobian,
60 DiffContext & context);
61
63
64 // Parameters associated with the system
65 std::vector<Number> parameters;
66
67 // The ParameterVector object that will contain pointers to
68 // the system parameters
70
71 // The FE type to use
72 std::string _fe_family;
73 unsigned int _fe_order;
74
75 // Calculate Jacobians analytically or not?
77};
std::string _fe_family
Definition L-shaped.h:84
bool _analytic_jacobians
Definition L-shaped.h:88
ParameterVector parameter_vector
Definition L-shaped.h:69
Number exact_solution(const Point &)
virtual bool element_time_derivative(bool request_jacobian, DiffContext &context)
Adds the time derivative contribution on elem to elem_residual.
LaplaceSystem(EquationSystems &es, const std::string &name_in, const unsigned int number_in)
Definition L-shaped.h:19
Number & get_parameter_value(unsigned int parameter_index)
Definition L-shaped.h:32
std::string & fe_family()
Definition L-shaped.h:28
unsigned int _fe_order
Definition L-shaped.h:85
unsigned int & fe_order()
Definition L-shaped.h:29
std::vector< Number > parameters
Definition L-shaped.h:65
ParameterVector & get_parameter_vector()
Definition L-shaped.h:37
bool & analytic_jacobians()
Definition L-shaped.h:30
virtual void init_data()
Initializes the member data fields associated with the system, so that, e.g., assemble() may be used.
virtual void init_context(DiffContext &context)
virtual bool side_constraint(bool request_jacobian, DiffContext &context)
Adds the constraint contribution on side of elem to elem_residual.
This class provides all data required for a physics package (e.g.
This is the EquationSystems class.
This class provides a specific system class.
Definition fem_system.h:55
Accessor object allowing reading and modification of the independent variables in a parameter sensiti...
Data structure for specifying which Parameters should be independent variables in a parameter sensiti...
void clear()
Resets to "no parameters".
void push_back(std::unique_ptr< ParameterAccessor< Number > > new_accessor)
Adds an additional parameter accessor to the end of the vector.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition point.h:40
The libMesh namespace provides an interface to certain functionality in the library.