TestProblem Namespace Reference

Namespace for exact solution and problem parameters. More...

Functions

void source (const Vector< double > &x, Vector< double > &f)
 Source function. More...
 
void mass_source (const Vector< double > &x, double &m)
 Mass source. More...
 
void boundary_pressure (const double &time, const Vector< double > &x, const Vector< double > &n, double &result)
 Pressure around the boundary of the domain. More...
 
void exact_soln (const Vector< double > &x, Vector< double > &soln)
 Exact solution: q1,q2,div_q,p. More...
 
template<class ELEMENT >
void edge_sign_setup (Mesh *mesh_pt)
 

Variables

bool Use_point_source_solution =false
 
double Mass_source_strength =1000.0
 Mass source strength. More...
 
double Mass_source_decay_exponent =50.0
 Mass source strength. More...
 
double Element_area =0.01
 Target element area for Triangle. More...
 
std::string Directory ="RESLT"
 The directory in which the solution is output. More...
 

Detailed Description

Namespace for exact solution and problem parameters.

Function Documentation

◆ boundary_pressure()

void TestProblem::boundary_pressure ( const double time,
const Vector< double > &  x,
const Vector< double > &  n,
double result 
)

Pressure around the boundary of the domain.

86  {
88  {
89  result=0.0;
90  }
91  else
92  {
93  result=2*x[0]+3*x[1]-3.0/2.0;
94  }
95  }
bool Use_point_source_solution
Definition: unstructured_two_d_circle.cc:43
list x
Definition: plotDoE.py:28

References Use_point_source_solution, and plotDoE::x.

Referenced by DarcyProblem< ELEMENT >::create_pressure_elements().

◆ edge_sign_setup()

template<class ELEMENT >
void TestProblem::edge_sign_setup ( Mesh mesh_pt)

Global function that completes the edge sign setup – has to be called before projection in unstructured adaptation

