oomph::ProjectionProblem< PROJECTABLE_ELEMENT > Class Template Reference

#include <projection.h>

+ Inheritance diagram for oomph::ProjectionProblem< PROJECTABLE_ELEMENT >:

Public Member Functions

void enable_suppress_output_during_projection ()
 Suppress all output during projection phases. More...
 
void disable_suppress_output_during_projection ()
 Undo suppression of all output during projection phases. More...
 
bool use_iterative_solver_for_projection ()
 
void enable_use_iterative_solver_for_projection ()
 Enables the use of an iterative solver for projection. More...
 
void disable_use_iterative_solver_for_projection ()
 Disbales the use of an iterative solver for projection. More...
 
void project (Mesh *base_mesh_pt, const bool &dont_project_positions=false)
 Project from base into the problem's own mesh. More...
 
- Public Member Functions inherited from oomph::Problem
virtual void debug_hook_fct (const unsigned &i)
 
void set_analytic_dparameter (double *const &parameter_pt)
 
void unset_analytic_dparameter (double *const &parameter_pt)
 
bool is_dparameter_calculated_analytically (double *const &parameter_pt)
 
void set_analytic_hessian_products ()
 
void unset_analytic_hessian_products ()
 
bool are_hessian_products_calculated_analytically ()
 
void set_pinned_values_to_zero ()
 
bool distributed () const
 
virtual void actions_before_adapt ()
 
virtual void actions_after_adapt ()
 Actions that are to be performed after a mesh adaptation. More...
 
OomphCommunicatorcommunicator_pt ()
 access function to the oomph-lib communicator More...
 
const OomphCommunicatorcommunicator_pt () const
 access function to the oomph-lib communicator, const version More...
 
 Problem ()
 
 Problem (const Problem &dummy)=delete
 Broken copy constructor. More...
 
void operator= (const Problem &)=delete
 Broken assignment operator. More...
 
virtual ~Problem ()
 Virtual destructor to clean up memory. More...
 
Mesh *& mesh_pt ()
 Return a pointer to the global mesh. More...
 
Mesh *const & mesh_pt () const
 Return a pointer to the global mesh (const version) More...
 
Mesh *& mesh_pt (const unsigned &imesh)
 
Mesh *const & mesh_pt (const unsigned &imesh) const
 Return a pointer to the i-th submesh (const version) More...
 
unsigned nsub_mesh () const
 Return number of submeshes. More...
 
unsigned add_sub_mesh (Mesh *const &mesh_pt)
 
void flush_sub_meshes ()
 
void build_global_mesh ()
 
void rebuild_global_mesh ()
 
LinearSolver *& linear_solver_pt ()
 Return a pointer to the linear solver object. More...
 
LinearSolver *const & linear_solver_pt () const
 Return a pointer to the linear solver object (const version) More...
 
LinearSolver *& mass_matrix_solver_for_explicit_timestepper_pt ()
 
LinearSolvermass_matrix_solver_for_explicit_timestepper_pt () const
 
EigenSolver *& eigen_solver_pt ()
 Return a pointer to the eigen solver object. More...
 
EigenSolver *const & eigen_solver_pt () const
 Return a pointer to the eigen solver object (const version) More...
 
Time *& time_pt ()
 Return a pointer to the global time object. More...
 
Timetime_pt () const
 Return a pointer to the global time object (const version). More...
 
doubletime ()
 Return the current value of continuous time. More...
 
double time () const
 Return the current value of continuous time (const version) More...
 
TimeStepper *& time_stepper_pt ()
 
const TimeSteppertime_stepper_pt () const
 
TimeStepper *& time_stepper_pt (const unsigned &i)
 Return a pointer to the i-th timestepper. More...
 
ExplicitTimeStepper *& explicit_time_stepper_pt ()
 Return a pointer to the explicit timestepper. More...
 
unsigned long set_timestepper_for_all_data (TimeStepper *const &time_stepper_pt, const bool &preserve_existing_data=false)
 
virtual void shift_time_values ()
 Shift all values along to prepare for next timestep. More...
 
AssemblyHandler *& assembly_handler_pt ()
 Return a pointer to the assembly handler object. More...
 
AssemblyHandler *const & assembly_handler_pt () const
 Return a pointer to the assembly handler object (const version) More...
 
doubleminimum_dt ()
 Access function to min timestep in adaptive timestepping. More...
 
doublemaximum_dt ()
 Access function to max timestep in adaptive timestepping. More...
 
unsignedmax_newton_iterations ()
 Access function to max Newton iterations before giving up. More...
 
void problem_is_nonlinear (const bool &prob_lin)
 Access function to Problem_is_nonlinear. More...
 
doublemax_residuals ()
 
booltime_adaptive_newton_crash_on_solve_fail ()
 Access function for Time_adaptive_newton_crash_on_solve_fail. More...
 
doublenewton_solver_tolerance ()
 
void add_time_stepper_pt (TimeStepper *const &time_stepper_pt)
 
void set_explicit_time_stepper_pt (ExplicitTimeStepper *const &explicit_time_stepper_pt)
 
void initialise_dt (const double &dt)
 
void initialise_dt (const Vector< double > &dt)
 
Data *& global_data_pt (const unsigned &i)
 Return a pointer to the the i-th global data object. More...
 
void add_global_data (Data *const &global_data_pt)
 
void flush_global_data ()
 
LinearAlgebraDistribution *const & dof_distribution_pt () const
 Return the pointer to the dof distribution (read-only) More...
 
unsigned long ndof () const
 Return the number of dofs. More...
 
unsigned ntime_stepper () const
 Return the number of time steppers. More...
 
unsigned nglobal_data () const
 Return the number of global data values. More...
 
unsigned self_test ()
 Self-test: Check meshes and global data. Return 0 for OK. More...
 
void enable_store_local_dof_pt_in_elements ()
 
void disable_store_local_dof_pt_in_elements ()
 
unsigned long assign_eqn_numbers (const bool &assign_local_eqn_numbers=true)
 
void describe_dofs (std::ostream &out= *(oomph_info.stream_pt())) const
 
void enable_discontinuous_formulation ()
 
void disable_discontinuous_formulation ()
 
void get_dofs (DoubleVector &dofs) const
 
void get_dofs (const unsigned &t, DoubleVector &dofs) const
 Return vector of the t'th history value of all dofs. More...
 
void set_dofs (const DoubleVector &dofs)
 Set the values of the dofs. More...
 
void set_dofs (const unsigned &t, DoubleVector &dofs)
 Set the history values of the dofs. More...
 
void set_dofs (const unsigned &t, Vector< double * > &dof_pt)
 
void add_to_dofs (const double &lambda, const DoubleVector &increment_dofs)
 Add lambda x incremenet_dofs[l] to the l-th dof. More...
 
doubleglobal_dof_pt (const unsigned &i)
 
doubledof (const unsigned &i)
 i-th dof in the problem More...
 
double dof (const unsigned &i) const
 i-th dof in the problem (const version) More...
 
double *& dof_pt (const unsigned &i)
 Pointer to i-th dof in the problem. More...
 
doubledof_pt (const unsigned &i) const
 Pointer to i-th dof in the problem (const version) More...
 
virtual void get_inverse_mass_matrix_times_residuals (DoubleVector &Mres)
 
virtual void get_dvaluesdt (DoubleVector &f)
 
virtual void get_residuals (DoubleVector &residuals)
 Get the total residuals Vector for the problem. More...
 
virtual void get_jacobian (DoubleVector &residuals, DenseDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CRDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, CCDoubleMatrix &jacobian)
 
virtual void get_jacobian (DoubleVector &residuals, SumOfMatrices &jacobian)
 
void get_fd_jacobian (DoubleVector &residuals, DenseMatrix< double > &jacobian)
 Get the full Jacobian by finite differencing. More...
 
void get_derivative_wrt_global_parameter (double *const &parameter_pt, DoubleVector &result)
 
void get_hessian_vector_products (DoubleVectorWithHaloEntries const &Y, Vector< DoubleVectorWithHaloEntries > const &C, Vector< DoubleVectorWithHaloEntries > &product)
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, Vector< DoubleVector > &eigenvector, const bool &steady=true)
 Solve the eigenproblem. More...
 
void solve_eigenproblem (const unsigned &n_eval, Vector< std::complex< double >> &eigenvalue, const bool &steady=true)
 
virtual void get_eigenproblem_matrices (CRDoubleMatrix &mass_matrix, CRDoubleMatrix &main_matrix, const double &shift=0.0)
 
void assign_eigenvector_to_dofs (DoubleVector &eigenvector)
 Assign the eigenvector passed to the function to the dofs. More...
 
void add_eigenvector_to_dofs (const double &epsilon, const DoubleVector &eigenvector)
 
void store_current_dof_values ()
 Store the current values of the degrees of freedom. More...
 
void restore_dof_values ()
 Restore the stored values of the degrees of freedom. More...
 
void enable_jacobian_reuse ()
 
