42 #include "NLPInterfacePack_ExampleBasisSystem.hpp"
43 #include "AbstractLinAlgPack_MatrixSymDiagStd.hpp"
44 #include "AbstractLinAlgPack_MatrixComposite.hpp"
45 #include "AbstractLinAlgPack_VectorStdOps.hpp"
46 #include "Teuchos_AbstractFactoryStd.hpp"
47 #include "Teuchos_dyn_cast.hpp"
48 #include "Teuchos_Assert.hpp"
50 namespace NLPInterfacePack {
52 ExampleBasisSystem::ExampleBasisSystem(
53 const VectorSpace::space_ptr_t &space_x
57 :BasisSystemComposite(
61 ,space_x->sub_space(var_dep)
63 new Teuchos::AbstractFactoryStd<MatrixOpNonsing,MatrixSymDiagStd>())
65 new Teuchos::AbstractFactoryStd<MatrixSymOp,MatrixSymDiagStd>())
67 new Teuchos::AbstractFactoryStd<MatrixSymOpNonsing,MatrixSymDiagStd>())
69 new Teuchos::AbstractFactoryStd<MatrixOp,MatrixSymDiagStd>())
74 const VectorSpace::space_ptr_t &space_x
79 namespace mmp = MemMngPack;
81 space_x.get() == NULL, std::invalid_argument
82 ,
"ExampleBasisSystem::initialize(...) : Error, space_x must be specified!"
84 BasisSystemComposite::initialize(
88 ,space_x->sub_space(var_dep)
97 const MatrixOpNonsing &C
106 D == NULL, std::logic_error
107 ,
"ExampleBasisSystem::update_D(...): Error!" );
109 const MatrixSymDiagStd
110 &C_aggr =
dyn_cast<
const MatrixSymDiagStd>(C),
111 &N_aggr = dyn_cast<const MatrixSymDiagStd>(N);
113 &D_sym_diag =
dyn_cast<MatrixSymDiagStd>(*D);
114 if( D_sym_diag.rows() != C.rows() )
115 D_sym_diag.initialize(
116 this->space_x()->sub_space(this->
var_dep())->create_member()
119 -1.0, N_aggr.diag(), C_aggr.diag(), &D_sym_diag.diag() );
void update_D(const MatrixOpNonsing &C, const MatrixOp &N, MatrixOp *D, EMatRelations mat_rel) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
T_To & dyn_cast(T_From &from)
void ele_wise_divide(const value_type &alpha, const Vector &v_rhs1, const Vector &v_rhs2, VectorMutable *v_lhs)
void initialize(const VectorSpace::space_ptr_t &space_x, const Range1D &var_dep, const Range1D &var_indep)
Initialize given the vector space for the dependent and independent variables.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)