Optimizes the objective function using the Polack-Ribiere scheme. More...
#include <ConjugateGradient.hpp>
Public Member Functions | |
ConjugateGradient (ObjectiveFunction *objective, MsqError &err) | |
virtual | ~ConjugateGradient () |
virtual void | set_patch_type (PatchData::PatchType type, MsqError &err, int patch_param1=0, int patch_param2=0) |
Set the patch type. More... | |
void | set_debugging_level (int new_lev) |
Just for debugging purposes or for obtaining more data during the optimization process. More... | |
ConjugateGradient (ObjectiveFunction *objective, MsqError &err) | |
virtual | ~ConjugateGradient () |
virtual void | set_patch_type (PatchData::PatchType type, MsqError &err, int patch_param1=0, int patch_param2=0) |
Set the patch type. More... | |
void | set_debugging_level (int new_lev) |
Just for debugging purposes or for obtaining more data during the optimization process. More... | |
Public Member Functions inherited from VertexMover | |
virtual | ~VertexMover () |
virtual double | loop_over_mesh (MeshSet &ms, MsqError &err) |
Improves the quality of the MeshSet, calling some methods specified in a class derived from VertexMover. More... | |
virtual | ~VertexMover () |
virtual double | loop_over_mesh (MeshSet &ms, MsqError &err) |
This is the "run" function of PatchDataUser. It can do anything really. More... | |
Public Member Functions inherited from QualityImprover | |
virtual | ~QualityImprover () |
void | set_name (msq_std::string name) |
provides a name to the QualityImprover (use it in constructor). More... | |
virtual msq_std::string | get_name () |
retrieves the QualityImprover name. A default name should be set in the constructor. More... | |
virtual AlgorithmType | get_algorithm_type () |
Return the algorithm type (to avoid RTTI use). More... | |
void | set_inner_termination_criterion (TerminationCriterion *crit) |
Sets in the termination criterion for the concrete solver's optimization. More... | |
void | set_outer_termination_criterion (TerminationCriterion *crit) |
Sets in the termination criterion for the outer loop over patches. More... | |
virtual | ~QualityImprover () |
void | set_name (msq_std::string name) |
provides a name to the QualityImprover (use it in constructor). More... | |
virtual msq_std::string | get_name () |
retrieves the QualityImprover name. A default name should be set in the constructor. More... | |
virtual AlgorithmType | get_algorithm_type () |
Return the algorithm type (to avoid RTTI use). More... | |
void | set_inner_termination_criterion (TerminationCriterion *crit) |
Sets in the termination criterion for the concrete solver's optimization. More... | |
void | set_outer_termination_criterion (TerminationCriterion *crit) |
Sets in the termination criterion for the outer loop over patches. More... | |
Public Member Functions inherited from PatchDataUser | |
virtual | ~PatchDataUser () |
PatchData::PatchType | get_patch_type () |
Returns the Patch Type. More... | |
int | get_nb_layers (MsqError &err) |
Returns number of layers (if relevant for partition algorythm). More... | |
void | add_culling_method (enum PatchData::culling_method cm) |
Sets on the culling method passed as argument. More... | |
void | no_culling_method () |
Sets off all culling methods. More... | |
void | remove_culling_method (enum PatchData::culling_method cm) |
Sets off the culling method passed as argument. More... | |
long unsigned int | get_culling_method_bits () |
Returns the bitset containing culling methods flags. More... | |
void | set_all_parameters (PatchDataParameters ¶ms) |
PatchDataParameters & | get_all_parameters () |
Returns the PatchDataParameters object. More... | |
void | set_global_patch (PatchData *pd, MsqError &err) |
Sets the Global Patch, so that it can be use by contiguoug PatchDataUser. More... | |
PatchData * | get_global_patch () |
Returns the Global Patch. More... | |
void | no_global_patch () |
Sets the Global Patch pointer to NULL. More... | |
virtual | ~PatchDataUser () |
PatchData::PatchType | get_patch_type () |
Returns the Patch Type. More... | |
int | get_nb_layers (MsqError &err) |
Returns number of layers (if relevant for partition algorythm). More... | |
void | add_culling_method (enum PatchData::culling_method cm) |
Sets on the culling method passed as argument. More... | |
void | no_culling_method () |
Sets off all culling methods. More... | |
void | remove_culling_method (enum PatchData::culling_method cm) |
Sets off the culling method passed as argument. More... | |
long unsigned int | get_culling_method_bits () |
Returns the bitset containing culling methods flags. More... | |
void | set_all_parameters (PatchDataParameters ¶ms) |
PatchDataParameters & | get_all_parameters () |
Returns the PatchDataParameters object. More... | |
void | set_global_patch (PatchData *pd, MsqError &err) |
Sets the Global Patch, so that it can be use by contiguoug PatchDataUser. More... | |
PatchData * | get_global_patch () |
Returns the Global Patch. More... | |
void | no_global_patch () |
Sets the Global Patch pointer to NULL. More... | |
Protected Member Functions | |
virtual void | initialize (PatchData &pd, MsqError &err) |
Initialize data for smoothing process. More... | |
virtual void | optimize_vertex_positions (PatchData &pd, MsqError &err) |
virtual void | initialize_mesh_iteration (PatchData &pd, MsqError &err) |
virtual void | terminate_mesh_iteration (PatchData &pd, MsqError &err) |
virtual void | cleanup () |
Delete arrays initially created in initialize(). More... | |
double | get_step (PatchData &pd, double f0, int &j, MsqError &err) |
Returns the step distance to take in the search direction. More... | |
virtual void | initialize (PatchData &pd, MsqError &err) |
Initialize data for smoothing process. More... | |
virtual void | optimize_vertex_positions (PatchData &pd, MsqError &err) |
virtual void | initialize_mesh_iteration (PatchData &pd, MsqError &err) |
virtual void | terminate_mesh_iteration (PatchData &pd, MsqError &err) |
virtual void | cleanup () |
Delete arrays initially created in initialize(). More... | |
double | get_step (PatchData &pd, double f0, int &j, MsqError &err) |
Returns the step distance to take in the search direction. More... | |
Protected Member Functions inherited from VertexMover | |
VertexMover () | |
size_t | check_feasible (PatchData &pd, MsqError &err) |
CHECK FEASIBLE IS NOT YET IMPLEMENTED. More... | |
VertexMover () | |
size_t | check_feasible (PatchData &pd, MsqError &err) |
CHECK FEASIBLE IS NOT YET IMPLEMENTED. More... | |
Protected Member Functions inherited from QualityImprover | |
QualityImprover () | |
const MeshSet * | get_mesh_set () const |
MeshSet * | get_mesh_set () |
void | set_mesh_set (MeshSet *ms) |
TerminationCriterion * | get_outer_termination_criterion () |
return the outer termination criterion pointer More... | |
TerminationCriterion * | get_inner_termination_criterion () |
return the inner termination criterion pointer More... | |
QualityImprover () | |
const MeshSet * | get_mesh_set () const |
MeshSet * | get_mesh_set () |
void | set_mesh_set (MeshSet *ms) |
TerminationCriterion * | get_outer_termination_criterion () |
return the outer termination criterion pointer More... | |
TerminationCriterion * | get_inner_termination_criterion () |
return the inner termination criterion pointer More... | |
Protected Member Functions inherited from PatchDataUser | |
PatchDataUser () | |
PatchDataUser () | |
Private Attributes | |
Vector3D * | fGrad |
Culls the vertex list free_vertex_list. More... | |
Vector3D * | pGrad |
PatchDataVerticesMemento * | pMemento |
Vector3D * | fNewGrad |
int | arraySize |
int | conjGradDebug |
Additional Inherited Members | |
Public Types inherited from PatchDataUser | |
enum | AlgorithmType { QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR, QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR } |
enum | AlgorithmType { QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR, QUALITY_IMPROVER, QUALITY_ASSESSOR, MESH_TRANSFORM, TARGET_CALCULATOR } |
Protected Attributes inherited from VertexMover | |
ObjectiveFunction * | objFunc |
Optimizes the objective function using the Polack-Ribiere scheme.
Definition at line 53 of file includeLinks/ConjugateGradient.hpp.
ConjugateGradient | ( | ObjectiveFunction * | objective, |
MsqError & | err | ||
) |
Definition at line 46 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
References TerminationCriterion::add_criterion_type_with_int(), PatchData::ELEMENTS_ON_VERTEX_PATCH, QualityImprover::get_inner_termination_criterion(), MsqError::INVALID_STATE, MSQ_ERRRTN, MSQ_SETERR, TerminationCriterion::NUMBER_OF_ITERATES, VertexMover::objFunc, ConjugateGradient::set_debugging_level(), QualityImprover::set_name(), and ConjugateGradient::set_patch_type().
|
virtual |
Definition at line 74 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
References ConjugateGradient::fGrad, ConjugateGradient::fNewGrad, ConjugateGradient::pGrad, and ConjugateGradient::pMemento.
ConjugateGradient | ( | ObjectiveFunction * | objective, |
MsqError & | err | ||
) |
|
virtual |
|
protectedvirtual |
Delete arrays initially created in initialize().
Implements VertexMover.
Definition at line 295 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
References ConjugateGradient::fGrad, ConjugateGradient::fNewGrad, ConjugateGradient::pGrad, and ConjugateGradient::pMemento.
|
protectedvirtual |
Delete arrays initially created in initialize().
Implements VertexMover.
Returns the step distance to take in the search direction.
Computes a distance to move vertices given an initial position and search direction (stored in data member pGrad).
Returns alp, the double which scales the search direction vector which when added to the old nodal positions yields the new nodal positions.
Returns alp, the double which scales the search direction vector which when added to the old nodal positions yields the new nodal positions.
Definition at line 314 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
References ObjectiveFunction::evaluate(), MsqError::INVALID_MESH, j, MSQ_ERRZERO, Mesquite::MSQ_MIN, MSQ_PRINT, MSQ_SETERR, PatchData::num_vertices(), VertexMover::objFunc, ConjugateGradient::pGrad, ConjugateGradient::pMemento, PatchData::recreate_vertices_memento(), PatchData::set_free_vertices_constrained(), and PatchData::set_to_vertices_memento().
Referenced by ConjugateGradient::optimize_vertex_positions().
Returns the step distance to take in the search direction.
Initialize data for smoothing process.
Implements VertexMover.
Initialize data for smoothing process.
Implements VertexMover.
Definition at line 83 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
References ConjugateGradient::arraySize, PatchData::create_vertices_memento(), ConjugateGradient::fGrad, ConjugateGradient::fNewGrad, MSQ_DBGOUT, ConjugateGradient::pGrad, and ConjugateGradient::pMemento.
Implements VertexMover.
Definition at line 110 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
Implements VertexMover.
Implements VertexMover.
Performs Conjugate gradient minimization on the PatchData, pd.
Implements VertexMover.
Definition at line 117 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
References TerminationCriterion::accumulate_inner(), TerminationCriterion::accumulate_patch(), ConjugateGradient::arraySize, ObjectiveFunction::compute_gradient(), ConjugateGradient::conjGradDebug, ConjugateGradient::fGrad, ConjugateGradient::fNewGrad, QualityImprover::get_inner_termination_criterion(), ConjugateGradient::get_step(), PatchData::get_vertex_array(), i, MsqError::INVALID_MESH, j, k, Mesquite::Linf(), MSQ_CHKERR, MSQ_DBGOUT, MSQ_ERRRTN, MSQ_FUNCTION_TIMER, Mesquite::MSQ_MAX_CAP, MSQ_PRINT, MSQ_SETERR, MsqFreeVertexIndexIterator::next(), PatchData::num_free_vertices(), PatchData::num_vertices(), VertexMover::objFunc, ConjugateGradient::pGrad, MsqFreeVertexIndexIterator::reset(), Vector3D::set(), Timer::since_birth(), PatchData::snap_vertex_to_domain(), TerminationCriterion::terminate(), and MsqFreeVertexIndexIterator::value().
|
inline |
Just for debugging purposes or for obtaining more data during the optimization process.
Definition at line 65 of file includeLinks/ConjugateGradient.hpp.
References ConjugateGradient::conjGradDebug.
Referenced by ConjugateGradient::ConjugateGradient().
|
inline |
Just for debugging purposes or for obtaining more data during the optimization process.
Definition at line 65 of file src/QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.hpp.
References ConjugateGradient::conjGradDebug.
|
virtual |
Set the patch type.
Reimplemented from PatchDataUser.
|
virtual |
Set the patch type.
Reimplemented from PatchDataUser.
Definition at line 99 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
References PatchData::ELEMENTS_ON_VERTEX_PATCH, PatchData::GLOBAL_PATCH, MsqError::INVALID_ARG, MSQ_SETERR, and PatchDataUser::set_patch_type().
Referenced by ConjugateGradient::ConjugateGradient().
Implements VertexMover.
Definition at line 288 of file QualityImprover/VertexMover/ConjugateGradient/ConjugateGradient.cpp.
Implements VertexMover.
|
private |
Definition at line 96 of file includeLinks/ConjugateGradient.hpp.
Referenced by ConjugateGradient::initialize(), and ConjugateGradient::optimize_vertex_positions().
|
private |
Definition at line 98 of file includeLinks/ConjugateGradient.hpp.
Referenced by ConjugateGradient::optimize_vertex_positions(), and ConjugateGradient::set_debugging_level().
|
private |
Culls the vertex list free_vertex_list.
Definition at line 92 of file includeLinks/ConjugateGradient.hpp.
Referenced by ConjugateGradient::cleanup(), ConjugateGradient::initialize(), ConjugateGradient::optimize_vertex_positions(), and ConjugateGradient::~ConjugateGradient().
|
private |
Definition at line 95 of file includeLinks/ConjugateGradient.hpp.
Referenced by ConjugateGradient::cleanup(), ConjugateGradient::initialize(), ConjugateGradient::optimize_vertex_positions(), and ConjugateGradient::~ConjugateGradient().
|
private |
Definition at line 93 of file includeLinks/ConjugateGradient.hpp.
Referenced by ConjugateGradient::cleanup(), ConjugateGradient::get_step(), ConjugateGradient::initialize(), ConjugateGradient::optimize_vertex_positions(), and ConjugateGradient::~ConjugateGradient().
|
private |
Definition at line 94 of file includeLinks/ConjugateGradient.hpp.
Referenced by ConjugateGradient::cleanup(), ConjugateGradient::get_step(), ConjugateGradient::initialize(), and ConjugateGradient::~ConjugateGradient().