libMesh
assembly.h
Go to the documentation of this file.
1 #ifndef ASSEMBLY_H
2 #define ASSEMBLY_H
3 
4 // rbOOmit includes
5 #include "libmesh/rb_parameters.h"
6 #include "libmesh/rb_theta.h"
7 #include "libmesh/rb_theta_expansion.h"
8 #include "libmesh/rb_assembly_expansion.h"
9 #include "libmesh/elem_assembly.h"
10 
11 // Bring in bits from the libMesh namespace.
12 // Just the bits we're using, since this is a header.
15 using libMesh::Number;
16 using libMesh::Real;
19 using libMesh::RBTheta;
22 using libMesh::System;
23 using libMesh::Node;
24 
25 // boundary IDs
26 #define BOUNDARY_ID_MIN_Z 0
27 #define BOUNDARY_ID_MIN_Y 1
28 #define BOUNDARY_ID_MAX_X 2
29 #define BOUNDARY_ID_MAX_Y 3
30 #define BOUNDARY_ID_MIN_X 4
31 #define BOUNDARY_ID_MAX_Z 5
32 #define NODE_BOUNDARY_ID 10
33 
35 
36 // Kronecker delta function
37 inline Real kronecker_delta(unsigned int i,
38  unsigned int j);
39 
40 // Rank-4 tensor for elasticity
41 Real elasticity_tensor(unsigned int i,
42  unsigned int j,
43  unsigned int k,
44  unsigned int l);
45 
47 {
48 
50  rb_sys(rb_sys_in)
51  {}
52 
57 };
58 
59 struct ThetaA0 : RBTheta
60 {
61  virtual Number evaluate(const RBParameters &)
62  {
63  return 1.;
64  }
65 };
66 
68 {
69 
71  ElasticityAssembly(rb_sys_in)
72  {}
73 
74  // The interior assembly operator
75  virtual void interior_assembly(FEMContext & c);
76 };
77 
78 struct ThetaA1 : RBTheta
79 {
80  virtual Number evaluate(const RBParameters & mu)
81  {
82  return mu.get_value("x_scaling");
83  }
84 };
85 
87 {
89  ElasticityAssembly(rb_sys_in)
90  {}
91 
92  // The interior assembly operator
93  virtual void interior_assembly(FEMContext & c);
94 };
95 
96 struct ThetaA2 : RBTheta
97 {
98  virtual Number evaluate(const RBParameters & mu)
99  {
100  return 1./mu.get_value("x_scaling");
101  }
102 };
103 
105 {
106 
108  :
109  ElasticityAssembly(rb_sys_in)
110  {}
111 
112  // The interior assembly operator
113  virtual void interior_assembly(FEMContext & c);
114 };
115 
116 struct ThetaF0 : RBTheta
117 {
118  virtual Number evaluate(const RBParameters & mu)
119  {
120  return mu.get_value("load_Fx");
121  }
122 };
123 
125 {
127  :
128  ElasticityAssembly(rb_sys_in)
129  {}
130 
131  // Apply a traction
132  virtual void boundary_assembly(FEMContext & c);
133 };
134 
135 struct ThetaF1 : RBTheta
136 {
137  virtual Number evaluate(const RBParameters & mu)
138  {
139  return mu.get_value("load_Fy");
140  }
141 };
142 
144 {
146  :
147  ElasticityAssembly(rb_sys_in)
148  {}
149 
150  // Apply a traction
151  virtual void boundary_assembly(FEMContext & c);
152 };
153 
154 struct ThetaF2 : RBTheta
155 {
156  virtual Number evaluate(const RBParameters & mu)
157  {
158  return mu.get_value("load_Fz");
159  }
160 };
161 
163 {
165  :
166  ElasticityAssembly(rb_sys_in)
167  {}
168 
169  // Apply a traction
170  virtual void boundary_assembly(FEMContext & c);
171 };
172 
174 {
175  virtual Number evaluate(const RBParameters & mu)
176  {
177  return mu.get_value("point_load_Fx");
178  }
179 };
180 
182 {
184  {}
185 
186  // Apply a point load
187  virtual void get_nodal_rhs_values(std::map<numeric_index_type, Number> & values,
188  const System & sys,
189  const Node & node);
190 
191 };
192 
194 {
195  virtual Number evaluate(const RBParameters & mu)
196  {
197  return mu.get_value("point_load_Fy");
198  }
199 };
200 
202 {
204  {}
205 
206  // Apply a point load
207  virtual void get_nodal_rhs_values(std::map<numeric_index_type, Number> & values,
208  const System & sys,
209  const Node & node);
210 
211 };
212 
214 {
215  virtual Number evaluate(const RBParameters & mu)
216  {
217  return mu.get_value("point_load_Fz");
218  }
219 };
220 
222 {
224  {}
225 
226  // Apply a point load
227  virtual void get_nodal_rhs_values(std::map<numeric_index_type, Number> & values,
228  const System & sys,
229  const Node & node);
230 
231 };
232 
234 {
235 
237  :
238  ElasticityAssembly(rb_sys_in)
239  {}
240 
241  // The interior assembly operator
242  virtual void interior_assembly(FEMContext & c);
243 };
244 
245 // Define an RBThetaExpansion class for this PDE
247 {
248 
253  {
254  // set up the RBThetaExpansion object
255  attach_A_theta(&theta_a_0);
256  attach_A_theta(&theta_a_1);
257  attach_A_theta(&theta_a_2);
258  attach_F_theta(&theta_f_0);
259  attach_F_theta(&theta_f_1);
260  attach_F_theta(&theta_f_2);
261  attach_F_theta(&theta_point_load_x);
262  attach_F_theta(&theta_point_load_y);
263  attach_F_theta(&theta_point_load_z);
264  }
265 
266  // The RBTheta member variables
276 };
277 
278 // Define an RBAssemblyExpansion class for this PDE
280 {
285  A0_assembly(rb_sys_in),
286  A1_assembly(rb_sys_in),
287  A2_assembly(rb_sys_in),
288  F0_assembly(rb_sys_in),
289  F1_assembly(rb_sys_in),
290  F2_assembly(rb_sys_in)
291  {
292  // And set up the RBAssemblyExpansion object
293  attach_A_assembly(&A0_assembly);
294  attach_A_assembly(&A1_assembly);
295  attach_A_assembly(&A2_assembly);
296  attach_F_assembly(&F0_assembly);
297  attach_F_assembly(&F1_assembly);
298  attach_F_assembly(&F2_assembly);
299  attach_F_assembly(&point_load_assembly_x);
300  attach_F_assembly(&point_load_assembly_y);
301  attach_F_assembly(&point_load_assembly_z);
302  }
303 
304  // The ElemAssembly objects
314 };
315 
316 #endif
A Node is like a Point, but with more information.
Definition: node.h:52
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
Definition: assembly.h:156
AssemblyA1(ElasticityRBConstruction &rb_sys_in)
Definition: assembly.h:88
ImplicitSystem & sys
Real get_value(const std::string &param_name) const
Get the value of the specific parameter.
Definition: rb_parameters.C:45
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
Definition: assembly.h:80
virtual void interior_assembly(FEMContext &)
Perform the element interior assembly.
Definition: elem_assembly.h:59
ElasticityRBConstruction & rb_sys
The ElasticityRBConstruction object that will use this assembly.
Definition: assembly.h:56
AssemblyF0(ElasticityRBConstruction &rb_sys_in)
Definition: assembly.h:126
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
Definition: assembly.h:118
This class stores the set of RBTheta functor objects that define the "parameter-dependent expansion" ...
virtual void get_nodal_rhs_values(std::map< numeric_index_type, Number > &values, const System &, const Node &)
Get values to add to the RHS vector based on node.
Definition: elem_assembly.h:88
virtual void boundary_assembly(FEMContext &)
Perform the element boundary assembly.
Definition: elem_assembly.h:64
Real elasticity_tensor(unsigned int i, unsigned int j, unsigned int k, unsigned int l)
Definition: assembly.C:38
ThetaPointLoadY theta_point_load_y
Definition: assembly.h:274
dof_id_type numeric_index_type
Definition: id_types.h:92
AssemblyPointLoadZ point_load_assembly_z
Definition: assembly.h:313
AssemblyF2(ElasticityRBConstruction &rb_sys_in)
Definition: assembly.h:164
This is the base class for classes which contain information related to any physical process that mig...
Definition: system.h:76
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
Definition: assembly.h:175
AssemblyF1(ElasticityRBConstruction &rb_sys_in)
Definition: assembly.h:145
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
Definition: assembly.h:98
ElasticityAssemblyExpansion(ElasticityRBConstruction &rb_sys_in)
Constructor.
Definition: assembly.h:284
This class provides all data required for a physics package (e.g.
Definition: fem_context.h:61
Real kronecker_delta(unsigned int i, unsigned int j)
Definition: assembly.C:32
ThetaPointLoadZ theta_point_load_z
Definition: assembly.h:275
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
Definition: assembly.h:215
AssemblyPointLoadY point_load_assembly_y
Definition: assembly.h:312
ThetaPointLoadX theta_point_load_x
Definition: assembly.h:273
ElasticityAssembly(ElasticityRBConstruction &rb_sys_in)
Definition: assembly.h:49
This class is part of the rbOOmit framework.
Definition: rb_parameters.h:42
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
Definition: assembly.h:195
AssemblyA2(ElasticityRBConstruction &rb_sys_in)
Definition: assembly.h:107
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Number evaluate(const RBParameters &mu)
Evaluate the functor object for the given parameter.
Definition: assembly.h:137
This class stores the set of ElemAssembly functor objects that define the "parameter-independent expa...
ElemAssembly provides a per-element (interior and boundary) assembly functionality.
Definition: elem_assembly.h:38
InnerProductAssembly(ElasticityRBConstruction &rb_sys_in)
Definition: assembly.h:236
This class is part of the rbOOmit framework.
Definition: rb_theta.h:46
AssemblyPointLoadX point_load_assembly_x
Definition: assembly.h:311
virtual Number evaluate(const RBParameters &)
Evaluate the functor object for the given parameter.
Definition: assembly.h:61
ElasticityThetaExpansion()
Constructor.
Definition: assembly.h:252
AssemblyA0(ElasticityRBConstruction &rb_sys_in)
Definition: assembly.h:70