oomph::HelmholtzPointSourceElement< ELEMENT > Class Template Reference

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

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

Public Member Functions

 HelmholtzPointSourceElement ()
 Constructor. More...
 
 ~HelmholtzPointSourceElement ()
 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::HelmholtzPointSourceElement< ELEMENT >

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

Constructor & Destructor Documentation

◆ HelmholtzPointSourceElement()

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

Constructor.

96  {
97  // Initialise
98  Point_source_magnitude=std::complex<double>(0.0,0.0);
99  }
std::complex< double > Point_source_magnitude
Magnitude of point source (complex!)
Definition: helmholtz_point_source.cc:202

◆ ~HelmholtzPointSourceElement()

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

Destructor (empty)

102 {}

Member Function Documentation

◆ fill_in_contribution_to_jacobian()

template<class ELEMENT >
void oomph::HelmholtzPointSourceElement< 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)

131  {
132  //Call the generic routine with the flag set to 1
133  ELEMENT::fill_in_generic_residual_contribution_helmholtz(residuals,
134  jacobian,1);
135 
136  // Add point source contribution
138  }
void fill_in_point_source_contribution_to_residuals(Vector< double > &residuals)
Add the point source contribution to the residual vector.
Definition: helmholtz_point_source.cc:146

◆ fill_in_contribution_to_residuals()

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

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

115  {
116  //Call the generic residuals function with flag set to 0
117  //using a dummy matrix argument
118  ELEMENT::fill_in_generic_residual_contribution_helmholtz(
120 
121  // Add point source contribution
123  }
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::HelmholtzPointSourceElement< ELEMENT >::fill_in_point_source_contribution_to_residuals ( Vector< double > &  residuals)
inlineprivate

Add the point source contribution to the residual vector.

147  {
148  // No further action
149  if (S_point_source.size()==0) return;
150 
151  //Find out how many nodes there are
152  const unsigned n_node = this->nnode();
153 
154  //Set up memory for the shape/test functions
155  Shape psi(n_node);
156 
157  //Integers to store the local equation and unknown numbers
158  int local_eqn_real=0;
159  int local_eqn_imag=0;
160 
161  // Get shape/test fcts
162  this->shape(S_point_source,psi);
163 
164  // Assemble residuals
165  //--------------------------------
166 
167  // Loop over the test functions
168  for(unsigned l=0;l<n_node;l++)
169  {
170  // first, compute the real part contribution
171  //-------------------------------------------
172 
173  //Get the local equation
174  local_eqn_real = this->nodal_local_eqn(l,this->u_index_helmholtz().real());
175 
176  /*IF it's not a boundary condition*/
177  if(local_eqn_real >= 0)
178  {
179  residuals[local_eqn_real] += Point_source_magnitude.real()*psi(l);
180  }
181 
182  // Second, compute the imaginary part contribution
183  //------------------------------------------------
184 
185  //Get the local equation
186  local_eqn_imag = this->nodal_local_eqn(l,this->u_index_helmholtz().imag());
187 
188  /*IF it's not a boundary condition*/
189  if(local_eqn_imag >= 0)
190  {
191  // Add body force/source term and Helmholtz bit
192  residuals[local_eqn_imag] += Point_source_magnitude.imag()*psi(l);
193  }
194  }
195  }
AnnoyingScalar imag(const AnnoyingScalar &)
Definition: AnnoyingScalar.h:132
Vector< double > S_point_source
Local coordinates of point at which point source is applied.
Definition: helmholtz_point_source.cc:199
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::HelmholtzPointSourceElement< ELEMENT >::setup ( const Vector< double > &  s_point_source,
const std::complex< double > &  magnitude 
)
inline

Set local coordinate and magnitude of point source.

107  {
108  S_point_source=s_point_source;
110  }
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::HelmholtzPointSourceElement< ELEMENT >::Point_source_magnitude
private

Magnitude of point source (complex!)

◆ S_point_source

template<class ELEMENT >
Vector<double> oomph::HelmholtzPointSourceElement< 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: