70{
72
73
74 libmesh_example_requires(2 <= LIBMESH_DIM, "2D support");
75
76
78 "--enable-petsc, --enable-trilinos, or --enable-eigen");
79
80
81
83 for (int i=1; i<argc; i++)
86
87
88
90
91
92
93
94
96
97
98
99
100
101
102
103
104
106
107
108
109 equation_systems.parameters.set<bool> ("test") = true;
110
111
112
113 equation_systems.parameters.set<
Real> (
"dummy") = 42.;
114
115
116 equation_systems.parameters.set<
Real> (
"nobody") = 0.;
117
118
119
120
121
123
124
125
126 equation_systems.get_system(
"Simple System").add_variable(
"u",
FIRST);
127
128
129
130
132
133
134
135
136
138 equation_systems.get_system(
"Complex System").add_variable(
"T",
FIRST);
139 equation_systems.get_system(
"Complex System").add_variable(
"dv",
SECOND,
MONOMIAL);
140
141
142 equation_systems.init();
143
144
146
147 equation_systems.print_info();
148
149
150
151
152
153
154
155
156
157
158
159
160 if (argc > 1)
161 if (argv[1][0] != '-')
162 {
163 libMesh::out <<
"<<< Writing system to file " << argv[1]
164 << std::endl;
165
166
167 equation_systems.write (argv[1],
WRITE);
168
169
170 equation_systems.clear ();
171
172 libMesh::out <<
">>> Reading system from file " << argv[1]
173 << std::endl << std::endl;
174
175
176
177 equation_systems.read (argv[1],
READ);
178
179
180 equation_systems.print_info();
181 }
182
183
184
185
186
187 return 0;
188}
This is the EquationSystems class.
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems.
The LibMeshInit class, when constructed, initializes the dependent libraries (e.g.
void print_info(std::ostream &os=libMesh::out, const unsigned int verbosity=0, const bool global=true) const
Prints relevant information about the mesh.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
Manages storage and variables for transient systems.
void init(triangulateio &t)
Initializes the fields of t to nullptr/0 as necessary.
SolverPackage default_solver_package()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real