136  {
137  // The dictionary keeping track of edge signs
138  std::map<Edge,unsigned> assignments;
139 
140  // Loop over all elements
141  unsigned n_element = mesh_pt->nelement();
142  for(unsigned e=0;e<n_element;e++)
143  {
144  ELEMENT* el_pt = dynamic_cast<ELEMENT*>(mesh_pt->element_pt(e));
145 
146  // Assign edge signs: Loop over the vertex nodes (always
147  // first 3 nodes for triangles)
148  for(unsigned i=0;i<3;i++)
149  {
150  Node *nod_pt1, *nod_pt2;
151  nod_pt1 = el_pt->node_pt(i);
152  nod_pt2 = el_pt->node_pt((i+1)%3);
153  Edge edge(nod_pt1,nod_pt2);
154  unsigned status = assignments[edge];
155 
156  // This relies on the default value for an int being 0 in a map
157  switch(status)
158  {
159  // If not assigned on either side, give it a + on current side
160  case 0:
161  assignments[edge]=1;
162  break;
163  // If assigned + on other side, give it a - on current side
164  case 1:
165  assignments[edge]=2;
166  el_pt->sign_edge(i)=-1;
167  break;
168  // If assigned - on other side, give it a + on current side
169  case 2:
170  assignments[edge]=1;
171  break;
172  }
173  } // end of loop over vertex nodes
174  } // end of loop over elements
175 
176 
177  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Edge class.
Definition: mesh.h:2692
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
Definition: nodes.h:906
void assignments()
Definition: skew_symmetric_matrix3.cpp:38

References anonymous_namespace{skew_symmetric_matrix3.cpp}::assignments(), e(), oomph::Mesh::element_pt(), i, and oomph::Mesh::nelement().

◆ exact_soln()

void TestProblem::exact_soln ( const Vector< double > &  x,
Vector< double > &  soln 
)

Exact solution: q1,q2,div_q,p.

99  {
100 
102  {
103  // q[0]
104  soln[0]=0.0;
105  // q[1]
106  soln[1]=0.0;
107  // div q
108  soln[2]=0.0;
109  // p
110  soln[3]=0.0;
111  }
112  else
113  {
114  // q[0]
115  soln[0]=x[0]*x[1]-x[1]*x[1];
116  // q[1]
117  soln[1]=x[0]+x[0]*x[0]-0.5*x[1]*x[1];
118  // div q
119  soln[2]=0;
120  // p
121  soln[3]=2*x[0]+3*x[1]-3.0/2.0;
122  }
123  }

References Use_point_source_solution, and plotDoE::x.

Referenced by DarcyProblem< ELEMENT >::complete_problem_setup(), and DarcyProblem< ELEMENT >::doc_solution().

◆ mass_source()

void TestProblem::mass_source ( const Vector< double > &  x,
double m 
)

Mass source.

69  {
71  {
72  double r=sqrt(x[0]*x[0]+x[1]*x[1]);
74  }
75  else
76  {
77  m=0.0;
78  }
79  }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int * m
Definition: level2_cplx_impl.h:294
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
double Mass_source_decay_exponent
Mass source strength.
Definition: unstructured_two_d_circle.cc:65
double Mass_source_strength
Mass source strength.
Definition: unstructured_two_d_circle.cc:62
r
Definition: UniformPSDSelfTest.py:20

References Eigen::bfloat16_impl::exp(), m, Mass_source_decay_exponent, Mass_source_strength, UniformPSDSelfTest::r, sqrt(), Use_point_source_solution, and plotDoE::x.

Referenced by DarcyProblem< ELEMENT >::complete_problem_setup().

◆ source()

void TestProblem::source ( const Vector< double > &  x,
Vector< double > &  f 
)

Source function.

47  {
49  {
50  f[0]=0.0;
51  f[1]=0.0;
52  }
53  else
54  {
55  f[0]=x[0]*x[1]-x[1]*x[1]+2;
56  f[1]=x[0]+x[0]*x[0]-0.5*x[1]*x[1]+3;
57  }
58  }
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237

References f(), Use_point_source_solution, and plotDoE::x.

Referenced by ModalPoissonEquations< DIM >::add_generic_residual_contribution(), DarcyProblem< ELEMENT >::complete_problem_setup(), oomph::PoissonEquations< 1 >::compute_error(), c_interface_base< real >::copy_matrix(), c_interface_base< real >::copy_vector(), GelfandBratuElement< NNODE_1D >::fill_in_generic_dresidual_contribution(), oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::fill_in_generic_pressure_advection_diffusion_contribution_nst(), oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< DIM >::fill_in_generic_pressure_advection_diffusion_contribution_nst(), oomph::SpaceTimeNavierStokesEquations< DIM >::fill_in_generic_pressure_advection_diffusion_contribution_nst(), oomph::NavierStokesEquations< DIM >::fill_in_generic_pressure_advection_diffusion_contribution_nst(), oomph::RefineableNavierStokesEquations< DIM >::fill_in_generic_pressure_advection_diffusion_contribution_nst(), GelfandBratuElement< NNODE_1D >::fill_in_generic_residual_contribution(), oomph::AdvectionDiffusionEquations< DIM >::fill_in_generic_residual_contribution_adv_diff(), oomph::RefineableAdvectionDiffusionEquations< DIM >::fill_in_generic_residual_contribution_adv_diff(), oomph::SteadyAxisymAdvectionDiffusionEquations::fill_in_generic_residual_contribution_adv_diff(), oomph::AdvectionDiffusionReactionEquations< NREAGENT, DIM >::fill_in_generic_residual_contribution_adv_diff_react(), oomph::RefineableAdvectionDiffusionReactionEquations< NREAGENT, DIM >::fill_in_generic_residual_contribution_adv_diff_react(), oomph::AxisymAdvectionDiffusionEquations::fill_in_generic_residual_contribution_axi_adv_diff(), oomph::RefineableAxisymAdvectionDiffusionEquations::fill_in_generic_residual_contribution_axi_adv_diff(), oomph::AxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::RefineableAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_axi_nst(), oomph::BiharmonicEquations< DIM >::fill_in_generic_residual_contribution_biharmonic(), oomph::GeneralisedAdvectionDiffusionEquations< DIM >::fill_in_generic_residual_contribution_cons_adv_diff(), oomph::RefineableGeneralisedAdvectionDiffusionEquations< DIM >::fill_in_generic_residual_contribution_cons_adv_diff(), oomph::RefineableGeneralisedAxisymAdvectionDiffusionEquations::fill_in_generic_residual_contribution_cons_axisym_adv_diff(), oomph::FourierDecomposedHelmholtzEquations::fill_in_generic_residual_contribution_fourier_decomposed_helmholtz(), oomph::HelmholtzEquations< DIM >::fill_in_generic_residual_contribution_helmholtz(), oomph::RefineableHelmholtzEquations< DIM >::fill_in_generic_residual_contribution_helmholtz(), oomph::PMLHelmholtzEquations< DIM >::fill_in_generic_residual_contribution_helmholtz(), oomph::RefineablePMLHelmholtzEquations< DIM >::fill_in_generic_residual_contribution_helmholtz(), oomph::LinearisedAxisymmetricNavierStokesEquations::fill_in_generic_residual_contribution_lin_axi_nst(), oomph::LinearWaveEquations< DIM >::fill_in_generic_residual_contribution_lin_wave(), oomph::RefineableLinearWaveEquations< DIM >::fill_in_generic_residual_contribution_lin_wave(), oomph::MultiPoissonEquations< DIM, NFIELDS >::fill_in_generic_residual_contribution_multi_poisson(), oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::RefineableSpaceTimeNavierStokesMixedOrderEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::SpaceTimeNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::NavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::RefineableNavierStokesEquations< DIM >::fill_in_generic_residual_contribution_nst(), oomph::PMLFourierDecomposedHelmholtzEquations::fill_in_generic_residual_contribution_pml_fourier_decomposed_helmholtz(), oomph::PoissonEquations< DIM >::fill_in_generic_residual_contribution_poisson(), oomph::RefineablePoissonEquations< DIM >::fill_in_generic_residual_contribution_poisson(), oomph::RefineableSphericalAdvectionDiffusionEquations::fill_in_generic_residual_contribution_spherical_adv_diff(), oomph::SphericalAdvectionDiffusionEquations::fill_in_generic_residual_contribution_spherical_adv_diff(), oomph::RefineableSpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >::fill_in_generic_residual_contribution_ust_heat(), oomph::SpaceTimeUnsteadyHeatMixedOrderEquations< SPATIAL_DIM >::fill_in_generic_residual_contribution_ust_heat(), oomph::RefineableSpaceTimeUnsteadyHeatMixedOrderEquations< SPATIAL_DIM >::fill_in_generic_residual_contribution_ust_heat(), oomph::RefineableUnsteadyHeatEquations< DIM >::fill_in_generic_residual_contribution_ust_heat(), oomph::UnsteadyHeatEquations< DIM >::fill_in_generic_residual_contribution_ust_heat(), RefineableModalPoissonEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::AxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::RefineableAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::RefineableGeneralisedNewtonianAxisymmetricNavierStokesEquations::get_dresidual_dnodal_coordinates(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::RefineableGeneralisedNewtonianNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::NavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::RefineableNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::PoissonEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::RefineablePoissonEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::SpaceTimeNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates(), oomph::RefineableSpaceTimeNavierStokesEquations< DIM >::get_dresidual_dnodal_coordinates(), TwoNodePoissonElement::get_residuals(), SinSolution::get_source(), ExactSolnForUnsteadyHeat::get_source(), TanhSolnForLinearWave::get_source(), TanhSolnForUnsteadyHeat::get_source(), oomph::BiharmonicEquations< DIM >::get_source(), TanhSolnForPoisson::get_source(), ConstSourceForPoisson::get_source(), ArcTanSolnForPoisson::get_source(), GlobalParameters::get_source(), oomph::AdvectionDiffusionEquations< DIM >::get_source_adv_diff(), oomph::AdvectionDiffusionReactionEquations< NREAGENT, DIM >::get_source_adv_diff_react(), oomph::AxisymAdvectionDiffusionEquations::get_source_axi_adv_diff(), oomph::SteadyAxisymAdvectionDiffusionEquations::get_source_axisym_adv_diff(), oomph::GeneralisedAdvectionDiffusionEquations< DIM >::get_source_cons_adv_diff(), oomph::get_source_cons_axisym_adv_diff(), oomph::AxisymmetricNavierStokesEquations::get_source_fct_gradient(), oomph::GeneralisedNewtonianAxisymmetricNavierStokesEquations::get_source_fct_gradient(), ExactSolution::get_source_for_unsteady_heat_validation(), oomph::FourierDecomposedHelmholtzEquations::get_source_fourier_decomposed_helmholtz(), oomph::LinearisedAxisymmetricNavierStokesEquations::get_source_gradient_base_flow(), oomph::GeneralisedNewtonianNavierStokesEquations< DIM >::get_source_gradient_nst(), oomph::NavierStokesEquations< DIM >::get_source_gradient_nst(), oomph::SpaceTimeNavierStokesEquations< DIM >::get_source_gradient_nst(), oomph::SpaceTimeNavierStokesMixedOrderEquations< DIM >::get_source_gradient_nst(), oomph::PoissonEquations< DIM >::get_source_gradient_poisson(), oomph::HelmholtzEquations< DIM >::get_source_helmholtz(), oomph::PMLHelmholtzEquations< DIM >::get_source_helmholtz(), oomph::LinearWaveEquations< DIM >::get_source_lin_wave(), oomph::MultiPoissonEquations< DIM, NFIELDS >::get_source_multi_poisson(), oomph::PMLFourierDecomposedHelmholtzEquations::get_source_pml_fourier_decomposed_helmholtz(), oomph::PoissonEquations< DIM >::get_source_poisson(), ModalPoissonEquations< DIM >::get_source_poisson(), oomph::SphericalAdvectionDiffusionEquations::get_source_spherical_adv_diff(), oomph::SpaceTimeUnsteadyHeatEquations< SPATIAL_DIM >::get_source_ust_heat(), oomph::SpaceTimeUnsteadyHeatMixedOrderEquations< SPATIAL_DIM >::get_source_ust_heat(), oomph::UnsteadyHeatEquations< DIM >::get_source_ust_heat(), Global_parameters::source_function(), FishSolnOneDPoisson::source_function(), TanhSolnForPoisson::source_function(), ConstSourceForPoisson::source_function(), SolnForPoisson::source_function(), TanhSolnForMultiPoisson::source_function(), oomph::PressureAdvectionDiffusionValidation::source_function(), TanhSolnForAdvectionDiffusion::source_function(), GlobalPhysicalParameters::source_function(), TanhSolnForSteadyAxisymAdvectionDiffusion::source_function(), test_empty_fixed_size_tensor(), and test_empty_tensor().

Variable Documentation

◆ Directory

std::string TestProblem::Directory ="RESLT"

◆ Element_area

double TestProblem::Element_area =0.01

Target element area for Triangle.

Referenced by DarcyProblem< ELEMENT >::DarcyProblem(), DarcyProblem< ELEMENT >::doc_solution(), and main().

◆ Mass_source_decay_exponent

double TestProblem::Mass_source_decay_exponent =50.0

Mass source strength.

Referenced by mass_source().

◆ Mass_source_strength

double TestProblem::Mass_source_strength =1000.0

Mass source strength.

Referenced by mass_source().

◆ Use_point_source_solution

bool TestProblem::Use_point_source_solution =false

Flag to indicate that we want the forced solution a "point source" in the mass flux

Referenced by boundary_pressure(), DarcyProblem< ELEMENT >::DarcyProblem(), exact_soln(), main(), mass_source(), and source().