PoissonElementWithSingularity< BASIC_POISSON_ELEMENT > Class Template Reference

#include <poisson_elements_with_singularity.h>

+ Inheritance diagram for PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >:

Public Member Functions

 PoissonElementWithSingularity ()
 Constructor. More...
 
void impose_dirichlet_bc_on_node (const unsigned &j)
 
void undo_dirichlet_bc_on_node (const unsigned &j)
 Undo Dirichlet BCs on jth node. More...
 
void undo_dirichlet_bc_on_all_nodes ()
 Undo Dirichlet BCs on all nodes. More...
 
void set_dirichlet_value_on_node (const unsigned &j, const double &value)
 Specify Dirichlet boundary value for j-th local node. More...
 
Vector< SingularPoissonSolutionElement< PoissonElementWithSingularity< BASIC_POISSON_ELEMENT > > * > c_equation_elements_pt ()
 
void add_c_equation_element_pt (SingularPoissonSolutionElement< PoissonElementWithSingularity< BASIC_POISSON_ELEMENT > > *c_pt)
 
double u_bar (const unsigned &i, const Vector< double > &x) const
 
double singular_function (const unsigned &i, const Vector< double > &x) const
 Evaluate i-th "raw" singular function at Eulerian position x. More...
 
Vector< doublegrad_u_bar (const unsigned i, const Vector< double > &x) const
 
Vector< doublegrad_singular_function (const unsigned &i, const Vector< double > &x) const
 Evaluate the gradient of the i-th "raw" singular at Eulerian position x. More...
 
double interpolated_u_poisson_fe_only (const Vector< double > &s) const
 
double interpolated_u_poisson (const Vector< double > &s) const
 Overloaded version including the singular contributions. 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)
 
void output (std::ostream &outfile, const unsigned &nplot)
 Overloaded output fct: x, y [,z], u, u_fe_only, u-u_fe_only. More...
 
void compute_error (std::ostream &outfile, FiniteElement::SteadyExactSolutionFctPt exact_soln_pt, double &error, double &norm)
 Compute error. More...
 

Private Member Functions

void fill_in_generic_residual_contribution_wrapped_poisson (Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
 Overloaded fill-in function. More...
 

Private Attributes

Vector< SingularPoissonSolutionElement< PoissonElementWithSingularity< BASIC_POISSON_ELEMENT > > * > C_equation_elements_pt
 Vector of pointers to SingularPoissonSolutionElement objects. More...
 
vector< boolNode_is_subject_to_dirichlet_bc
 
Vector< doubleImposed_value_at_node
 

Detailed Description

template<class BASIC_POISSON_ELEMENT>
class PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >

///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////// Templated wrapper to add handling of singularities to the underlying Poisson element (specified via the template argument). Slightly inefficient because the integration loop is repeated here. The only alternative is to add the additional functionality into the Poisson elements. Not pretty either!

Dirichlet BCs are applied in hijacking manner and must be imposed from each element that shares a boundary node that is subject to a Dirichlet condition.

Constructor & Destructor Documentation

◆ PoissonElementWithSingularity()

template<class BASIC_POISSON_ELEMENT >
PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::PoissonElementWithSingularity ( )
inline

Constructor.

332  {
333  // Find the number of nodes in the element
334  unsigned n_node = this->nnode();
335 
336  // Initialise the vector of booleans indicating which
337  // node is subject to Dirichlet BC. The size of the
338  // vector is equal to the number
339  // of nodes in the element. By default, no node is subject
340  // to Dirichlet BC, so the vector is full of false.
341  Node_is_subject_to_dirichlet_bc.resize(n_node);
342  for (unsigned j=0;j<n_node;j++)
343  {
345  }
346 
347  // Initialise the vector of imposed values on the nodes subject
348  // to Dirichlet BC. The size of the vector is equal to the number
349  // of nodes in the element. If a node is not subject to Dirichlet
350  // BC, its imposed value is zero. By default, no node is subject
351  // to Dirichlet BC so the vector is full of zeros
352  Imposed_value_at_node.resize(n_node);
353  for (unsigned j=0;j<n_node;j++)
354  {
355  Imposed_value_at_node[j] = 0.0;
356  }
357 
358  } // End of constructor
vector< bool > Node_is_subject_to_dirichlet_bc
Definition: poisson_elements_with_singularity.h:894
Vector< double > Imposed_value_at_node
Definition: poisson_elements_with_singularity.h:898
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::Imposed_value_at_node, j, and PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::Node_is_subject_to_dirichlet_bc.

Member Function Documentation

◆ add_c_equation_element_pt()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::add_c_equation_element_pt ( SingularPoissonSolutionElement< PoissonElementWithSingularity< BASIC_POISSON_ELEMENT > > *  c_pt)
inline

Add pointer to associated SingularPoissonSolutionElement that determines the value of the amplitude of the singular function (and gives access to the singular function). The unknown amplitude becomes external Data for this element so assign_eqn_numbers() must be called after this function has been called.

411  {
412  // Add the element
413  C_equation_elements_pt.push_back(c_pt);
414 
415  // Add the additional unknown of this object as external data in the
416  // Poisson element
417  this->add_external_data(c_pt->internal_data_pt(0));
418  }
Vector< SingularPoissonSolutionElement< PoissonElementWithSingularity< BASIC_POISSON_ELEMENT > > * > C_equation_elements_pt
Vector of pointers to SingularPoissonSolutionElement objects.
Definition: poisson_elements_with_singularity.h:890

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::C_equation_elements_pt.

◆ c_equation_elements_pt()

template<class BASIC_POISSON_ELEMENT >
Vector<SingularPoissonSolutionElement<PoissonElementWithSingularity <BASIC_POISSON_ELEMENT> >*> PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::c_equation_elements_pt ( )
inline

Access function to pointer of vector of SingularPoissonSolutionElements. These specify the singular functions that are added to the (regular) FE solution

398  {
399  return C_equation_elements_pt;
400  }

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::C_equation_elements_pt.

◆ compute_error()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::compute_error ( std::ostream &  outfile,
FiniteElement::SteadyExactSolutionFctPt  exact_soln_pt,
double error,
double norm 
)
inline

Compute error.

583  {
584 
585  // Initialise
586  error=0.0;
587  norm=0.0;
588 
589  // Find the dimension of the problem
590  unsigned cached_dim = this->dim();
591 
592  //Vector of local coordinates
593  Vector<double> s(cached_dim);
594 
595  // Vector for coordintes
596  Vector<double> x(cached_dim);
597 
598  //Find out how many nodes there are in the element
599  unsigned n_node = this->nnode();
600 
601  Shape psi(n_node);
602 
603  //Set the value of n_intpt
604  unsigned n_intpt = this->integral_pt()->nweight();
605 
606  // Tecplot
607  outfile << "ZONE" << std::endl;
608 
609  // Exact solution Vector (here a scalar)
610  Vector<double> exact_soln(1);
611 
612  //Loop over the integration points
613  for(unsigned ipt=0;ipt<n_intpt;ipt++)
614  {
615 
616  //Assign values of s
617  for(unsigned i=0;i<cached_dim;i++)
618  {
619  s[i] = this->integral_pt()->knot(ipt,i);
620  }
621 
622  //Get the integral weight
623  double w = this->integral_pt()->weight(ipt);
624 
625  // Get jacobian of mapping
626  double J=this->J_eulerian(s);
627 
628  //Premultiply the weights and the Jacobian
629  double W = w*J;
630 
631  // Get x position as Vector
632  this->interpolated_x(s,x);
633 
634  // Get FE function value
635  double u_fe=interpolated_u_poisson(s);
636 
637  // Get exact solution at this point
638  (*exact_soln_pt)(x,exact_soln);
639 
640  //Output x,y,...,error
641  for(unsigned i=0;i<cached_dim;i++)
642  {
643  outfile << x[i] << " ";
644  }
645  outfile << exact_soln[0] << " " << exact_soln[0]-u_fe << std::endl;
646 
647  // Add to error and norm
648  norm+=exact_soln[0]*exact_soln[0]*W;
649  error+=(exact_soln[0]-u_fe)*(exact_soln[0]-u_fe)*W;
650  }
651  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
RowVector3d w
Definition: Matrix_resize_int.cpp:3
double interpolated_u_poisson(const Vector< double > &s) const
Overloaded version including the singular contributions.
Definition: poisson_elements_with_singularity.h:478
RealScalar s
Definition: level1_cplx_impl.h:130
void exact_soln(const double &time, const Vector< double > &x, Vector< double > &soln)
Definition: unstructured_two_d_curved.cc:301
int error
Definition: calibrate.py:297
@ W
Definition: quadtree.h:63
list x
Definition: plotDoE.py:28

References calibrate::error, ProblemParameters::exact_soln(), i, PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::interpolated_u_poisson(), J, s, w, oomph::QuadTreeNames::W, and plotDoE::x.

◆ fill_in_contribution_to_jacobian()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_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)

534  {
535  //Call the generic routine with the flag set to 1
537  }
void fill_in_generic_residual_contribution_wrapped_poisson(Vector< double > &residuals, DenseMatrix< double > &jacobian, const unsigned &flag)
Overloaded fill-in function.
Definition: poisson_elements_with_singularity.h:657

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_generic_residual_contribution_wrapped_poisson().

◆ fill_in_contribution_to_residuals()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_contribution_to_residuals ( Vector< double > &  residuals)
inline

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

523  {
524  //Call the generic residuals function with flag set to 0
525  //using a dummy matrix argument
527  residuals,GeneralisedElement::Dummy_matrix,0);
528  }

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_generic_residual_contribution_wrapped_poisson().

