oomph::PMLHelmholtzPointSourceElement< ELEMENT > Class Template Reference

Class to impose point source to (wrapped) Helmholtz element. More...

+ Inheritance diagram for oomph::PMLHelmholtzPointSourceElement< ELEMENT >:

Public Member Functions

 PMLHelmholtzPointSourceElement ()
 Constructor. More...
 
 ~PMLHelmholtzPointSourceElement ()
 Destructor (empty) More...
 
void setup (const Vector< double > &s_point_source, const std::complex< double > &magnitude)
 Set local coordinate and magnitude of point source. More...
 
void fill_in_contribution_to_residuals (Vector< double > &residuals)
 Add the element's contribution to its residual vector (wrapper) More...
 
void fill_in_contribution_to_jacobian (Vector< double > &residuals, DenseMatrix< double > &jacobian)
 

Private Member Functions

void fill_in_point_source_contribution_to_residuals (Vector< double > &residuals)
 Add the point source contribution to the residual vector. More...
 

Private Attributes

Vector< doubleS_point_source
 Local coordinates of point at which point source is applied. More...
 
std::complex< doublePoint_source_magnitude
 Magnitude of point source (complex!) More...
 

Detailed Description

template<class ELEMENT>
class oomph::PMLHelmholtzPointSourceElement< ELEMENT >

Class to impose point source to (wrapped) Helmholtz element.

Constructor & Destructor Documentation

◆ PMLHelmholtzPointSourceElement()

template<class ELEMENT >
oomph::PMLHelmholtzPointSourceElement< ELEMENT >::PMLHelmholtzPointSourceElement ( )
inline

Constructor.

236  {
237  // Initialise
238  Point_source_magnitude=std::complex<double>(0.0,0.0);
239  }
std::complex< double > Point_source_magnitude
Magnitude of point source (complex!)
Definition: oscillating_sphere.cc:343

◆ ~PMLHelmholtzPointSourceElement()

template<class ELEMENT >
oomph::PMLHelmholtzPointSourceElement< ELEMENT >::~PMLHelmholtzPointSourceElement ( )
inline

Destructor (empty)

242 {}

Member Function Documentation

◆ fill_in_contribution_to_jacobian()

template<class ELEMENT >
void oomph::PMLHelmholtzPointSourceElement< ELEMENT >::fill_in_contribution_to_jacobian ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian 
)
inline

Add the element's contribution to its residual vector and element Jacobian matrix (wrapper)

270  {
271  //Call the generic routine with the flag set to 1
272  ELEMENT::fill_in_generic_residual_contribution_pml_fourier_decomposed_helmholtz(residuals,
273  jacobian,1);
274 
275  // Add point source contribution
277  }
void fill_in_point_source_contribution_to_residuals(Vector< double > &residuals)
Add the point source contribution to the residual vector.
Definition: oscillating_sphere.cc:284

◆ fill_in_contribution_to_residuals()

template<class ELEMENT >
void oomph::PMLHelmholtzPointSourceElement< ELEMENT >::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inline

Add the element's contribution to its residual vector (wrapper)

255  {
256  //Call the generic residuals function with flag set to 0
257  //using a dummy matrix argument
258  ELEMENT::fill_in_generic_residual_contribution_pml_fourier_decomposed_helmholtz(
260 
261  // Add point source contribution
263  }
static DenseMatrix< double > Dummy_matrix
Definition: elements.h:227

References oomph::GeneralisedElement::Dummy_matrix.

◆ fill_in_point_source_contribution_to_residuals()

template<class ELEMENT >
void oomph::PMLHelmholtzPointSourceElement< ELEMENT >::fill_in_point_source_contribution_to_residuals ( Vector< double > &  residuals)
inlineprivate

Add the point source contribution to the residual vector.

285  {
286  // No further action
287  if (S_point_source.size()==0) return;
288 
289  //Find out how many nodes there are
290  const unsigned n_node = this->nnode();
291 
292  //Set up memory for the shape/test functions
293  Shape psi(n_node);
294 
295  //Integers to store the local equation and unknown numbers
296  int local_eqn_real=0;
297  int local_eqn_imag=0;
298 
299  // Get shape/test fcts
300  this->shape(S_point_source,psi);
301 
302  // Assemble residuals
303  //--------------------------------
304 
305  // Loop over the test functions
306  for(unsigned l=0;l<n_node;l++)
307  {
308  // first, compute the real part contribution
309  //-------------------------------------------
310 
311  //Get the local equation
312  local_eqn_real =
313  this->nodal_local_eqn
314  (l,this->u_index_pml_fourier_decomposed_helmholtz().real());
315 
316  /*IF it's not a boundary condition*/
317  if(local_eqn_real >= 0)
318  {
319  residuals[local_eqn_real] -= 2.0*Point_source_magnitude.real()*psi(l);
320  }
321 
322  // Second, compute the imaginary part contribution
323  //------------------------------------------------
324 
325  //Get the local equation
326  local_eqn_imag =
327  this->nodal_local_eqn
328  (l,this->u_index_pml_fourier_decomposed_helmholtz().imag());
329 
330  /*IF it's not a boundary condition*/
331  if(local_eqn_imag >= 0)
332  {
333  // Add body force/source term and Helmholtz bit
334  residuals[local_eqn_imag] -= 2.0*Point_source_magnitude.imag()*psi(l);
335  }
336  }
337  }
AnnoyingScalar imag(const AnnoyingScalar &)
Definition: AnnoyingScalar.h:132
Vector< double > S_point_source
Local coordinates of point at which point source is applied.
Definition: oscillating_sphere.cc:340
Definition: shape.h:76
float real
Definition: datatypes.h:10
void shape(const double &s, double *Psi)
Definition: shape.h:564

References imag(), and oomph::OneDimLagrange::shape().

◆ setup()

template<class ELEMENT >
void oomph::PMLHelmholtzPointSourceElement< ELEMENT >::setup ( const Vector< double > &  s_point_source,
const std::complex< double > &  magnitude 
)
inline

Set local coordinate and magnitude of point source.

247  {
248  S_point_source=s_point_source;
250  }
double magnitude(const Vector< double > &a)
Get the magnitude of a vector.
Definition: oomph-lib/src/generic/Vector.h:303

References oomph::VectorHelpers::magnitude().

Member Data Documentation

◆ Point_source_magnitude

template<class ELEMENT >
std::complex<double> oomph::PMLHelmholtzPointSourceElement< ELEMENT >::Point_source_magnitude
private

Magnitude of point source (complex!)

◆ S_point_source

template<class ELEMENT >
Vector<double> oomph::PMLHelmholtzPointSourceElement< ELEMENT >::S_point_source
private

Local coordinates of point at which point source is applied.


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