17 #ifndef __deal2__integrators_maxwell_h
18 #define __deal2__integrators_maxwell_h
21 #include <deal.II/base/config.h>
23 #include <deal.II/base/quadrature.h>
24 #include <deal.II/lac/full_matrix.h>
25 #include <deal.II/fe/mapping.h>
26 #include <deal.II/fe/fe_values.h>
27 #include <deal.II/meshworker/dof_info.h>
29 DEAL_II_NAMESPACE_OPEN
31 namespace LocalIntegrators
104 result[0] = h1[0][1]-h0[1][1];
105 result[1] = h0[0][1]-h1[0][0];
108 result[0] = h1[0][1]+h2[0][2]-h0[1][1]-h0[2][2];
109 result[1] = h2[1][2]+h0[1][0]-h1[2][2]-h1[0][0];
110 result[2] = h0[2][0]+h1[2][1]-h2[0][0]-h2[1][1];
144 result[0] = normal[1] * (g1[0]-g0[1]);
145 result[1] =-normal[0] * (g1[0]-g0[1]);
148 result[0] = normal[2]*(g2[1]-g0[2])+normal[1]*(g1[0]-g0[1]);
149 result[1] = normal[0]*(g0[2]-g1[0])+normal[2]*(g2[1]-g1[2]);
150 result[2] = normal[1]*(g1[0]-g2[1])+normal[0]*(g0[2]-g2[0]);
173 const double factor = 1.)
190 const unsigned int d_max = (dim==2) ? 1 : dim;
194 const double dx = factor * fe.
JxW(k);
195 for (
unsigned int i=0; i<n_dofs; ++i)
196 for (
unsigned int j=0; j<n_dofs; ++j)
197 for (
unsigned int d=0; d<d_max; ++d)
199 const unsigned int d1 = (d+1)%dim;
200 const unsigned int d2 = (d+2)%dim;
205 M(i,j) += dx * cu * cv;
230 unsigned int t_comp = (dim==3) ? dim : 1;
238 const unsigned int d_max = (dim==2) ? 1 : dim;
242 const double dx = fe.
JxW(k) * factor;
243 for (
unsigned int i=0; i<t_dofs; ++i)
244 for (
unsigned int j=0; j<n_dofs; ++j)
245 for (
unsigned int d=0; d<d_max; ++d)
247 const unsigned int d1 = (d+1)%dim;
248 const unsigned int d2 = (d+2)%dim;
252 M(i,j) += dx * cu * vv;
298 const unsigned int d_max = (dim==2) ? 1 : dim;
302 const double dx = factor * fe.
JxW(k);
304 for (
unsigned int i=0; i<n_dofs; ++i)
305 for (
unsigned int j=0; j<n_dofs; ++j)
306 for (
unsigned int d=0; d<d_max; ++d)
308 const unsigned int d1 = (d+1)%dim;
309 const unsigned int d2 = (d+2)%dim;
316 M(i,j) += dx*(2.*penalty*u*v - cv*u - cu*v);
353 const unsigned int d_max = (dim==2) ? 1 : dim;
357 const double dx = factor * fe.
JxW(k);
359 for (
unsigned int i=0; i<n_dofs; ++i)
360 for (
unsigned int j=0; j<n_dofs; ++j)
361 for (
unsigned int d=0; d<d_max; ++d)
363 const unsigned int d1 = (d+1)%dim;
364 const unsigned int d2 = (d+2)%dim;
399 const double factor1 = 1.,
400 const double factor2 = -1.)
415 const double nu1 = factor1;
416 const double nu2 = (factor2 < 0) ? factor1 : factor2;
417 const double penalty = .5 * pen * (nu1 + nu2);
429 const unsigned int d_max = (dim==2) ? 1 : dim;
433 const double dx = fe1.
JxW(k);
435 for (
unsigned int i=0; i<n_dofs; ++i)
436 for (
unsigned int j=0; j<n_dofs; ++j)
437 for (
unsigned int d=0; d<d_max; ++d)
439 const unsigned int d1 = (d+1)%dim;
440 const unsigned int d2 = (d+2)%dim;
453 M11(i,j) += .5*dx*(2.*penalty*u1*v1 - cv1*u1 - cu1*v1);
454 M12(i,j) += .5*dx*(2.*penalty*v1*u2 - cv1*u2 - cu2*v1);
455 M21(i,j) += .5*dx*(2.*penalty*u1*v2 - cv2*u1 - cu1*v2);
456 M22(i,j) += .5*dx*(2.*penalty*u2*v2 - cv2*u2 - cu2*v2);
466 DEAL_II_NAMESPACE_CLOSE
#define AssertDimension(dim1, dim2)
const unsigned int n_quadrature_points
const unsigned int dofs_per_cell
Tensor< 1, dim > curl_curl(const Tensor< 2, dim > &h0, const Tensor< 2, dim > &h1, const Tensor< 2, dim > &h2)
Tensor< 1, dim > tangential_curl(const Tensor< 1, dim > &g0, const Tensor< 1, dim > &g1, const Tensor< 1, dim > &g2, const Tensor< 1, dim > &normal)
void tangential_trace_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double factor=1.)
const FiniteElement< dim, spacedim > & get_fe() const
void curl_curl_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const double factor=1.)
#define Assert(cond, exc)
double shape_value_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
void curl_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, const FEValuesBase< dim > &fetest, double factor=1.)
const Point< spacedim > & normal_vector(const unsigned int i) const
unsigned int n_components() const
void ip_curl_matrix(FullMatrix< double > &M11, FullMatrix< double > &M12, FullMatrix< double > &M21, FullMatrix< double > &M22, const FEValuesBase< dim > &fe1, const FEValuesBase< dim > &fe2, const double pen, const double factor1=1., const double factor2=-1.)
double JxW(const unsigned int quadrature_point) const
::ExceptionBase & ExcNotImplemented()
Tensor< 1, spacedim > shape_grad_component(const unsigned int function_no, const unsigned int point_no, const unsigned int component) const
void nitsche_curl_matrix(FullMatrix< double > &M, const FEValuesBase< dim > &fe, double penalty, double factor=1.)