◆ fill_in_generic_residual_contribution_wrapped_poisson()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_generic_residual_contribution_wrapped_poisson ( Vector< double > &  residuals,
DenseMatrix< double > &  jacobian,
const unsigned flag 
)
inlineprivate

Overloaded fill-in function.

661  {
662  // Get the contribution from the underlying wrapped element first
663  BASIC_POISSON_ELEMENT::fill_in_generic_residual_contribution_poisson
664  (residuals,jacobian,flag);
665 
666  // Do all the singular functions satisfy laplace's eqn?
667  bool all_singular_functions_satisfy_laplace_equation=true;
668 
669  // Find the number of singularities
670  unsigned n_sing = C_equation_elements_pt.size();
671 
672  //Index at which the poisson unknown is stored
673  const unsigned u_nodal_index = this->u_index_poisson();
674 
675  // Find the dimension of the problem
676  unsigned cached_dim=this->dim();
677 
678  //Find out how many nodes there are
679  const unsigned n_node = this->nnode();
680 
681  // Find the local equation number of the additional unknowns
682  Vector<int> local_equation_number_C(n_sing);
683  for (unsigned i=0;i<n_sing;i++)
684  {
685  local_equation_number_C[i] =
686  this->external_local_eqn(i,0);
687  if (!(C_equation_elements_pt[i]->
688  singular_function_satisfies_laplace_equation()))
689  {
690  all_singular_functions_satisfy_laplace_equation=false;
691  }
692  }
693 
694  // Do we need to add the singular function's contribution to the
695  // residuals or do they vanish by themselves (mathematically)
696  if (!all_singular_functions_satisfy_laplace_equation)
697  {
698 
699  //Set up memory for the shape and test functions
700  Shape psi(n_node), test(n_node);
701  DShape dpsidx(n_node,cached_dim), dtestdx(n_node,cached_dim);
702 
703  //Set the value of n_intpt
704  const unsigned n_intpt = this->integral_pt()->nweight();
705 
706  //Integers to store the local equation and unknown numbers
707  int local_eqn=0;
708 
709  //Loop over the integration points
710  for(unsigned ipt=0;ipt<n_intpt;ipt++)
711 
712  {
713  //Get the integral weight
714  double w = this->integral_pt()->weight(ipt);
715 
716  //Call the derivatives of the shape and test functions
717  double J = this->dshape_and_dtest_eulerian_at_knot_poisson(ipt,psi,dpsidx,
718  test,dtestdx);
719 
720  //Premultiply the weights and the Jacobian
721  double W = w*J;
722 
723  //Calculate the global coordinate of the integration point
724  Vector<double> interpolated_x(cached_dim,0.0);
725  // Loop over nodes
726  for(unsigned l=0;l<n_node;l++)
727  {
728  // Loop over directions
729  for(unsigned j=0;j<cached_dim;j++)
730  {
731  interpolated_x[j] += this->raw_nodal_position(l,j)*psi(l);
732  }
733  }
734 
735  // Precompute singular fcts
736  Vector<Vector<double> > grad_u_bar_local(n_sing);
737  for (unsigned i=0;i<n_sing;i++)
738  {
739  grad_u_bar_local[i]=grad_u_bar(i,interpolated_x);
740  }
741  Vector<Vector<double> > grad_singular_function_local(n_sing);
742  for (unsigned i=0;i<n_sing;i++)
743  {
744  grad_singular_function_local[i]=grad_singular_function(i,interpolated_x);
745  }
746 
747  // Assemble residuals and Jacobian
748  //--------------------------------
749 
750  // The interior nodes
751  //-------------------
752 
753  // Loop over the test functions
754  for(unsigned l=0;l<n_node;l++)
755  {
756  //Get the local equation number
757  local_eqn = this->nodal_local_eqn(l,u_nodal_index);
758 
759  // If it is not pinned
760  if (local_eqn >= 0)
761  {
762  // IF it's not a boundary condition
764  {
765  // Add the contribution of the additional unknowns to the residual
766  for(unsigned i=0;i<n_sing;i++)
767  {
768  if (!(C_equation_elements_pt[i]->
769  singular_function_satisfies_laplace_equation()))
770  {
771  for (unsigned k=0;k<cached_dim;k++)
772  {
773  residuals[local_eqn] +=
774  grad_u_bar_local[i][k]*dtestdx(l,k)*W;
775  }
776  }
777  }
778 
779  // Calculate the jacobian
780  //-----------------------
781  if(flag)
782  {
783  // Loop over the singularities and add the
784  // contributions of the additional
785  // unknowns associated with them to the
786  // jacobian if they are not pinned
787  for (unsigned i=0;i<n_sing;i++)
788  {
789  if (!(C_equation_elements_pt[i]->
790  singular_function_satisfies_laplace_equation()))
791  {
792  if (local_equation_number_C[i]>=0)
793  {
794  for(unsigned d=0;d<cached_dim;d++)
795  {
796  jacobian(local_eqn,local_equation_number_C[i])
797  += grad_singular_function_local[i][d]*
798  dtestdx(l,d)*W;
799  }
800  }
801  }
802  }
803  }
804  }
805  }
806  } // end of loop over shape functions
807 
808  } // End of loop over integration points
809 
810  }
811 
812  // The Dirichlet nodes
813  //--------------------
814 
815  // Loop over the nodes to see if there is a node subject to
816  // Dirichlet BC
817  for (unsigned j=0;j<n_node;j++)
818  {
819  // If it is a dirichlet boundary condition
821  {
822  // Find the global coordinate of the node
823  Vector<double> global_coordinate_boundary_node(cached_dim);
824  for (unsigned d=0;d<cached_dim;d++)
825  {
826  global_coordinate_boundary_node[d] = this->raw_nodal_position(j,d);
827  }
828 
829  // If it is not pinned
830  int local_eqn_number_boundary_node =
831  this->nodal_local_eqn(j,u_nodal_index);
832  if (local_eqn_number_boundary_node >= 0)
833  {
834  // Add the contribution of the node unknown to the residual
835  residuals[local_eqn_number_boundary_node] =
836  this->raw_nodal_value(j,u_nodal_index);
837 
838  // Add the contribution of the additional unknowns to the residual
839  for (unsigned i=0;i<n_sing;i++)
840  {
841  residuals[local_eqn_number_boundary_node] +=
842  u_bar(i,global_coordinate_boundary_node);
843  }
844 
845  // Substract the value imposed by the Dirichlet BC from the residual
846  residuals[local_eqn_number_boundary_node] -= Imposed_value_at_node[j];
847 
848  if (flag)
849  {
850  // Loop over the nodes
851  for (unsigned l=0;l<n_node;l++)
852  {
853  // Find the equation number of the node
854  int local_unknown = this->nodal_local_eqn(l,u_nodal_index);
855 
856  // If it is not pinned
857  if (local_unknown >=0)
858  {
859  // Put to 0 the corresponding jacobian component
860  jacobian(local_eqn_number_boundary_node,local_unknown)=0.0;
861  }
862  }
863 
864  // Find the contribution of the node to the local jacobian
865  jacobian(local_eqn_number_boundary_node,
866  local_eqn_number_boundary_node) += 1.0;
867 
868  // Loop over the singularities
869  for (unsigned i=0;i<n_sing;i++)
870  {
871  // Find the contribution of the additional unknowns to the jacobian
872  int local_unknown=local_equation_number_C[i];
873  if (local_unknown>=0)
874  {
875  jacobian(local_eqn_number_boundary_node,
876  local_unknown) +=
877  singular_function(i,global_coordinate_boundary_node);
878  }
879  }
880 
881  }
882  } // End of check of the pin status of the node
883  } // End of check if the node is subject to Dirichlet BC-
884  } // End of loop over the nodes
885  } // End of function
double singular_function(const unsigned &i, const Vector< double > &x) const
Evaluate i-th "raw" singular function at Eulerian position x.
Definition: poisson_elements_with_singularity.h:428
Vector< double > grad_u_bar(const unsigned i, const Vector< double > &x) const
Definition: poisson_elements_with_singularity.h:435
double u_bar(const unsigned &i, const Vector< double > &x) const
Definition: poisson_elements_with_singularity.h:422
Vector< double > grad_singular_function(const unsigned &i, const Vector< double > &x) const
Evaluate the gradient of the i-th "raw" singular at Eulerian position x.
Definition: poisson_elements_with_singularity.h:441
char char char int int * k
Definition: level2_impl.h:374
squared absolute sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2 sa Eigen::abs2 DOXCOMMA Eigen::pow DOXCOMMA ArrayBase::square nearest sa Eigen::floor DOXCOMMA Eigen::ceil DOXCOMMA ArrayBase::round nearest integer not less than the given sa Eigen::floor DOXCOMMA ArrayBase::ceil not a number test
Definition: GlobalFunctions.h:109
Definition: indexed_view.cpp:20

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::C_equation_elements_pt, PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::grad_singular_function(), PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::grad_u_bar(), i, PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::Imposed_value_at_node, J, j, k, PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::Node_is_subject_to_dirichlet_bc, PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::singular_function(), Eigen::test, PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::u_bar(), w, and oomph::QuadTreeNames::W.