void disable_jacobian_reuse ()
 Disable recycling of Jacobian in Newton iteration. More...
 
bool jacobian_reuse_is_enabled ()
 Is recycling of Jacobian in Newton iteration enabled? More...
 
booluse_predictor_values_as_initial_guess ()
 
void newton_solve ()
 Use Newton method to solve the problem. More...
 
void enable_globally_convergent_newton_method ()
 enable globally convergent Newton method More...
 
void disable_globally_convergent_newton_method ()
 disable globally convergent Newton method More...
 
void newton_solve (unsigned const &max_adapt)
 
void steady_newton_solve (unsigned const &max_adapt=0)
 
void copy (Problem *orig_problem_pt)
 
virtual Problemmake_copy ()
 
virtual void read (std::ifstream &restart_file, bool &unsteady_restart)
 
virtual void read (std::ifstream &restart_file)
 
virtual void dump (std::ofstream &dump_file) const
 
void dump (const std::string &dump_file_name) const
 
void delete_all_external_storage ()
 
virtual void symmetrise_eigenfunction_for_adaptive_pitchfork_tracking ()
 
doublebifurcation_parameter_pt () const
 
void get_bifurcation_eigenfunction (Vector< DoubleVector > &eigenfunction)
 
void activate_fold_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const bool &block_solve=true)
 
void activate_bifurcation_tracking (double *const &parameter_pt, const DoubleVector &eigenvector, const DoubleVector &normalisation, const bool &block_solve=true)
 
void activate_pitchfork_tracking (double *const &parameter_pt, const DoubleVector &symmetry_vector, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const bool &block_solve=true)
 
void activate_hopf_tracking (double *const &parameter_pt, const double &omega, const DoubleVector &null_real, const DoubleVector &null_imag, const bool &block_solve=true)
 
void deactivate_bifurcation_tracking ()
 
void reset_assembly_handler_to_default ()
 Reset the system to the standard non-augemented state. More...
 
double arc_length_step_solve (double *const &parameter_pt, const double &ds, const unsigned &max_adapt=0)
 
double arc_length_step_solve (Data *const &data_pt, const unsigned &data_index, const double &ds, const unsigned &max_adapt=0)
 
void reset_arc_length_parameters ()
 
intsign_of_jacobian ()
 
void explicit_timestep (const double &dt, const bool &shift_values=true)
 Take an explicit timestep of size dt. More...
 
void unsteady_newton_solve (const double &dt)
 
void unsteady_newton_solve (const double &dt, const bool &shift_values)
 
void unsteady_newton_solve (const double &dt, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const bool &first, const bool &shift=true)
 
double doubly_adaptive_unsteady_newton_solve (const double &dt, const double &epsilon, const unsigned &max_adapt, const unsigned &suppress_resolve_after_spatial_adapt_flag, const bool &first, const bool &shift=true)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon)
 
double adaptive_unsteady_newton_solve (const double &dt_desired, const double &epsilon, const bool &shift_values)
 
void assign_initial_values_impulsive ()
 
void assign_initial_values_impulsive (const double &dt)
 
void calculate_predictions ()
 Calculate predictions. More...
 
void enable_mass_matrix_reuse ()
 
void disable_mass_matrix_reuse ()
 
bool mass_matrix_reuse_is_enabled ()
 Return whether the mass matrix is being reused. More...
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void refine_uniformly (DocInfo &doc_info)
 
void refine_uniformly_and_prune (DocInfo &doc_info)
 
void refine_uniformly ()
 
void refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform refinement for submesh i_mesh with documentation. More...
 
void refine_uniformly (const unsigned &i_mesh)
 Do uniform refinement for submesh i_mesh without documentation. More...
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh)
 
void p_refine_uniformly_and_prune (const Vector< unsigned > &nrefine_for_mesh, DocInfo &doc_info)
 
void p_refine_uniformly (DocInfo &doc_info)
 
void p_refine_uniformly_and_prune (DocInfo &doc_info)
 
void p_refine_uniformly ()
 
void p_refine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-refinement for submesh i_mesh with documentation. More...
 
void p_refine_uniformly (const unsigned &i_mesh)
 Do uniform p-refinement for submesh i_mesh without documentation. More...
 
void refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void refine_selected_elements (const unsigned &i_mesh, const Vector< RefineableElement * > &elements_to_be_refined_pt)
 
void refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void refine_selected_elements (const Vector< Vector< RefineableElement * >> &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< unsigned > &elements_to_be_refined)
 
void p_refine_selected_elements (const unsigned &i_mesh, const Vector< PRefineableElement * > &elements_to_be_refined_pt)
 
void p_refine_selected_elements (const Vector< Vector< unsigned >> &elements_to_be_refined)
 
void p_refine_selected_elements (const Vector< Vector< PRefineableElement * >> &elements_to_be_refined_pt)
 
unsigned unrefine_uniformly ()
 
unsigned unrefine_uniformly (const unsigned &i_mesh)
 
void p_unrefine_uniformly (DocInfo &doc_info)
 
void p_unrefine_uniformly (const unsigned &i_mesh, DocInfo &doc_info)
 Do uniform p-unrefinement for submesh i_mesh without documentation. More...
 
void adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void adapt ()
 
void p_adapt (unsigned &n_refined, unsigned &n_unrefined)
 
void p_adapt ()
 
void adapt_based_on_error_estimates (unsigned &n_refined, unsigned &n_unrefined, Vector< Vector< double >> &elemental_error)
 
void adapt_based_on_error_estimates (Vector< Vector< double >> &elemental_error)
 
void get_all_error_estimates (Vector< Vector< double >> &elemental_error)
 
void doc_errors (DocInfo &doc_info)
 Get max and min error for all elements in submeshes. More...
 
void doc_errors ()
 Get max and min error for all elements in submeshes. More...
 
void enable_info_in_newton_solve ()
 
void disable_info_in_newton_solve ()
 Disable the output of information when in the newton solver. More...
 
- Public Member Functions inherited from oomph::ExplicitTimeSteppableObject
 ExplicitTimeSteppableObject ()
 Empty constructor. More...
 
 ExplicitTimeSteppableObject (const ExplicitTimeSteppableObject &)=delete
 Broken copy constructor. More...
 
void operator= (const ExplicitTimeSteppableObject &)=delete
 Broken assignment operator. More...
 
virtual ~ExplicitTimeSteppableObject ()
 Empty destructor. More...
 
virtual void actions_before_explicit_stage ()
 
virtual void actions_after_explicit_stage ()
 

Private Member Functions

 ProjectionProblem ()
 
 ~ProjectionProblem ()
 
void store_positions ()
 
void restore_positions ()
 
void pin_all ()
 Pin all the field values and position unknowns (bit inefficient) More...
 
void unpin_all ()
 Unpin all the field values and position unknowns (bit inefficient) More...
 
void unpin_dofs_of_coordinate (const unsigned &coord)
 Helper function to unpin the values of coordinate coord. More...
 
void pin_dofs_of_coordinate (const unsigned &coord)
 Helper function to unpin the values of coordinate coord. More...
 
void unpin_dofs_of_field (const unsigned &fld)
 Helper function to unpin dofs of fld-th field. More...
 
void pin_dofs_of_field (const unsigned &fld)
 Helper function to unpin dofs of fld-th field. More...
 
void set_time_level_for_projection (const unsigned &time_level)
 Helper function to set time level for projection. More...
 
void set_coordinate_for_projection (const unsigned &i)
 Set the coordinate for projection. More...
 
void set_lagrangian_coordinate_for_projection (const unsigned &i)
 Set the Lagrangian coordinate for projection. More...
 
void set_current_field_for_projection (const unsigned &fld)
 Set current field for projection. More...
 

Private Attributes

Vector< DenseMatrix< double > > Solid_backup
 Backup for pin status of solid node's position Data. More...
 
bool Output_during_projection_suppressed
 Flag to suppress output during projection. More...
 
bool Use_iterative_solver_for_projection
 
IterativeLinearSolverIterative_solver_projection_pt
 
PreconditionerPreconditioner_projection_pt
 

Friends

template<class FRIEND_PROJECTABLE_ELEMENT >
class RefineableTriangleMesh
 
template<class FRIEND_PROJECTABLE_ELEMENT >
class RefineableTetgenMesh
 
template<class FRIEND_PROJECTABLE_ELEMENT >
class BackupMeshForProjection
 
template<class FRIEND_PROJECTABLE_ELEMENT >
class RefineableGmshTetMesh
 

Additional Inherited Members

- Public Types inherited from oomph::Problem
typedef void(* SpatialErrorEstimatorFctPt) (Mesh *&mesh_pt, Vector< double > &elemental_error)
 Function pointer for spatial error estimator. More...
 
typedef void(* SpatialErrorEstimatorWithDocFctPt) (Mesh *&mesh_pt, Vector< double > &elemental_error, DocInfo &doc_info)
 Function pointer for spatial error estimator with doc. More...
 
- Public Attributes inherited from oomph::Problem
bool Shut_up_in_newton_solve
 
- Static Public Attributes inherited from oomph::Problem
static bool Suppress_warning_about_actions_before_read_unstructured_meshes
 
- Protected Types inherited from oomph::Problem
enum  Assembly_method {
  Perform_assembly_using_vectors_of_pairs , Perform_assembly_using_two_vectors , Perform_assembly_using_maps , Perform_assembly_using_lists ,
  Perform_assembly_using_two_arrays
}
 Enumerated flags to determine which sparse assembly method is used. More...
 
- Protected Member Functions inherited from oomph::Problem
unsigned setup_element_count_per_dof ()
 
virtual void sparse_assemble_row_or_column_compressed (Vector< int * > &column_or_row_index, Vector< int * > &row_or_column_start, Vector< double * > &value, Vector< unsigned > &nnz, Vector< double * > &residual, bool compressed_row_flag)
 
virtual void actions_before_newton_solve ()
 
virtual void actions_after_newton_solve ()
 
virtual void actions_before_newton_convergence_check ()
 
virtual void actions_before_newton_step ()
 
virtual void actions_after_newton_step ()
 
virtual void actions_before_implicit_timestep ()
 
virtual void actions_after_implicit_timestep ()
 
virtual void actions_after_implicit_timestep_and_error_estimation ()
 
virtual void actions_before_explicit_timestep ()
 Actions that should be performed before each explicit time step. More...
 
virtual void actions_after_explicit_timestep ()
 Actions that should be performed after each explicit time step. More...
 
virtual void actions_before_read_unstructured_meshes ()
 
virtual void actions_after_read_unstructured_meshes ()
 
virtual void actions_after_change_in_global_parameter (double *const &parameter_pt)
 
virtual void actions_after_change_in_bifurcation_parameter ()
 
virtual void actions_after_parameter_increase (double *const &parameter_pt)
 
doubledof_derivative (const unsigned &i)
 
doubledof_current (const unsigned &i)
 
virtual void set_initial_condition ()
 
virtual double global_temporal_error_norm ()
 
unsigned newton_solve_continuation (double *const &parameter_pt)
 
unsigned newton_solve_continuation (double *const &parameter_pt, DoubleVector &z)
 
void calculate_continuation_derivatives (double *const &parameter_pt)
 
void calculate_continuation_derivatives (const DoubleVector &z)
 
void calculate_continuation_derivatives_fd (double *const &parameter_pt)
 
bool does_pointer_correspond_to_problem_data (double *const &parameter_pt)
 
void set_consistent_pinned_values_for_continuation ()
 
- Protected Attributes inherited from oomph::Problem
Vector< Problem * > Copy_of_problem_pt
 
std::map< double *, boolCalculate_dparameter_analytic
 
bool Calculate_hessian_products_analytic
 
LinearAlgebraDistributionDof_distribution_pt
 
Vector< double * > Dof_pt
 Vector of pointers to dofs. More...
 
DoubleVectorWithHaloEntries Element_count_per_dof
 
double Relaxation_factor
 
double Newton_solver_tolerance
 
unsigned Max_newton_iterations
 Maximum number of Newton iterations. More...
 
unsigned Nnewton_iter_taken
 
Vector< doubleMax_res
 Maximum residuals at start and after each newton iteration. More...
 
double Max_residuals
 
bool Time_adaptive_newton_crash_on_solve_fail
 
bool Jacobian_reuse_is_enabled
 Is re-use of Jacobian in Newton iteration enabled? Default: false. More...
 
bool Jacobian_has_been_computed
 
bool Problem_is_nonlinear
 
bool Pause_at_end_of_sparse_assembly
 
bool Doc_time_in_distribute
 
unsigned Sparse_assembly_method
 
unsigned Sparse_assemble_with_arrays_initial_allocation
 
unsigned Sparse_assemble_with_arrays_allocation_increment
 
Vector< Vector< unsigned > > Sparse_assemble_with_arrays_previous_allocation
 
double Numerical_zero_for_sparse_assembly
 
double FD_step_used_in_get_hessian_vector_products
 
bool Mass_matrix_reuse_is_enabled
 
bool Mass_matrix_has_been_computed
 
bool Discontinuous_element_formulation
 
double Minimum_dt
 Minimum desired dt: if dt falls below this value, exit. More...
 
double Maximum_dt
 Maximum desired dt. More...
 
double DTSF_max_increase
 
double DTSF_min_decrease
 
double Minimum_dt_but_still_proceed
 
bool Scale_arc_length
 Boolean to control whether arc-length should be scaled. More...
 
double Desired_proportion_of_arc_length
 Proportion of the arc-length to taken by the parameter. More...
 
double Theta_squared
 
int Sign_of_jacobian
 Storage for the sign of the global Jacobian. More...
 
double Continuation_direction
 
double Parameter_derivative
 Storage for the derivative of the global parameter wrt arc-length. More...
 
double Parameter_current
 Storage for the present value of the global parameter. More...
 
bool Use_continuation_timestepper
 Boolean to control original or new storage of dof stuff. More...
 
unsigned Dof_derivative_offset
 
unsigned Dof_current_offset
 
Vector< doubleDof_derivative
 Storage for the derivative of the problem variables wrt arc-length. More...
 
Vector< doubleDof_current
 Storage for the present values of the variables. More...
 
double Ds_current
 Storage for the current step value. More...
 
unsigned Desired_newton_iterations_ds
 
double Minimum_ds
 Minimum desired value of arc-length. More...
 
bool Bifurcation_detection
 Boolean to control bifurcation detection via determinant of Jacobian. More...
 
bool Bisect_to_find_bifurcation
 Boolean to control wheter bisection is used to located bifurcation. More...
 
bool First_jacobian_sign_change
 Boolean to indicate whether a sign change has occured in the Jacobian. More...
 
bool Arc_length_step_taken
 Boolean to indicate whether an arc-length step has been taken. More...
 
bool Use_finite_differences_for_continuation_derivatives
 
OomphCommunicatorCommunicator_pt
 The communicator for this problem. More...
 
bool Always_take_one_newton_step
 
double Timestep_reduction_factor_after_nonconvergence
 
bool Keep_temporal_error_below_tolerance
 
- Static Protected Attributes inherited from oomph::Problem
static ContinuationStorageScheme Continuation_time_stepper
 Storage for the single static continuation timestorage object. More...
 

Detailed Description

template<class PROJECTABLE_ELEMENT>
class oomph::ProjectionProblem< PROJECTABLE_ELEMENT >

Projection problem. This is created during the adaptation of unstructured meshes and it is assumed that no boundary conditions have been set. If they have, they will be unset during the projection and must be reset afterwards.

Constructor & Destructor Documentation

◆ ProjectionProblem()

template<class PROJECTABLE_ELEMENT >
oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::ProjectionProblem ( )
inlineprivate

Default constructor (made this private so only the friend class can call the constructor)

1388  {
1389  // This is a linear problem so avoid checking the residual
1390  // after the solve
1391  Problem_is_nonlinear = false; // DO NOT CHANGE THIS -- EVER -- IN
1392  // SOLID MECHANICS PROBLEMS
1393 
1394  // By default suppress output during projection
1396 
1397  // By default we use an iterative solver for projection
1399 
1400  // Initialise the pointer to the solver and the preconditioner
1403  }
bool Problem_is_nonlinear
Definition: problem.h:628
bool Output_during_projection_suppressed
Flag to suppress output during projection.
Definition: projection.h:1802
IterativeLinearSolver * Iterative_solver_projection_pt
Definition: projection.h:1808
bool Use_iterative_solver_for_projection
Definition: projection.h:1805
Preconditioner * Preconditioner_projection_pt
Definition: projection.h:1811

References oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Iterative_solver_projection_pt, oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Output_during_projection_suppressed, oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Preconditioner_projection_pt, oomph::Problem::Problem_is_nonlinear, and oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Use_iterative_solver_for_projection.

◆ ~ProjectionProblem()

template<class PROJECTABLE_ELEMENT >
oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::~ProjectionProblem ( )
inlineprivate

Member Function Documentation

◆ disable_suppress_output_during_projection()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::disable_suppress_output_during_projection ( )
inline

Undo suppression of all output during projection phases.

724  {
726  }

References oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Output_during_projection_suppressed.

◆ disable_use_iterative_solver_for_projection()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::disable_use_iterative_solver_for_projection ( )
inline

Disbales the use of an iterative solver for projection.

743  {
745  }

References oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Use_iterative_solver_for_projection.

◆ enable_suppress_output_during_projection()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::enable_suppress_output_during_projection ( )
inline

Suppress all output during projection phases.

718  {
720  }

References oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Output_during_projection_suppressed.

◆ enable_use_iterative_solver_for_projection()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::enable_use_iterative_solver_for_projection ( )
inline

Enables the use of an iterative solver for projection.

737  {
739  }

References oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Use_iterative_solver_for_projection.

