v0.16.3
Loading...
Searching...
No Matches
Functions | Variables
tao_null_space.cpp File Reference

Test null-space TAO optimization of a scaled epigraph constraint. More...

#include <MoFEM.hpp>
#include <limits>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Variables

static char help []
 

Detailed Description

Test null-space TAO optimization of a scaled epigraph constraint.

Definition in file tao_null_space.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 775 of file tao_null_space.cpp.

775 {
776 MoFEM::Core::Initialize(&argc, &argv, nullptr, help);
777 try {
779 PetscBool activation = PETSC_FALSE, domain = PETSC_FALSE,
780 domain_budget = PETSC_FALSE, flow = PETSC_FALSE,
781 flow_budget = PETSC_FALSE;
782 CHKERR PetscOptionsGetBool(nullptr, nullptr, "-test_nullspace_activation",
783 &activation, nullptr);
784 CHKERR PetscOptionsGetBool(nullptr, nullptr, "-test_nullspace_domain",
785 &domain, nullptr);
786 CHKERR PetscOptionsGetBool(nullptr, nullptr,
787 "-test_nullspace_domain_budget", &domain_budget,
788 nullptr);
789 CHKERR PetscOptionsGetBool(nullptr, nullptr, "-test_nullspace_flow", &flow,
790 nullptr);
791 CHKERR PetscOptionsGetBool(nullptr, nullptr, "-test_nullspace_flow_budget",
792 &flow_budget, nullptr);
793 if (activation) {
794 CHKERR checkCandidateActivation();
795 } else if (domain_budget) {
796 CHKERR checkObjectiveDomainLineSearch(true);
797 } else if (domain) {
798 CHKERR checkObjectiveDomainLineSearch(false);
799 } else if (flow || flow_budget) {
800 CHKERR checkAlgorithmOneStep(flow_budget);
801 } else {
802 const std::array<std::array<PetscScalar, 3>, 3> starts = {
803 {{1, 1, 3}, {3, 4, 2}, {1, 1, 6}}};
804 for (const auto scale : {1.0, 0.1, 10.0})
805 for (size_t i = 0; i != starts.size(); ++i)
806 CHKERR solveProblem(starts[i], scale, i != 1);
807 }
808 }
811 return 0;
812}
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
MoFEMErrorCode TaoRegisterNullSpace()
double scale
Definition plastic.cpp:124
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
static char help[]

Variable Documentation

◆ help

char help[]
static
Initial value:
=
"Test the null-space TAO solver on an epigraph problem.\n\n"

Definition at line 10 of file tao_null_space.cpp.