Referenced by PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_contribution_to_jacobian(), and PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_contribution_to_residuals().

◆ grad_singular_function()

template<class BASIC_POISSON_ELEMENT >
Vector<double> PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::grad_singular_function ( const unsigned i,
const Vector< double > &  x 
) const
inline

Evaluate the gradient of the i-th "raw" singular at Eulerian position x.

443  {
444  return C_equation_elements_pt[i]->grad_singular_function(x);
445  }

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::C_equation_elements_pt, i, and plotDoE::x.

Referenced by PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_generic_residual_contribution_wrapped_poisson().

◆ grad_u_bar()

template<class BASIC_POISSON_ELEMENT >
Vector<double> PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::grad_u_bar ( const unsigned  i,
const Vector< double > &  x 
) const
inline

Evaluate the gradient the i-th singular (incl. the amplitude ) at Eulerian position x

436  {
437  return C_equation_elements_pt[i]->grad_u_bar(x);
438  }

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::C_equation_elements_pt, i, and plotDoE::x.

Referenced by PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_generic_residual_contribution_wrapped_poisson().

◆ impose_dirichlet_bc_on_node()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::impose_dirichlet_bc_on_node ( const unsigned j)
inline

Impose Dirichlet BC on sum of FE solution and u_bar on j-th local node

