30 Real relaxation_factor;
32 const std::vector<PostprocessorName> * transformed_pps;
33 std::vector<std::vector<PostprocessorValue>> * transformed_pps_values;
51 if (relaxation_factor != 1.)
57 (*transformed_pps_values).resize((*transformed_pps).size());
58 for (
size_t i = 0; i < (*transformed_pps).size(); i++)
59 (*transformed_pps_values)[i].resize(1);
66 Real relaxation_factor;
79 if (relaxation_factor != 1.)
84 transformed_old = solution;
91 Real relaxation_factor;
92 const std::vector<PostprocessorName> * transformed_pps;
93 std::vector<std::vector<PostprocessorValue>> * transformed_pps_values;
107 if (relaxation_factor != 1.)
109 for (
size_t i = 0; i < (*transformed_pps).size(); i++)
127 Real relaxation_factor;
128 const std::vector<PostprocessorName> * transformed_pps;
129 std::vector<std::vector<PostprocessorValue>> * transformed_pps_values;
144 for (
size_t i = 0; i < (*transformed_pps).size(); i++)
148 const Real old_value = (*transformed_pps_values)[i][0];
151 Real new_value = current_value;
152 new_value = relaxation_factor * current_value + (1 - relaxation_factor) * old_value;
160 Real relaxation_factor;
176 for (
const auto & dof : transformed_dofs)
178 (transformed_old(dof) * (1.0 - relaxation_factor)) +
179 (solution(dof) * relaxation_factor));
187 const std::vector<Real> & timestep_begin_norms,
188 const std::vector<Real> & timestep_end_norms)
const 193 Real max_norm_old = initial_norm;
196 Real max_norm =
std::max(timestep_begin_norms[i], timestep_end_norms[i]);
199 max_norm_old = max_norm;
std::vector< std::vector< PostprocessorValue > > _transformed_pps_values
Previous values of the relaxed postprocessors.
std::vector< std::vector< PostprocessorValue > > _secondary_transformed_pps_values
Previous values of the postprocessors relaxed outside of the fixed point iteration (used as a subapp)...
static InputParameters validParams()
FEProblemBase & _problem
Reference to FEProblem.
virtual void savePostprocessorValues(const bool primary) override final
Saves the current values of the postprocessors, and update the old(er) vectors.
virtual void transformPostprocessors(const bool primary) override final
Use the fixed point algorithm to transform the postprocessors.
NumericVector< Number > & solution()
void setPostprocessorValueByName(const PostprocessorName &name, const PostprocessorValue &value, std::size_t t_index=0)
Set the value of a PostprocessorValue.
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
virtual void printFixedPointConvergenceHistory(Real initial_norm, const std::vector< Real > ×tep_begin_norms, const std::vector< Real > ×tep_end_norms) const override final
Print the convergence history of the coupling, at every fixed point iteration.
std::vector< PostprocessorName > _secondary_transformed_pps
Postprocessors to be relaxed outside of fixed point iteration (used as a subapp)
auto max(const L &left, const R &right)
const std::vector< PostprocessorName > _transformed_pps
The postprocessors (transferred or not) that are going to be relaxed.
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const libMesh::ParallelType type)
Adds a solution length vector to the system.
virtual bool useFixedPointAlgorithmUpdateInsteadOfPicard(const bool primary) override final
Use the fixed point algorithm transform instead of simply using the Picard update.
void update()
Update the system (doing libMesh magic)
const Real _relax_factor
Relaxation factor for fixed point Iteration.
Executioners are objects that do the actual work of solving your problem.
TagID _old_tag_id
Vector tag id for the previous solution variable, as a main app.
Real _secondary_relaxation_factor
Relaxation factor outside of fixed point iteration (used as a subapp)
virtual const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name) const
Retrieve the value of the Postprocessor.
unsigned int _fixed_point_it
TagID _secondary_old_tag_id
Vector tag id for the previous solution variable, as a sub app.
SystemBase & _solver_sys
Reference to a system for creating vectors as needed for the solve, etc.
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static std::string outputNorm(const Real &old_norm, const Real &norm, const unsigned int precision=6)
A helper function for outputting norms in color.
virtual void allocateStorage(const bool primary) override final
Allocate storage for the fixed point algorithm.
virtual void set(const numeric_index_type i, const Number value)=0
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
virtual void saveVariableValues(const bool primary) override final
Saves the current values of the variables, and update the old(er) vectors.
PicardSolve(Executioner &ex)
virtual void transformVariables(const std::set< dof_id_type > &transformed_dofs, const bool primary) override final
Use the fixed point algorithm to transform the variables.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
unsigned int _main_fixed_point_it
fixed point iteration counter for the main app