◆ pin_all()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::pin_all ( )
inlineprivate

Pin all the field values and position unknowns (bit inefficient)

Do we have a solid mesh?

1504  {
1505  // No need to do anything if there are no elements (in fact, we
1506  // probably never get here...)
1507  if (Problem::mesh_pt()->nelement() == 0) return;
1508 
1509  // Loop over all the elements
1510  const unsigned n_element = Problem::mesh_pt()->nelement();
1511  for (unsigned e = 0; e < n_element; ++e)
1512  {
1513  FiniteElement* el_pt = Problem::mesh_pt()->finite_element_pt(e);
1514  unsigned nint = el_pt->ninternal_data();
1515  for (unsigned j = 0; j < nint; j++)
1516  {
1517  Data* int_data_pt = el_pt->internal_data_pt(j);
1518  unsigned nval = int_data_pt->nvalue();
1519  for (unsigned i = 0; i < nval; i++)
1520  {
1521  int_data_pt->pin(i);
1522  }
1523  }
1524 
1525  unsigned nnod = el_pt->nnode();
1526  for (unsigned j = 0; j < nnod; j++)
1527  {
1528  Node* nod_pt = el_pt->node_pt(j);
1529  unsigned nval = nod_pt->nvalue();
1530  for (unsigned i = 0; i < nval; i++)
1531  {
1532  nod_pt->pin(i);
1533  }
1534  }
1535  }
1536 
1538  SolidFiniteElement* solid_el_pt =
1539  dynamic_cast<SolidFiniteElement*>(Problem::mesh_pt()->element_pt(0));
1540  if (solid_el_pt != 0)
1541  {
1542  // Find number of nodes
1543  const unsigned n_node = this->mesh_pt()->nnode();
1544  // If no nodes then return
1545  if (n_node == 0)
1546  {
1547  return;
1548  }
1549 
1550  // Read dimension and number of position values from the first node
1551  const unsigned n_dim = this->mesh_pt()->node_pt(0)->ndim();
1552  const unsigned n_position_type =
1553  this->mesh_pt()->node_pt(0)->nposition_type();
1554 
1555  // Loop over the nodes
1556  for (unsigned n = 0; n < n_node; n++)
1557  {
1558  SolidNode* solid_nod_pt =
1559  dynamic_cast<SolidNode*>(this->mesh_pt()->node_pt(n));
1560  for (unsigned i = 0; i < n_dim; i++)
1561  {
1562  for (unsigned k = 0; k < n_position_type; k++)
1563  {
1564  solid_nod_pt->pin_position(k, i);
1565  }
1566  }
1567  }
1568  }
1569  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
unsigned ninternal_data() const
Return the number of internal data objects.
Definition: elements.h:823
FiniteElement * finite_element_pt(const unsigned &e) const
Definition: mesh.h:473
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
Definition: mesh.h:448
unsigned long nnode() const
Return number of nodes in the mesh.
Definition: mesh.h:596
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
Definition: mesh.h:436
unsigned long nelement() const
Return number of elements in the mesh.
Definition: mesh.h:590
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
Definition: nodes.h:1054
unsigned nposition_type() const
Definition: nodes.h:1016
Mesh *& mesh_pt()
Return a pointer to the global mesh.
Definition: problem.h:1280
char char char int int * k
Definition: level2_impl.h:374
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References e(), oomph::Mesh::element_pt(), oomph::Mesh::finite_element_pt(), i, oomph::GeneralisedElement::internal_data_pt(), j, k, oomph::Problem::mesh_pt(), n, oomph::Node::ndim(), oomph::Mesh::nelement(), oomph::GeneralisedElement::ninternal_data(), oomph::FiniteElement::nnode(), oomph::Mesh::nnode(), oomph::FiniteElement::node_pt(), oomph::Mesh::node_pt(), oomph::Node::nposition_type(), oomph::Data::nvalue(), oomph::Data::pin(), and oomph::SolidNode::pin_position().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ pin_dofs_of_coordinate()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::pin_dofs_of_coordinate ( const unsigned coord)
inlineprivate

Helper function to unpin the values of coordinate coord.

1668  {
1669  // Loop over the nodes
1670  const unsigned n_node = Problem::mesh_pt()->nnode();
1671  // If there are no nodes return immediately
1672  if (n_node == 0)
1673  {
1674  return;
1675  }
1676 
1677  // Find the number of position values (should be the same for all nodes)
1678  const unsigned n_position_type =
1680 
1681  for (unsigned n = 0; n < n_node; ++n)
1682  {
1683  // Cache access to the Node as a solid node
1684  SolidNode* solid_nod_pt =
1685  static_cast<SolidNode*>(Problem::mesh_pt()->node_pt(n));
1686  // Unpin all position types associated with the given coordinate
1687  for (unsigned k = 0; k < n_position_type; ++k)
1688  {
1689  solid_nod_pt->pin_position(k, coord);
1690  }
1691  }
1692  }

References k, oomph::Problem::mesh_pt(), n, oomph::Mesh::nnode(), oomph::Mesh::node_pt(), oomph::Node::nposition_type(), and oomph::SolidNode::pin_position().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ pin_dofs_of_field()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::pin_dofs_of_field ( const unsigned fld)
inlineprivate

Helper function to unpin dofs of fld-th field.

1717  {
1718  unsigned n_element = Problem::mesh_pt()->nelement();
1719  for (unsigned e = 0; e < n_element; e++)
1720  {
1721  PROJECTABLE_ELEMENT* new_el_pt =
1722  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1723 
1724  Vector<std::pair<Data*, unsigned>> data =
1725  new_el_pt->data_values_of_field(fld);
1726 
1727  unsigned d_size = data.size();
1728  for (unsigned d = 0; d < d_size; d++)
1729  {
1730  data[d].first->pin(data[d].second);
1731  }
1732  }
1733  }
int data[]
Definition: Map_placement_new.cpp:1

References data, e(), oomph::Mesh::element_pt(), oomph::Problem::mesh_pt(), and oomph::Mesh::nelement().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ project()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project ( Mesh base_mesh_pt,
const bool dont_project_positions = false 
)
inline

Project from base into the problem's own mesh.

Disable documentation of solve times

749  {
750  // Use an iterative solver?
752  {
753  // If oomph-lib has Trilinos installed then use the CG version
754  // from Trilinos, otherwise use oomph-lib's own CG implementation
755 #ifdef OOMPH_HAS_TRILINOS
756  // Check whether the problem is distributed?
758  {
759  // Create a Trilinos Solver
760  Iterative_solver_projection_pt = new TrilinosAztecOOSolver;
761  // Select CG as the linear solver
762  dynamic_cast<TrilinosAztecOOSolver*>(Iterative_solver_projection_pt)
763  ->solver_type() = TrilinosAztecOOSolver::CG;
764  }
765  else
766  {
767  // Use CG to solve the projection problem
769  }
770 
771  // Create the preconditioner
772  Preconditioner_projection_pt = new MatrixBasedDiagPreconditioner();
773  // Set the preconditioner for the solver
776 
777  // Set CG as the linear solver
779 
780 #else
781  // Check whether the problem is distributed?
783  {
784  // If we did not installed Trilinos and the problem is not
785  // distributed then we can use a (serial) preconditioned
786  // iterative solver, otherwise, if we did not installed Trilinos
787  // but the problem is distributed then we cannot use a
788  // preconditioned iterative solver. Matrix multiplication in a
789  // distributed environment is only performed by Trilinos. We
790  // then use a direct solver for the projection problem.
791 
792  // Use CG to solve the projection problem
794 
795  // Create the preconditioner
796  Preconditioner_projection_pt = new MatrixBasedDiagPreconditioner();
797  // Set the preconditioner for the solver
800 
801  // Set CG as the linear solver
803  }
804  else
805  {
806  // Use a direct solver. Do nothing
807  }
808 
809 #endif
810 
811  } // if (Use_iterative_solver_for_projection)
812 
813  // Backup verbosity in Newton solve status
814  bool shut_up_in_newton_solve_backup = Shut_up_in_newton_solve;
815 
816  // Disable documentation of solve times
817  bool backed_up_doc_time_enabled =
820  {
822  }
823 
824  // Display stats
825  unsigned n_element = Problem::mesh_pt()->nelement();
826  unsigned n_element1 = base_mesh_pt->nelement();
827  unsigned n_node = Problem::mesh_pt()->nnode();
828  unsigned n_node1 = base_mesh_pt->nnode();
830  {
831  oomph_info << "\n=============================\n";
832  oomph_info << "Base mesh has " << n_element1 << " elements\n";
833  oomph_info << "Target mesh has " << n_element << " elements\n";
834  oomph_info << "Base mesh has " << n_node1 << " nodes\n";
835  oomph_info << "Target mesh has " << n_node << " nodes\n";
836  oomph_info << "=============================\n\n";
837  }
838  else
839  {
840  // Make Newton solver shut up too
842  }
843 
844 
845  if (n_element == 0)
846  {
847  oomph_info << "Very odd -- no elements in target mesh; "
848  << " not doing anything in ProjectionProblem::project()\n";
849  return;
850  }
851 
852 #ifdef PARANOID
853  unsigned nnod = Problem::mesh_pt()->nnode();
854  if (nnod == 0)
855  {
856  std::ostringstream error_stream;
857  error_stream
858  << "Mesh has no nodes! Please populate the Node_pt vector\n"
859  << "otherwise projection won't work!\n";
860  throw OomphLibError(
861  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
862  }
863 #endif
864 
865  // How many fields do we have to project?
866  unsigned n_fields =
867  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(0))
868  ->nfields_for_projection();
869 
870  // Spatial dimension of the problem
871  unsigned n_dim = Problem::mesh_pt()->node_pt(0)->ndim();
872 
873  // Default number of history values
874  unsigned n_history_values = 0;
875 
876  // Set things up for coordinate projection
877  for (unsigned e = 0; e < n_element; e++)
878  {
879  PROJECTABLE_ELEMENT* el_pt =
880  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
881 
882  // Switch to projection
883  el_pt->enable_projection();
884  }
885 
886  // Switch elements in base mesh to projection mode (required
887  // to switch to use of Eulerian coordinates when identifying
888  // corresponding points in the two meshes)
889  for (unsigned e = 0; e < n_element1; e++)
890  {
891  PROJECTABLE_ELEMENT* el_pt =
892  dynamic_cast<PROJECTABLE_ELEMENT*>(base_mesh_pt->element_pt(e));
893 
894  // Switch to projection
895  el_pt->enable_projection();
896  }
897 
898 
899  // Set up multi domain interactions so we can locate the
900  // values in the base mesh.
901  // Note that it's important to switch elements to projection
902  // mode first to ensure that matching is done based on Eulerian
903  // rather than Lagrangian coordinates if pseudo-solid elements
904  // are used.
905  double t_start = TimingHelpers::timer();
907  PROJECTABLE_ELEMENT>(this, Problem::mesh_pt(), base_mesh_pt);
909  {
910  oomph_info
911  << "CPU for setup of multi-domain interaction for projection: "
912  << TimingHelpers::timer() - t_start << std::endl;
913  }
914  t_start = TimingHelpers::timer();
915 
916 
917  // Let us first pin every degree of freedom
918  // We shall unpin selected dofs for each different projection problem
919  this->pin_all();
920 
921  if (!dont_project_positions)
922  {
923  //------------------Project coordinates first------------------------
924  // If we have a solid element then we should also project Lagrangian
925  // coordinates, but we can use the storage that MUST be provided for
926  // the unknown positions for this.
927  // If we can cast the first element of the mesh to a solid element,
928  // then assume that we have solid elements
929  if (dynamic_cast<SolidFiniteElement*>(
930  Problem::mesh_pt()->element_pt(0)))
931  {
932  // Store current positions
933  this->store_positions();
934 
935  // There are no history values for the Lagrangian coordinates
936  // Set coordinate 0 for projection
938  this->unpin_dofs_of_coordinate(0);
939 
940  // Loop over the Lagrangian coordinate
941  const unsigned n_lagrangian =
942  dynamic_cast<SolidNode*>(Problem::mesh_pt()->node_pt(0))
943  ->nlagrangian();
944 
945  // Now loop over the lagrangian coordinates
946  for (unsigned i = 0; i < n_lagrangian; ++i)
947  {
949  {
950  oomph_info
951  << "\n\n=============================================\n";
952  oomph_info << "Projecting values for Lagrangian coordinate " << i
953  << std::endl;
954  oomph_info << "=============================================\n\n";
955  }
956 
957  // Set the coordinate for projection
959 
960  // Assign equation number
961  unsigned ndof_tmp = assign_eqn_numbers();
963  {
964  oomph_info << "Number of equations for projection of Lagrangian "
965  "coordinate "
966  << " : " << ndof_tmp << std::endl
967  << std::endl;
968  }
969 
970 
972  {
973  std::ostringstream error_stream;
974  error_stream
975  << "Solid mechanics problems will break if "
976  "Problem_is_nonlinear is\n"
977  << "set to true in the projection problem because we're using "
978  "the\n "
979  << "actual nodal positions to store the values of the "
980  "Lagrangian\n"
981  << "coords. There shouldn't be any need for \n"
982  << "Problem_is_nonlinear=true anyway, apart from debugging in "
983  "\n"
984  << "which case you now know why this case will break!\n";
985  OomphLibWarning(error_stream.str(),
988  }
989 
990 
991  // Projection and interpolation
993 
994  // Move values back into Lagrangian coordinate for all nodes
995  unsigned n_node = Problem::mesh_pt()->nnode();
996  for (unsigned n = 0; n < n_node; ++n)
997  {
998  // Cast it to a solid node
999  SolidNode* solid_node_pt =
1000  dynamic_cast<SolidNode*>(Problem::mesh_pt()->node_pt(n));
1001  // Now find number of types
1002  const unsigned n_position_type = solid_node_pt->nposition_type();
1003  // Find number of lagrangian types
1004  const unsigned n_lagrangian_type =
1005  solid_node_pt->nlagrangian_type();
1006 
1007  // If these are not the same, throw an error
1008  if (n_position_type != n_lagrangian_type)
1009  {
1010  std::ostringstream error_stream;
1011  error_stream
1012  << "The number of generalised position dofs "
1013  << n_position_type
1014  << "\n not the same as the number of generalised lagrangian "
1015  "dofs "
1016  << n_lagrangian_type << ".\n"
1017  << "Projection cannot be done at the moment, sorry.\n";
1018 
1019  throw OomphLibError(error_stream.str(),
1022  }
1023 
1024  // Now transfer the information across
1025  // from the first coordinate which was used during the projection
1026  for (unsigned k = 0; k < n_position_type; ++k)
1027  {
1028  solid_node_pt->xi_gen(k, i) = solid_node_pt->x_gen(k, 0);
1029  // Reset real values so that the Jacobians are correctly
1030  // computed next time around
1031  solid_node_pt->x_gen(k, 0) = Solid_backup[n](k, 0);
1032  }
1033  }
1034  } // End of loop over lagrangian coordinates
1035 
1036  // Now repin the dofs
1037  this->pin_dofs_of_coordinate(0);
1038 
1039  // Now project the position histories
1040 
1041  // Check number of history values for coordinates
1042  n_history_values = dynamic_cast<PROJECTABLE_ELEMENT*>(
1044  ->nhistory_values_for_coordinate_projection();
1045 
1046  // Projection the coordinates only if there are history values
1047  if (n_history_values > 1)
1048  {
1049  for (unsigned i = 0; i < n_dim; i++)
1050  {
1052  {
1053  oomph_info
1054  << "\n\n=============================================\n";
1055  oomph_info << "Projecting history values for coordinate " << i
1056  << std::endl;
1057  oomph_info
1058  << "=============================================\n\n";
1059  }
1060 
1061  // Set the coordinate for projection
1063  this->unpin_dofs_of_coordinate(i);
1064 
1065  // Loop over number of history values, beginning with the latest
1066  // one. Don't deal with current time.
1067  for (unsigned h_tim = n_history_values; h_tim > 1; h_tim--)
1068  {
1069  unsigned time_level = h_tim - 1;
1070 
1071  // Set time_level we are dealing with
1072  this->set_time_level_for_projection(time_level);
1073 
1074  // Assign equation number
1075  unsigned ndof_tmp = assign_eqn_numbers();
1077  {
1078  oomph_info
1079  << "Number of equations for projection of coordinate " << i
1080  << " at time level " << time_level << " : " << ndof_tmp
1081  << std::endl
1082  << std::endl;
1083  }
1084 
1085  // Projection and interpolation
1087 
1088  // Move values back into history value of coordinate
1089  unsigned n_node = Problem::mesh_pt()->nnode();
1090  for (unsigned n = 0; n < n_node; ++n)
1091  {
1092  // Cache the pointer to the node
1093  Node* nod_pt = Problem::mesh_pt()->node_pt(n);
1094  // Find the number of generalised dofs
1095  const unsigned n_position_type = nod_pt->nposition_type();
1096  // Now copy all back
1097  for (unsigned k = 0; k < n_position_type; ++k)
1098  {
1099  nod_pt->x_gen(time_level, k, i) = nod_pt->x_gen(0, k, i);
1100  // Reset real values so that the Jacobians are computed
1101  // correctly next time around
1102  nod_pt->x_gen(0, k, i) = Solid_backup[n](k, i);
1103  }
1104  }
1105  }
1106  // Repin the positions
1107  this->pin_dofs_of_coordinate(i);
1108  }
1109  } // End of history value projection
1110  } // End of SolidElement case
1111 
1112  // Now for non solid elements, we are going to hijack the
1113  // first value as storage to be used for the projection of the history
1114  // values
1115  else
1116  {
1117  // Prepare for projection in value 0
1119  this->unpin_dofs_of_field(0);
1120 
1121 #ifdef PARANOID
1122 
1123  // The machinery used below assumes that field 0 can actually
1124  // hold the coordinates i.e. that the field is interpolated
1125  // isoparametrically! The method will fail if there are no values
1126  // stored at the nodes. Currently there are no examples of that --
1127  // the problem would only arise for elements that have all their
1128  // fields represented by internal data. Will fix this if/when such a
1129  // case arises...
1130  unsigned n_element = Problem::mesh_pt()->nelement();
1131  for (unsigned e = 0; e < n_element; e++)
1132  {
1133  FiniteElement* el_pt = Problem::mesh_pt()->finite_element_pt(e);
1134  unsigned nnod = el_pt->nnode();
1135  for (unsigned j = 0; j < nnod; j++)
1136  {
1137  Node* nod_pt = el_pt->node_pt(j);
1138  if (nod_pt->nvalue() == 0)
1139  {
1140  std::ostringstream error_stream;
1141  error_stream << "Node at ";
1142  unsigned n = nod_pt->ndim();
1143  for (unsigned i = 0; i < n; i++)
1144  {
1145  error_stream << nod_pt->x(i) << " ";
1146  }
1147  error_stream
1148  << "\nhas no values. Projection (of coordinates) doesn't "
1149  "work\n"
1150  << "for such cases (at the moment), sorry! Send us the code\n"
1151  << "where the problem arises and we'll try to implement "
1152  "this\n"
1153  << "(up to now unnecessary) capability...\n";
1154  throw OomphLibError(error_stream.str(),
1157  }
1158  }
1159  }
1160 
1161 #endif
1162 
1163  // Check number of history values for coordinates
1164  n_history_values = dynamic_cast<PROJECTABLE_ELEMENT*>(
1166  ->nhistory_values_for_coordinate_projection();
1167 
1168  // Projection the coordinates only if there are history values
1169  if (n_history_values > 1)
1170  {
1171  for (unsigned i = 0; i < n_dim; i++)
1172  {
1174  {
1175  oomph_info
1176  << "\n\n=============================================\n";
1177  oomph_info << "Projecting history values for coordinate " << i
1178  << std::endl;
1179  oomph_info
1180  << "=============================================\n\n";
1181  }
1182 
1183  // Set the coordinate for projection
1185 
1186  // Loop over number of history values, beginning with the latest
1187  // one. Don't deal with current time.
1188  for (unsigned h_tim = n_history_values; h_tim > 1; h_tim--)
1189  {
1190  unsigned time_level = h_tim - 1;
1191 
1192  // Set time_level we are dealing with
1193  this->set_time_level_for_projection(time_level);
1194 
1195  // Assign equation number
1196  unsigned ndof_tmp = assign_eqn_numbers();
1198  {
1199  oomph_info
1200  << "Number of equations for projection of coordinate " << i
1201  << " at time level " << time_level << " : " << ndof_tmp
1202  << std::endl
1203  << std::endl;
1204  }
1205 
1206  // Projection and interpolation
1208 
1209  // Move values back into history value of coordinate
1210  unsigned n_element = Problem::mesh_pt()->nelement();
1211  for (unsigned e = 0; e < n_element; e++)
1212  {
1213  PROJECTABLE_ELEMENT* new_el_pt =
1214  dynamic_cast<PROJECTABLE_ELEMENT*>(
1216 
1217  Vector<std::pair<Data*, unsigned>> data =
1218  new_el_pt->data_values_of_field(0);
1219 
1220  unsigned d_size = data.size();
1221  for (unsigned d = 0; d < d_size; d++)
1222  {
1223  // Replace as coordinates
1224  double coord = data[d].first->value(0, 0);
1225  dynamic_cast<Node*>(data[d].first)->x(time_level, i) =
1226  coord;
1227  }
1228  }
1229  }
1230  }
1231  } // End of history value projection
1232 
1233  // Repin the dofs for field 0
1234  this->pin_dofs_of_field(0);
1235 
1236  } // End of non-SolidElement case
1237 
1238 
1239  } // end if for projection of coordinates
1240 
1241  // Disable projection of coordinates
1242  for (unsigned e = 0; e < n_element; e++)
1243  {
1244  PROJECTABLE_ELEMENT* el_pt =
1245  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1246 
1247  el_pt->set_project_values();
1248  }
1249 
1250  // Loop over fields
1251  for (unsigned fld = 0; fld < n_fields; fld++)
1252  {
1253  // Let us first pin every degree of freedom
1254  // We shall unpin selected dofs for each different projection problem
1255  this->pin_all();
1256 
1257  // Do actions for this field
1259  this->unpin_dofs_of_field(fld);
1260 
1261  // Check number of history values
1262  n_history_values =
1263  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(0))
1264  ->nhistory_values_for_projection(fld);
1265 
1266  // Loop over number of history values
1267  // Beginning with the latest one
1268  for (unsigned h_tim = n_history_values; h_tim > 0; h_tim--)
1269  {
1270  unsigned time_level = h_tim - 1;
1272  {
1273  oomph_info << "\n=========================================\n";
1274  oomph_info << "Projecting field " << fld << " at time level "
1275  << time_level << std::endl;
1276  oomph_info << "========================================\n";
1277  }
1278 
1279  // Set time_level we are dealing with
1280  this->set_time_level_for_projection(time_level);
1281 
1282  // Assign equation number
1283  unsigned ndof_tmp = assign_eqn_numbers();
1285  {
1286  oomph_info << "Number of equations for projection of field " << fld
1287  << " at time level " << time_level << " : " << ndof_tmp
1288  << std::endl
1289  << std::endl;
1290  }
1291 
1292  // Projection and interpolation
1294 
1295  // Move computed values into the required time-level (not needed
1296  // for current values which are done last -- they simply
1297  // stay where they are)
1298  if (time_level != 0)
1299  {
1300  for (unsigned e = 0; e < n_element; e++)
1301  {
1302  PROJECTABLE_ELEMENT* new_el_pt =
1303  dynamic_cast<PROJECTABLE_ELEMENT*>(
1305 
1306  Vector<std::pair<Data*, unsigned>> data =
1307  new_el_pt->data_values_of_field(fld);
1308 
1309  unsigned d_size = data.size();
1310  for (unsigned d = 0; d < d_size; d++)
1311  {
1312  // Move into time level
1313  double c_value = data[d].first->value(0, data[d].second);
1314  data[d].first->set_value(time_level, data[d].second, c_value);
1315  }
1316  }
1317  }
1318  } // End of loop over time levels
1319 
1320  } // End of loop over fields
1321 
1322 
1323  // Reset parameters of external storage and interactions
1324  for (unsigned e = 0; e < n_element; e++)
1325  {
1326  PROJECTABLE_ELEMENT* new_el_pt =
1327  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1328 
1329  // Flush information associated with the external elements
1330  new_el_pt->flush_all_external_element_storage();
1331 
1332  new_el_pt->disable_projection();
1333  }
1334 
1335  for (unsigned e = 0; e < n_element1; e++)
1336  {
1337  PROJECTABLE_ELEMENT* el_pt =
1338  dynamic_cast<PROJECTABLE_ELEMENT*>(base_mesh_pt->element_pt(e));
1339 
1340  // Flush information associated with the external elements
1341  el_pt->flush_all_external_element_storage();
1342 
1343  // Disable projection
1344  el_pt->disable_projection();
1345  }
1346 
1347  // Now unpin everything to restore the problem to its virgin state
1348  this->unpin_all();
1349 
1350  // Now cleanup the storage
1351  Solid_backup.clear();
1352 
1353  /* unsigned ndof_tmp=this->assign_eqn_numbers(); */
1355  {
1356  /* oomph_info << "Number of unknowns after project: " */
1357  /* << ndof_tmp << std::endl; */
1358  // std::ostringstream warn_message;
1359  // warn_message
1360  // << "WARNING: Ensure to assign equations numbers in the new mesh,\n"
1361  // << "this is done by calling the assign_eqn_numbers() method from\n"
1362  // << "the original Problem object that has an instance of the mesh.\n"
1363  // << "This may be performed in actions_after_adapt() if the
1364  // projection\n"
1365  // << "was performed as part of the mesh adaptation process\n\n";
1366  // OomphLibWarning(warn_message.str(),
1367  // OOMPH_CURRENT_FUNCTION,
1368  // OOMPH_EXCEPTION_LOCATION);
1369  }
1370  else
1371  {
1372  // Reset verbosity in Newton solver
1373  Shut_up_in_newton_solve = shut_up_in_newton_solve_backup;
1374 
1376  if (backed_up_doc_time_enabled)
1377  {
1379  }
1380  }
1381 
1382  } // End of function Projection
Evaluates time-resolved continuum fields and writes the data into a stat file.
Definition: CG.h:55
Preconditioner *& preconditioner_pt()
Access function to preconditioner.
Definition: iterative_linear_solver.h:95
bool is_doc_time_enabled() const
Is documentation of solve times enabled?
Definition: linear_solver.h:122
void disable_doc_time()
Disable documentation of solve times.
Definition: linear_solver.h:116
void enable_doc_time()
Enable documentation of solve times.
Definition: linear_solver.h:110
static bool mpi_has_been_initialised()
return true if MPI has been initialised
Definition: oomph_utilities.h:851
LinearSolver *& linear_solver_pt()
Return a pointer to the linear solver object.
Definition: problem.h:1466
void newton_solve()
Use Newton method to solve the problem.
Definition: problem.cc:8783
bool Shut_up_in_newton_solve
Definition: problem.h:2191
unsigned long assign_eqn_numbers(const bool &assign_local_eqn_numbers=true)
Definition: problem.cc:1989
void disable_info_in_newton_solve()
Disable the output of information when in the newton solver.
Definition: problem.h:2941
void unpin_dofs_of_field(const unsigned &fld)
Helper function to unpin dofs of fld-th field.
Definition: projection.h:1696
void unpin_dofs_of_coordinate(const unsigned &coord)
Helper function to unpin the values of coordinate coord.
Definition: projection.h:1639
void store_positions()
Definition: projection.h:1425
void set_current_field_for_projection(const unsigned &fld)
Set current field for projection.
Definition: projection.h:1784
void set_time_level_for_projection(const unsigned &time_level)
Helper function to set time level for projection.
Definition: projection.h:1736
void set_lagrangian_coordinate_for_projection(const unsigned &i)
Set the Lagrangian coordinate for projection.
Definition: projection.h:1767
void pin_all()
Pin all the field values and position unknowns (bit inefficient)
Definition: projection.h:1503
void unpin_all()
Unpin all the field values and position unknowns (bit inefficient)
Definition: projection.h:1573
void pin_dofs_of_field(const unsigned &fld)
Helper function to unpin dofs of fld-th field.
Definition: projection.h:1716
void set_coordinate_for_projection(const unsigned &i)
Set the coordinate for projection.
Definition: projection.h:1750
void pin_dofs_of_coordinate(const unsigned &coord)
Helper function to unpin the values of coordinate coord.
Definition: projection.h:1667
Vector< DenseMatrix< double > > Solid_backup
Backup for pin status of solid node's position Data.
Definition: projection.h:1799
@ CG
Definition: trilinos_solver.h:485
void setup_multi_domain_interaction(Problem *problem_pt, Mesh *const &mesh_pt, Mesh *const &external_mesh_pt, const unsigned &interaction_index=0)
Definition: multi_domain.template.cc:280
double timer()
returns the time in seconds after some point in past
Definition: oomph_utilities.cc:1295
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
list x
Definition: plotDoE.py:28
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::Problem::assign_eqn_numbers(), oomph::TrilinosAztecOOSolver::CG, data, oomph::LinearSolver::disable_doc_time(), oomph::Problem::disable_info_in_newton_solve(), e(), oomph::Mesh::element_pt(), oomph::LinearSolver::enable_doc_time(), oomph::Mesh::finite_element_pt(), i, oomph::LinearSolver::is_doc_time_enabled(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Iterative_solver_projection_pt, j, k, oomph::Problem::linear_solver_pt(), oomph::Problem::mesh_pt(), oomph::MPI_Helpers::mpi_has_been_initialised(), n, oomph::Node::ndim(), oomph::Mesh::nelement(), oomph::Problem::newton_solve(), oomph::SolidNode::nlagrangian_type(), oomph::FiniteElement::nnode(), oomph::Mesh::nnode(), oomph::FiniteElement::node_pt(), oomph::Mesh::node_pt(), oomph::Node::nposition_type(), oomph::Data::nvalue(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::oomph_info, oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Output_during_projection_suppressed, oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::pin_all(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::pin_dofs_of_coordinate(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::pin_dofs_of_field(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Preconditioner_projection_pt, oomph::IterativeLinearSolver::preconditioner_pt(), oomph::Problem::Problem_is_nonlinear, oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::set_coordinate_for_projection(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::set_current_field_for_projection(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::set_lagrangian_coordinate_for_projection(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::set_time_level_for_projection(), oomph::Multi_domain_functions::setup_multi_domain_interaction(), oomph::Problem::Shut_up_in_newton_solve, oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Solid_backup, oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::store_positions(), oomph::TimingHelpers::timer(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::unpin_all(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::unpin_dofs_of_coordinate(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::unpin_dofs_of_field(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Use_iterative_solver_for_projection, plotDoE::x, oomph::Node::x(), oomph::Node::x_gen(), and oomph::SolidNode::xi_gen().

Referenced by oomph::RefineableTetgenMesh< ELEMENT >::adapt(), and oomph::RefineableGmshTetMesh< ELEMENT >::adapt().

◆ restore_positions()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::restore_positions ( )
inlineprivate

Helper function to restore positions (the only things that have been set before doing projection

1467  {
1468  // No need to do anything if there are no elements (in fact, we
1469  // probably never get here...)
1470  if (Problem::mesh_pt()->nelement() == 0) return;
1471 
1472  // Deal with positional dofs if (pseudo-)solid element
1473  // If we can cast the first element to a SolidFiniteElement then
1474  // assume that we have a solid mesh
1475  SolidFiniteElement* solid_el_pt =
1476  dynamic_cast<SolidFiniteElement*>(Problem::mesh_pt()->element_pt(0));
1477  if (solid_el_pt != 0)
1478  {
1479  const unsigned n_node = this->mesh_pt()->nnode();
1480  // Read dimension and number of position values from the first node
1481  const unsigned n_dim = this->mesh_pt()->node_pt(0)->ndim();
1482  const unsigned n_position_type =
1483  this->mesh_pt()->node_pt(0)->nposition_type();
1484  // Loop over the nodes
1485  for (unsigned n = 0; n < n_node; n++)
1486  {
1487  // Cache a pointer to a solid node
1488  SolidNode* const solid_nod_pt =
1489  dynamic_cast<SolidNode*>(this->mesh_pt()->node_pt(n));
1490 
1491  for (unsigned i = 0; i < n_dim; i++)
1492  {
1493  for (unsigned k = 0; k < n_position_type; k++)
1494  {
1495  solid_nod_pt->x_gen(k, i) = Solid_backup[n](k, i);
1496  }
1497  }
1498  }
1499  }
1500  }

References oomph::Mesh::element_pt(), i, k, oomph::Problem::mesh_pt(), n, oomph::Node::ndim(), oomph::Mesh::nnode(), oomph::Mesh::node_pt(), oomph::Node::nposition_type(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Solid_backup, and oomph::Node::x_gen().

◆ set_coordinate_for_projection()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::set_coordinate_for_projection ( const unsigned i)
inlineprivate

Set the coordinate for projection.

1751  {
1752  unsigned n_element = Problem::mesh_pt()->nelement();
1753  for (unsigned e = 0; e < n_element; e++)
1754  {
1755  PROJECTABLE_ELEMENT* new_el_pt =
1756  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1757 
1758  // Set that we are solving a projected coordinate problem
1759  new_el_pt->set_project_coordinates();
1760 
1761  // Set the projected coordinate
1762  new_el_pt->projected_coordinate() = i;
1763  }
1764  }

References e(), oomph::Mesh::element_pt(), i, oomph::Problem::mesh_pt(), and oomph::Mesh::nelement().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ set_current_field_for_projection()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::set_current_field_for_projection ( const unsigned fld)
inlineprivate

Set current field for projection.

1785  {
1786  unsigned n_element = Problem::mesh_pt()->nelement();
1787  for (unsigned e = 0; e < n_element; e++)
1788  {
1789  PROJECTABLE_ELEMENT* new_el_pt =
1790  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1791 
1792  // Set current field
1793  new_el_pt->projected_field() = fld;
1794  }
1795  }

References e(), oomph::Mesh::element_pt(), oomph::Problem::mesh_pt(), and oomph::Mesh::nelement().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ set_lagrangian_coordinate_for_projection()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::set_lagrangian_coordinate_for_projection ( const unsigned i)
inlineprivate

Set the Lagrangian coordinate for projection.

1768  {
1769  unsigned n_element = Problem::mesh_pt()->nelement();
1770  for (unsigned e = 0; e < n_element; e++)
1771  {
1772  PROJECTABLE_ELEMENT* new_el_pt =
1773  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1774 
1775  // Set that we are solving a projected Lagrangian coordinate problem
1776  new_el_pt->set_project_lagrangian();
1777 
1778  // Set the projected coordinate
1779  new_el_pt->projected_lagrangian_coordinate() = i;
1780  }
1781  }

References e(), oomph::Mesh::element_pt(), i, oomph::Problem::mesh_pt(), and oomph::Mesh::nelement().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ set_time_level_for_projection()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::set_time_level_for_projection ( const unsigned time_level)
inlineprivate

Helper function to set time level for projection.

1737  {
1738  unsigned n_element = Problem::mesh_pt()->nelement();
1739  for (unsigned e = 0; e < n_element; e++)
1740  {
1741  PROJECTABLE_ELEMENT* el_pt =
1742  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1743 
1744  // Set what time we are dealing with
1745  el_pt->time_level_for_projection() = time_level;
1746  }
1747  }

References e(), oomph::Mesh::element_pt(), oomph::Problem::mesh_pt(), and oomph::Mesh::nelement().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ store_positions()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::store_positions ( )
inlineprivate

Helper function to store positions (the only things that have been set before doing projection

1426  {
1427  // No need to do anything if there are no elements (in fact, we
1428  // probably never get here...)
1429  if (Problem::mesh_pt()->nelement() == 0) return;
1430 
1431  // Deal with positional dofs if (pseudo-)solid element
1432  // If we can cast the first element to a SolidFiniteElement then
1433  // assume that we have a solid mesh
1434  SolidFiniteElement* solid_el_pt =
1435  dynamic_cast<SolidFiniteElement*>(Problem::mesh_pt()->element_pt(0));
1436  if (solid_el_pt != 0)
1437  {
1438  const unsigned n_node = this->mesh_pt()->nnode();
1439  Solid_backup.resize(n_node);
1440  // Read dimension and number of position values from the first node
1441  const unsigned n_dim = this->mesh_pt()->node_pt(0)->ndim();
1442  const unsigned n_position_type =
1443  this->mesh_pt()->node_pt(0)->nposition_type();
1444  // Loop over the nodes
1445  for (unsigned n = 0; n < n_node; n++)
1446  {
1447  // Cache a pointer to a solid node
1448  SolidNode* const solid_nod_pt =
1449  dynamic_cast<SolidNode*>(this->mesh_pt()->node_pt(n));
1450  // Now resize the appropriate storage
1451  Solid_backup[n].resize(n_position_type, n_dim);
1452 
1453  for (unsigned i = 0; i < n_dim; i++)
1454  {
1455  for (unsigned k = 0; k < n_position_type; k++)
1456  {
1457  Solid_backup[n](k, i) = solid_nod_pt->x_gen(k, i);
1458  }
1459  }
1460  }
1461  }
1462  }

References oomph::Mesh::element_pt(), i, k, oomph::Problem::mesh_pt(), n, oomph::Node::ndim(), oomph::Mesh::nnode(), oomph::Mesh::node_pt(), oomph::Node::nposition_type(), oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Solid_backup, and oomph::Node::x_gen().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ unpin_all()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::unpin_all ( )
inlineprivate

Unpin all the field values and position unknowns (bit inefficient)

Do we have a solid mesh?

1574  {
1575  // No need to do anything if there are no elements (in fact, we
1576  // probably never get here...)
1577  if (Problem::mesh_pt()->nelement() == 0) return;
1578 
1579  // Loop over all the elements
1580  const unsigned n_element = Problem::mesh_pt()->nelement();
1581  for (unsigned e = 0; e < n_element; ++e)
1582  {
1583  // Cast the first element
1584  PROJECTABLE_ELEMENT* new_el_pt =
1585  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1586  // Find the number of fields
1587  unsigned n_fields = new_el_pt->nfields_for_projection();
1588 
1589  // Now loop over all fields
1590  for (unsigned f = 0; f < n_fields; f++)
1591  {
1592  // Extract the data and value for the field
1593  Vector<std::pair<Data*, unsigned>> data =
1594  new_el_pt->data_values_of_field(f);
1595  // Now loop over all the data and unpin the appropriate values
1596  unsigned d_size = data.size();
1597  for (unsigned d = 0; d < d_size; d++)
1598  {
1599  data[d].first->unpin(data[d].second);
1600  }
1601  }
1602  }
1603 
1605  SolidFiniteElement* solid_el_pt =
1606  dynamic_cast<SolidFiniteElement*>(Problem::mesh_pt()->element_pt(0));
1607  if (solid_el_pt != 0)
1608  {
1609  // Find number of nodes
1610  const unsigned n_node = this->mesh_pt()->nnode();
1611  // If no nodes then return
1612  if (n_node == 0)
1613  {
1614  return;
1615  }
1616 
1617  // Read dimension and number of position values from the first node
1618  const unsigned n_dim = this->mesh_pt()->node_pt(0)->ndim();
1619  const unsigned n_position_type =
1620  this->mesh_pt()->node_pt(0)->nposition_type();
1621 
1622  // Loop over the nodes
1623  for (unsigned n = 0; n < n_node; n++)
1624  {
1625  SolidNode* solid_nod_pt =
1626  dynamic_cast<SolidNode*>(this->mesh_pt()->node_pt(n));
1627  for (unsigned i = 0; i < n_dim; i++)
1628  {
1629  for (unsigned k = 0; k < n_position_type; k++)
1630  {
1631  solid_nod_pt->unpin_position(k, i);
1632  }
1633  }
1634  }
1635  }
1636  }
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237

References data, e(), oomph::Mesh::element_pt(), f(), i, k, oomph::Problem::mesh_pt(), n, oomph::Node::ndim(), oomph::Mesh::nelement(), oomph::Mesh::nnode(), oomph::Mesh::node_pt(), oomph::Node::nposition_type(), and oomph::SolidNode::unpin_position().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ unpin_dofs_of_coordinate()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::unpin_dofs_of_coordinate ( const unsigned coord)
inlineprivate

Helper function to unpin the values of coordinate coord.

1640  {
1641  // Loop over the nodes
1642  const unsigned n_node = Problem::mesh_pt()->nnode();
1643  // If there are no nodes return immediately
1644  if (n_node == 0)
1645  {
1646  return;
1647  }
1648 
1649  // Find the number of position values (should be the same for all nodes)
1650  const unsigned n_position_type =
1652 
1653  for (unsigned n = 0; n < n_node; ++n)
1654  {
1655  // Cache access to the Node as a solid node
1656  SolidNode* solid_nod_pt =
1657  static_cast<SolidNode*>(Problem::mesh_pt()->node_pt(n));
1658  // Unpin all position types associated with the given coordinate
1659  for (unsigned k = 0; k < n_position_type; ++k)
1660  {
1661  solid_nod_pt->unpin_position(k, coord);
1662  }
1663  }
1664  }

References k, oomph::Problem::mesh_pt(), n, oomph::Mesh::nnode(), oomph::Mesh::node_pt(), oomph::Node::nposition_type(), and oomph::SolidNode::unpin_position().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ unpin_dofs_of_field()

template<class PROJECTABLE_ELEMENT >
void oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::unpin_dofs_of_field ( const unsigned fld)
inlineprivate

Helper function to unpin dofs of fld-th field.

1697  {
1698  unsigned n_element = Problem::mesh_pt()->nelement();
1699  for (unsigned e = 0; e < n_element; e++)
1700  {
1701  PROJECTABLE_ELEMENT* new_el_pt =
1702  dynamic_cast<PROJECTABLE_ELEMENT*>(Problem::mesh_pt()->element_pt(e));
1703 
1704  Vector<std::pair<Data*, unsigned>> data =
1705  new_el_pt->data_values_of_field(fld);
1706 
1707  unsigned d_size = data.size();
1708  for (unsigned d = 0; d < d_size; d++)
1709  {
1710  data[d].first->unpin(data[d].second);
1711  }
1712  }
1713  }

References data, e(), oomph::Mesh::element_pt(), oomph::Problem::mesh_pt(), and oomph::Mesh::nelement().

Referenced by oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::project().

◆ use_iterative_solver_for_projection()

template<class PROJECTABLE_ELEMENT >
bool oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::use_iterative_solver_for_projection ( )
inline

Return the value of the flag about using an iterative solver for projection

731  {
733  }

References oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Use_iterative_solver_for_projection.

Friends And Related Function Documentation

◆ BackupMeshForProjection

template<class PROJECTABLE_ELEMENT >
template<class FRIEND_PROJECTABLE_ELEMENT >
friend class BackupMeshForProjection
friend

◆ RefineableGmshTetMesh

template<class PROJECTABLE_ELEMENT >
template<class FRIEND_PROJECTABLE_ELEMENT >
friend class RefineableGmshTetMesh
friend

◆ RefineableTetgenMesh

template<class PROJECTABLE_ELEMENT >
template<class FRIEND_PROJECTABLE_ELEMENT >
friend class RefineableTetgenMesh
friend

◆ RefineableTriangleMesh

template<class PROJECTABLE_ELEMENT >
template<class FRIEND_PROJECTABLE_ELEMENT >
friend class RefineableTriangleMesh
friend

Member Data Documentation

◆ Iterative_solver_projection_pt

◆ Output_during_projection_suppressed

◆ Preconditioner_projection_pt

◆ Solid_backup

template<class PROJECTABLE_ELEMENT >
Vector<DenseMatrix<double> > oomph::ProjectionProblem< PROJECTABLE_ELEMENT >::Solid_backup
private

◆ Use_iterative_solver_for_projection


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