364  {
366  }

References j, and PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::Node_is_subject_to_dirichlet_bc.

◆ interpolated_u_poisson()

template<class BASIC_POISSON_ELEMENT >
double PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::interpolated_u_poisson ( const Vector< double > &  s) const
inline

Overloaded version including the singular contributions.

479  {
480  //Find number of nodes
481  const unsigned n_node = this->nnode();
482 
483  //Get the index at which the poisson unknown is stored
484  const unsigned u_nodal_index = this->u_index_poisson();
485 
486  //Local shape function
487  Shape psi(n_node);
488 
489  //Find values of shape function
490  this->shape(s,psi);
491 
492  //Initialise value of u
493  double interpolated_u = 0.0;
494 
495  // Calculate the global coordinate associated to s
496  unsigned cached_dim=this->dim();
497  Vector<double> x(cached_dim,0.0);
498 
499  // Add the contribution of u_FE
500  //Loop over the local nodes and sum
501  for(unsigned l=0;l<n_node;l++)
502  {
503  interpolated_u += this->nodal_value(l,u_nodal_index)*psi[l];
504  for (unsigned i=0;i<cached_dim;i++)
505  {
506  x[i]+=this->raw_nodal_position(l,i)*psi(l);
507  }
508  }
509 
510  // Loop over the singularities
511  unsigned n_sing=C_equation_elements_pt.size();
512  for (unsigned i=0;i<n_sing;i++)
513  {
514  // Add the contribution of ubari
515  interpolated_u += u_bar(i,x);
516  }
517 
518  return(interpolated_u);
519  }
void shape(const double &s, double *Psi)
Definition: shape.h:564

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::C_equation_elements_pt, i, oomph::OneDimLagrange::shape(), PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::u_bar(), and plotDoE::x.

Referenced by PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::compute_error(), and PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::output().

