MOAB: Mesh Oriented datABase  (version 5.4.1)
FauxObjectiveFunction Class Reference
+ Inheritance diagram for FauxObjectiveFunction:
+ Collaboration diagram for FauxObjectiveFunction:

Public Member Functions

 FauxObjectiveFunction (double value, bool invalid=false, bool error=false)
 ~FauxObjectiveFunction ()
bool initialize_block_coordinate_descent (MeshDomainAssoc *, const Settings *, PatchSet *, MsqError &)
 Initial accumulated value for block coordinate descent algorithms.
bool evaluate (EvalType, PatchData &, double &value_out, bool, MsqError &err)
 Evaluate objective function for specified patch.
ObjectiveFunctionclone () const
 Create copy with same state.
void clear ()
int min_patch_layers () const
void initialize_queue (MeshDomainAssoc *, const Settings *, MsqError &)
 Called at start of instruction queue processing.
double get_value () const

Static Public Member Functions

static int get_instance_count ()

Private Attributes

double mValue
bool mInvalid
bool mError

Static Private Attributes

static int instanceCount = 0

Detailed Description

Fake ObjectiveFunction to pass to Composite OFs

Definition at line 54 of file CompositeOFTest.cpp.


Constructor & Destructor Documentation

FauxObjectiveFunction::FauxObjectiveFunction ( double  value,
bool  invalid = false,
bool  error = false 
) [inline]

Definition at line 57 of file CompositeOFTest.cpp.

        : mValue( value ), mInvalid( invalid ), mError( error )
    {
        ++instanceCount;
    }

Definition at line 62 of file CompositeOFTest.cpp.

    {
        --instanceCount;
    }

Member Function Documentation

void FauxObjectiveFunction::clear ( ) [inline, virtual]

Clear any values accumulated for BCD-related eval calls

Implements MBMesquite::ObjectiveFunction.

Definition at line 82 of file CompositeOFTest.cpp.

{}
ObjectiveFunction* FauxObjectiveFunction::clone ( ) const [inline, virtual]

Create copy with same state.

Create a new instance of the objective function that is a copy of the callee with the same accumulated values, parameters, etc.

Implements MBMesquite::ObjectiveFunction.

Definition at line 77 of file CompositeOFTest.cpp.

    {
        ++instanceCount;
        return new FauxObjectiveFunction( *this );
    }
bool FauxObjectiveFunction::evaluate ( EvalType  type,
PatchData pd,
double &  value_out,
bool  free,
MsqError err 
) [inline, virtual]

Evaluate objective function for specified patch.

Either evaluate the objective function over the passed patch or update the accumulated, global objective function value for changes in the passed patch, depending on the value of the EvalType.

Parameters:
typeEvaluation type.
pdThe patch.
value_outThe passed-back value of the objective fuction.
freeIf true, incorporate the quality metric values only for those metric evaluations that depend on at least one free vertex
Returns:
false if any QualityMetric evaluation returned false, true otherwise.

Implements MBMesquite::ObjectiveFunction.

Definition at line 71 of file CompositeOFTest.cpp.

References INTERNAL_ERROR, and MSQ_SETERR.

    {
        if( mError ) MSQ_SETERR( err )( MsqError::INTERNAL_ERROR );
        value_out = mValue;
        return !mInvalid;
    }
static int FauxObjectiveFunction::get_instance_count ( ) [inline, static]

Definition at line 94 of file CompositeOFTest.cpp.

Referenced by CompositeOFTest::test_composite_clone().

    {
        return instanceCount;
    }
double FauxObjectiveFunction::get_value ( ) const [inline]

Definition at line 90 of file CompositeOFTest.cpp.

    {
        return mValue;
    }
bool FauxObjectiveFunction::initialize_block_coordinate_descent ( MeshDomainAssoc mesh_and_domain,
const Settings settings,
PatchSet user_set,
MsqError err 
) [inline, virtual]

Initial accumulated value for block coordinate descent algorithms.

Set accumulated value of objective function to the value for the entire, unmodified mesh. This is the initial state for a block coordinate descent algorithm. The ObjectiveFunction will asked to add or remove values for a specific patch of the mesh during the optimization.

Parameters:
meshThe Mesh
domainThe MeshDomain
user_setUser-defined patch set - not relevant for most OF templates.

Implements MBMesquite::ObjectiveFunction.

Definition at line 66 of file CompositeOFTest.cpp.

    {
        CPPUNIT_ASSERT_MESSAGE( "This shouldn't ever get called", false );
        return false;
    }
void FauxObjectiveFunction::initialize_queue ( MeshDomainAssoc mesh_and_domain,
const Settings settings,
MsqError err 
) [inline, virtual]

Called at start of instruction queue processing.

Do any preliminary global initialization, consistency checking, etc. This function is pure-virtual (abstract) in this class because every practical OF implementation at this time should have an implementation that at least recursively calls the same function on the underlying QualityMetric or ObjectiveFunction(s).

Implements MBMesquite::ObjectiveFunction.

Definition at line 88 of file CompositeOFTest.cpp.

{}
int FauxObjectiveFunction::min_patch_layers ( ) const [inline, virtual]

Get the minimum number of layers of adjacent elements required in a patch to evaluate the objective function for a single free vertex.

Implements MBMesquite::ObjectiveFunction.

Definition at line 83 of file CompositeOFTest.cpp.

    {
        return 0;
    }

Member Data Documentation

int FauxObjectiveFunction::instanceCount = 0 [static, private]

Definition at line 102 of file CompositeOFTest.cpp.

Definition at line 101 of file CompositeOFTest.cpp.

Definition at line 101 of file CompositeOFTest.cpp.

Definition at line 100 of file CompositeOFTest.cpp.

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines