30 bool x_matches=
false, f_matches=
false, dxdt_matches=
false;
33 RCP<const VectorSpaceBase<double> > range =
get_A()->range();
34 RCP<const VectorSpaceBase<double> > domain =
get_A()->domain();
37 x_matches = range->isCompatible(*
get_x()->space());
42 dxdt_matches = range->isCompatible(*
get_dxdt()->space());
47 f_matches = range->isCompatible(*
get_f()->space());
53 x_matches =
get_x()->space()->isCompatible(*
get_dxdt()->space());
54 dxdt_matches = x_matches;
57 f_matches = x_matches = dxdt_matches =
true;
60 return x_matches && dxdt_matches && f_matches;
67 using Thyra::PhysicallyBlockedLinearOpBase;
68 using Thyra::ProductVectorSpaceBase;
70 using Teuchos::rcp_dynamic_cast;
72 if(
get_x()!=Teuchos::null) Thyra::assign<double>(
x.ptr(),0.0);
74 if(
get_f()!=Teuchos::null) Thyra::assign<double>(
get_f().ptr(),0.0);
75 if(
get_A()!=Teuchos::null) {
76 RCP<PhysicallyBlockedLinearOpBase<double> > Amat
77 = rcp_dynamic_cast<PhysicallyBlockedLinearOpBase<double> >(
get_A(),
true);
78 RCP<const ProductVectorSpaceBase<double> > range = Amat->productRange();
79 RCP<const ProductVectorSpaceBase<double> > domain = Amat->productDomain();
82 for(
int i=0;i<range->numBlocks();i++) {
83 for(
int j=0;j<domain->numBlocks();j++) {
84 RCP<LinearOpBase<double> > block = Amat->getNonconstBlock(i,j);
85 if(block!=Teuchos::null) {
86 RCP<Epetra_Operator> e_block = Thyra::get_Epetra_Operator(*block);
87 rcp_dynamic_cast<Epetra_CrsMatrix>(e_block,
true)->PutScalar(0.0);
98 using Thyra::PhysicallyBlockedLinearOpBase;
99 using Thyra::ProductVectorSpaceBase;
101 using Teuchos::rcp_dynamic_cast;
103 if(
get_A()!=Teuchos::null) {
104 RCP<PhysicallyBlockedLinearOpBase<double> > Amat
105 = rcp_dynamic_cast<PhysicallyBlockedLinearOpBase<double> >(
get_A(),
true);
106 RCP<const ProductVectorSpaceBase<double> > range = Amat->productRange();
107 RCP<const ProductVectorSpaceBase<double> > domain = Amat->productDomain();
110 for(
int i=0;i<range->numBlocks();i++) {
111 for(
int j=0;j<domain->numBlocks();j++) {
112 RCP<LinearOpBase<double> > block = Amat->getNonconstBlock(i,j);
113 if(block!=Teuchos::null) {
114 RCP<Epetra_Operator> e_block = Thyra::get_Epetra_Operator(*block);
115 rcp_dynamic_cast<Epetra_CrsMatrix>(e_block,
true)->PutScalar(value);