◆ interpolated_u_poisson_fe_only()

template<class BASIC_POISSON_ELEMENT >
double PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::interpolated_u_poisson_fe_only ( const Vector< double > &  s) const
inline

Return FE representation of solution WITHOUT singular contributions at local coordinate s

451  {
452  //Find number of nodes
453  const unsigned n_node = this->nnode();
454 
455  //Get the index at which the poisson unknown is stored
456  const unsigned u_nodal_index = this->u_index_poisson();
457 
458  //Local shape function
459  Shape psi(n_node);
460 
461  //Find values of shape function
462  this->shape(s,psi);
463 
464  //Initialise value of u
465  double interpolated_u = 0.0;
466 
467  // Add the contribution of u_FE
468  //Loop over the local nodes and sum
469  for(unsigned l=0;l<n_node;l++)
470  {
471  interpolated_u += this->nodal_value(l,u_nodal_index)*psi[l];
472  }
473 
474  return interpolated_u;
475  }

References oomph::OneDimLagrange::shape().

Referenced by PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::output().

◆ output()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::output ( std::ostream &  outfile,
const unsigned nplot 
)
inline

Overloaded output fct: x, y [,z], u, u_fe_only, u-u_fe_only.

542  {
543  // Find the dimension of the problem
544  unsigned cached_dim = this->dim();
545 
546  //Vector of local coordinates
547  Vector<double> s(cached_dim);
548 
549  // Tecplot header info
550  outfile << this->tecplot_zone_string(nplot);
551 
552  // Loop over plot points
553  unsigned num_plot_points=this->nplot_points(nplot);
554  for (unsigned iplot=0;iplot<num_plot_points;iplot++)
555  {
556 
557  // Get local coordinates of plot point
558  this->get_s_plot(iplot,nplot,s);
559 
560  Vector<double> x(cached_dim);
561  for(unsigned i=0;i<cached_dim;i++)
562  {
563  outfile << this->interpolated_x(s,i) << " ";
564  x[i] = this->interpolated_x(s,i);
565  }
566 
567  outfile << interpolated_u_poisson(s) << " "
570  << std::endl;
571 
572  }
573 
574  // Write tecplot footer (e.g. FE connectivity lists)
575  this->write_tecplot_zone_footer(outfile,nplot);
576  }
double interpolated_u_poisson_fe_only(const Vector< double > &s) const
Definition: poisson_elements_with_singularity.h:450

References i, PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::interpolated_u_poisson(), PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::interpolated_u_poisson_fe_only(), s, and plotDoE::x.

◆ set_dirichlet_value_on_node()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::set_dirichlet_value_on_node ( const unsigned j,
const double value 
)
inline

Specify Dirichlet boundary value for j-th local node.

387  {
389  }
squared absolute value
Definition: GlobalFunctions.h:87

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::Imposed_value_at_node, j, and Eigen::value.

◆ singular_function()

template<class BASIC_POISSON_ELEMENT >
double PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::singular_function ( const unsigned i,
const Vector< double > &  x 
) const
inline

Evaluate i-th "raw" singular function at Eulerian position x.

429  {
430  return C_equation_elements_pt[i]->singular_function(x);
431  }

References PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::C_equation_elements_pt, i, and plotDoE::x.

Referenced by PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::fill_in_generic_residual_contribution_wrapped_poisson().

◆ u_bar()

template<class BASIC_POISSON_ELEMENT >
double PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::u_bar ( const unsigned i,
const Vector< double > &  x 
) const
inline

◆ undo_dirichlet_bc_on_all_nodes()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::undo_dirichlet_bc_on_all_nodes ( )
inline

Undo Dirichlet BCs on all nodes.

376  {
377  unsigned n_node = this->nnode();
378  for (unsigned j=0;j<n_node;j++)
379  {
381  }
382  }
void undo_dirichlet_bc_on_node(const unsigned &j)
Undo Dirichlet BCs on jth node.
Definition: poisson_elements_with_singularity.h:369

References j, and PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::undo_dirichlet_bc_on_node().

◆ undo_dirichlet_bc_on_node()

template<class BASIC_POISSON_ELEMENT >
void PoissonElementWithSingularity< BASIC_POISSON_ELEMENT >::undo_dirichlet_bc_on_node ( const unsigned j)
inline

Member Data Documentation

◆ C_equation_elements_pt

◆ Imposed_value_at_node

◆ Node_is_subject_to_dirichlet_bc


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