oomph::SurfaceDerivatives Class Reference

#include <interface_elements.h>

+ Inheritance diagram for oomph::SurfaceDerivatives:

Public Member Functions

 SurfaceDerivatives ()
 

Protected Member Functions

double compute_surface_derivatives (const Shape &psi, const DShape &dpsids, const DenseMatrix< double > &interpolated_t, const Vector< double > &interpolated_x, DShape &surface_gradient, DShape &surface_divergence)
 Fill in the specific surface derivative calculations. More...
 

Detailed Description

Class that establishes the surface derivative functions for SurfaceInterfaceElements (2D surfaces in 3D space) These are defined in a separate class so that they can be used by other interface equation-type classes.

Constructor & Destructor Documentation

◆ SurfaceDerivatives()

oomph::SurfaceDerivatives::SurfaceDerivatives ( )
inline
712 {}

Member Function Documentation

◆ compute_surface_derivatives()

double oomph::SurfaceDerivatives::compute_surface_derivatives ( const Shape psi,
const DShape dpsids,
const DenseMatrix< double > &  interpolated_t,
const Vector< double > &  interpolated_x,
DShape dpsidS,
DShape dpsidS_div 
)
protected

Fill in the specific surface derivative calculations.

Specialise the surface derivatives for 2D surface case.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

854  {
855  const unsigned n_shape = psi.nindex1();
856  const unsigned n_dim = 3;
857 
858  // Calculate the local metric tensor
859  // The dot product of the two tangent vectors
860  double amet[2][2];
861  for (unsigned al = 0; al < 2; al++)
862  {
863  for (unsigned be = 0; be < 2; be++)
864  {
865  // Initialise to zero
866  amet[al][be] = 0.0;
867  // Add the dot product contributions
868  for (unsigned i = 0; i < n_dim; i++)
869  {
870  amet[al][be] += interpolated_t(al, i) * interpolated_t(be, i);
871  }
872  }
873  }
874 
875  // Work out the determinant
876  double det_a = amet[0][0] * amet[1][1] - amet[0][1] * amet[1][0];
877  // Also work out the contravariant metric
878  double aup[2][2];
879  aup[0][0] = amet[1][1] / det_a;
880  aup[0][1] = -amet[0][1] / det_a;
881  aup[1][0] = -amet[1][0] / det_a;
882  aup[1][1] = amet[0][0] / det_a;
883 
884 
885  // Now construct the surface gradient terms
886  for (unsigned l = 0; l < n_shape; l++)
887  {
888  // Do some pre-computation
889  const double dpsi_temp[2] = {
890  aup[0][0] * dpsids(l, 0) + aup[0][1] * dpsids(l, 1),
891  aup[1][0] * dpsids(l, 0) + aup[1][1] * dpsids(l, 1)};
892 
893  for (unsigned i = 0; i < n_dim; i++)
894  {
895  dpsidS(l, i) = dpsi_temp[0] * interpolated_t(0, i) +
896  dpsi_temp[1] * interpolated_t(1, i);
897  }
898  }
899 
900  // The divergence operator is the same
901  dpsidS_div = dpsidS;
902 
903  // Return the jacobian
904  return sqrt(det_a);
905  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References i, oomph::Shape::nindex1(), and sqrt().


The documentation for this class was generated from the following files: