62 bool x_matches=
false, f_matches=
false, dxdt_matches=
false;
65 RCP<const VectorSpaceBase<double> > range =
get_A()->range();
66 RCP<const VectorSpaceBase<double> > domain =
get_A()->domain();
69 x_matches = range->isCompatible(*
get_x()->space());
74 dxdt_matches = range->isCompatible(*
get_dxdt()->space());
79 f_matches = range->isCompatible(*
get_f()->space());
85 x_matches =
get_x()->space()->isCompatible(*
get_dxdt()->space());
86 dxdt_matches = x_matches;
89 f_matches = x_matches = dxdt_matches =
true;
92 return x_matches && dxdt_matches && f_matches;
99 using Thyra::PhysicallyBlockedLinearOpBase;
100 using Thyra::ProductVectorSpaceBase;
102 using Teuchos::rcp_dynamic_cast;
104 if(
get_x()!=Teuchos::null) Thyra::assign<double>(
x.ptr(),0.0);
106 if(
get_f()!=Teuchos::null) Thyra::assign<double>(
get_f().ptr(),0.0);
107 if(
get_A()!=Teuchos::null) {
108 RCP<PhysicallyBlockedLinearOpBase<double> > Amat
109 = rcp_dynamic_cast<PhysicallyBlockedLinearOpBase<double> >(
get_A(),
true);
110 RCP<const ProductVectorSpaceBase<double> > range = Amat->productRange();
111 RCP<const ProductVectorSpaceBase<double> > domain = Amat->productDomain();
114 for(
int i=0;i<range->numBlocks();i++) {
115 for(
int j=0;j<domain->numBlocks();j++) {
116 RCP<LinearOpBase<double> > block = Amat->getNonconstBlock(i,j);
117 if(block!=Teuchos::null) {
118 RCP<Epetra_Operator> e_block = Thyra::get_Epetra_Operator(*block);
119 rcp_dynamic_cast<Epetra_CrsMatrix>(e_block,
true)->PutScalar(0.0);
130 using Thyra::PhysicallyBlockedLinearOpBase;
131 using Thyra::ProductVectorSpaceBase;
133 using Teuchos::rcp_dynamic_cast;
135 if(
get_A()!=Teuchos::null) {
136 RCP<PhysicallyBlockedLinearOpBase<double> > Amat
137 = rcp_dynamic_cast<PhysicallyBlockedLinearOpBase<double> >(
get_A(),
true);
138 RCP<const ProductVectorSpaceBase<double> > range = Amat->productRange();
139 RCP<const ProductVectorSpaceBase<double> > domain = Amat->productDomain();
142 for(
int i=0;i<range->numBlocks();i++) {
143 for(
int j=0;j<domain->numBlocks();j++) {
144 RCP<LinearOpBase<double> > block = Amat->getNonconstBlock(i,j);
145 if(block!=Teuchos::null) {
146 RCP<Epetra_Operator> e_block = Thyra::get_Epetra_Operator(*block);
147 rcp_dynamic_cast<Epetra_CrsMatrix>(e_block,
true)->PutScalar(value);