oomph::BrokenCopy Namespace Reference

Functions

void broken_assign (const std::string &class_name)
 Issue error message and terminate execution. More...
 
void broken_copy (const std::string &class_name)
 Issue error message and terminate execution. More...
 

Detailed Description

Namespace for error messages for broken copy constructors and assignment operators

Function Documentation

◆ broken_assign()

void oomph::BrokenCopy::broken_assign ( const std::string &  class_name)

Issue error message and terminate execution.

196  {
197  // Write the error message into a string
198  std::string error_message = "Assignment operator for class\n\n";
199  error_message += class_name;
200  error_message += "\n\n";
201  error_message += "is deliberately broken to avoid the accidental \n";
202  error_message += "use of the inappropriate C++ default.\n";
203  error_message += "If you really need an assignment operator\n";
204  error_message += "for this class, write it yourself...\n";
205 
206  throw OomphLibError(
207  error_message, "broken_assign()", OOMPH_EXCEPTION_LOCATION);
208  }
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61

References OOMPH_EXCEPTION_LOCATION, and oomph::Global_string_for_annotation::string().

Referenced by oomph::CoarseTwoIntoOne< MATRIX >::operator=(), oomph::CoarseTwoPlusTwoPlusOne< MATRIX >::operator=(), oomph::Diagonal< MATRIX >::operator=(), FlatPlate::operator=(), MyIntegral::operator=(), oomph::MyProblem::operator=(), MyStraightLine::operator=(), SimpleLSCPreconditioner::operator=(), oomph::OnePlusFourWithTwoCoarse< MATRIX >::operator=(), oomph::SelfStartingBDF2::operator=(), oomph::SimpleBlockDiagonalPreconditioner< MATRIX >::operator=(), oomph::SimpleOneDofOnly< MATRIX >::operator=(), oomph::SimpleTwoDofOnly< MATRIX >::operator=(), SSP_RungeKutta< ORDER >::operator=(), oomph::TwoPlusOneUpperTriangularPreconditioner< MATRIX >::operator=(), oomph::TwoPlusThree< MATRIX >::operator=(), oomph::TwoPlusThreeUpperTriangular< MATRIX >::operator=(), oomph::TwoPlusThreeUpperTriangularWithOneLevelSubsidiary< MATRIX >::operator=(), oomph::TwoPlusThreeUpperTriangularWithReplace< MATRIX >::operator=(), oomph::TwoPlusThreeUpperTriangularWithTwoLevelSubsidiary< MATRIX >::operator=(), oomph::UpperTriangular< MATRIX >::operator=(), WarpedLine::operator=(), WarpedPlane::operator=(), and oomph::ComplexDampedJacobi< MATRIX >::solve().

◆ broken_copy()

void oomph::BrokenCopy::broken_copy ( const std::string &  class_name)

Issue error message and terminate execution.

213  {
214  // Write the error message into a string
215  std::string error_message = "Copy constructor for class\n\n";
216  error_message += class_name;
217  error_message += "\n\n";
218  error_message += "is deliberately broken to avoid the accidental\n";
219  error_message += "use of the inappropriate C++ default.\n";
220  error_message +=
221  "All function arguments should be passed by reference or\n";
222  error_message +=
223  "constant reference. If you really need a copy constructor\n";
224  error_message += "for this class, write it yourself...\n";
225 
226  throw OomphLibError(
228  }
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and oomph::Global_string_for_annotation::string().

Referenced by BoussinesqPreconditioner::BoussinesqPreconditioner(), oomph::CoarseTwoIntoOne< MATRIX >::CoarseTwoIntoOne(), oomph::CoarseTwoPlusTwoPlusOne< MATRIX >::CoarseTwoPlusTwoPlusOne(), DependentPositionPointElement::DependentPositionPointElement(), oomph::Diagonal< MATRIX >::Diagonal(), FlatPlate::FlatPlate(), oomph::HeatedPenetratorFluxElement< ELEMENT >::HeatedPenetratorFluxElement(), oomph::IMRODEElement::IMRODEElement(), ModalPRefineableQPoissonElement< DIM >::ModalPRefineableQPoissonElement(), oomph::MultiPoissonEquations< DIM, NFIELDS >::MultiPoissonEquations(), MyIntegral::MyIntegral(), oomph::MyProblem::MyProblem(), MyStraightLine::MyStraightLine(), SimpleLSCPreconditioner::NavierStokesSchurComplementPreconditioner(), oomph::NetFluxControlElement< ELEMENT >::NetFluxControlElement(), oomph::OnePlusFourWithTwoCoarse< MATRIX >::OnePlusFourWithTwoCoarse(), oomph::PiecewiseGauss< DIM, NPTS_1D >::PiecewiseGauss(), oomph::PolarStreamfunctionElement::PolarStreamfunctionElement(), oomph::PolarStreamfunctionEquations::PolarStreamfunctionEquations(), oomph::QMultiPoissonElement< DIM, NNODE_1D, NFIELDS >::QMultiPoissonElement(), RefineableModalPoissonEquations< DIM >::RefineableModalPoissonEquations(), oomph::RefineablePolarStreamfunctionElement::RefineablePolarStreamfunctionElement(), oomph::RefineablePolarStreamfunctionEquations::RefineablePolarStreamfunctionEquations(), oomph::SelfStartingBDF2::SelfStartingBDF2(), oomph::SimpleBlockDiagonalPreconditioner< MATRIX >::SimpleBlockDiagonalPreconditioner(), SimpleFSIPreconditioner< MATRIX >::SimpleFSIPreconditioner(), oomph::SimpleOneDofOnly< MATRIX >::SimpleOneDofOnly(), oomph::SimpleTwoDofOnly< MATRIX >::SimpleTwoDofOnly(), SlavePositionPointElement::SlavePositionPointElement(), SSP_RungeKutta< ORDER >::SSP_RungeKutta(), StefanBoltzmannMeltElement< ELEMENT >::StefanBoltzmannMeltElement(), oomph::StefanBoltzmannUnsteadyHeatFluxElement< ELEMENT >::StefanBoltzmannUnsteadyHeatFluxElement(), oomph::THomogenisedLinearElasticityElement< DIM, NNODE_1D >::THomogenisedLinearElasticityElement(), oomph::TwoPlusOneUpperTriangularPreconditioner< MATRIX >::TwoPlusOneUpperTriangularPreconditioner(), oomph::TwoPlusThree< MATRIX >::TwoPlusThree(), oomph::TwoPlusThreeUpperTriangular< MATRIX >::TwoPlusThreeUpperTriangular(), oomph::TwoPlusThreeUpperTriangularWithOneLevelSubsidiary< MATRIX >::TwoPlusThreeUpperTriangularWithOneLevelSubsidiary(), oomph::TwoPlusThreeUpperTriangularWithReplace< MATRIX >::TwoPlusThreeUpperTriangularWithReplace(), oomph::TwoPlusThreeUpperTriangularWithTwoLevelSubsidiary< MATRIX >::TwoPlusThreeUpperTriangularWithTwoLevelSubsidiary(), oomph::UnsteadyHeatFluxPseudoMeltElement< ELEMENT >::UnsteadyHeatFluxPseudoMeltElement(), oomph::UpperTriangular< MATRIX >::UpperTriangular(), WarpedLine::WarpedLine(), and WarpedPlane::WarpedPlane().