1 #include <lifev/core/interpolation/Interpolation.hpp> 17 M_datafile = datafile;
22 Interpolation::
rbf (
double x1,
double y1,
double z1,
double x2,
double y2,
double z2,
double radius)
24 double distance = std::sqrt ( (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) + (z1 - z2)*(z1 - z2) );
25 return (1 - distance / radius) * (1 - distance / radius) * (1 - distance / radius) * (1 - distance / radius) * (4 * distance / radius + 1);
31 M_knownField.reset(
new vector_Type ( *KnownField ) );
32 M_unknownField.reset(
new vector_Type ( *UnknownField ) );
51 int LocalNodesNumber = M_GIdsUnknownMesh.size();
53 std::vector<std::vector<
int>> MatrixGraph (LocalNodesNumber);
54 int* GlobalID =
new int[LocalNodesNumber];
62 for (std::set<ID>::iterator it = M_GIdsUnknownMesh.begin(); it != M_GIdsUnknownMesh.end(); ++it)
66 for (
int j = 0; j < M_xcoord_known.size(); ++j)
68 if ( M_marker_known[j] == M_flag )
70 d = std::sqrt ( ( M_xcoord_known[j] - M_xcoord_unknown[*it] ) * ( M_xcoord_known[j] - M_xcoord_unknown[*it] ) +
71 ( M_ycoord_known[j] - M_ycoord_unknown[*it] ) * ( M_ycoord_known[j] - M_ycoord_unknown[*it] ) +
72 ( M_zcoord_known[j] - M_zcoord_unknown[*it] ) * ( M_zcoord_known[j] - M_zcoord_unknown[*it] ) );
82 MatrixGraph[k] = M_dof_connectivity_known[nearestPoint];
86 M_projectionOperator.reset (
new matrix_Type (*M_projectionOperatorMap, 100) );
90 for (
int i = 0 ; i < LocalNodesNumber; ++i )
92 for (
int it = 0; it < MatrixGraph[i].size(); ++it )
94 Values = rbf ( M_xcoord_unknown[GlobalID[i]],
95 M_ycoord_unknown[GlobalID[i]],
96 M_zcoord_unknown[GlobalID[i]],
97 M_xcoord_known[MatrixGraph[i][it]],
98 M_ycoord_known[MatrixGraph[i][it]],
99 M_zcoord_known[MatrixGraph[i][it]],
102 M_projectionOperator->addToCoefficient( (*M_numerationInterfaceUnknown)( GlobalID[i] ),
103 (*(M_numerationInterfaceKnownColumns[M_pid]))(MatrixGraph[i][it]),
107 M_projectionOperator->globalAssemble (M_interpolationOperatorMap, M_projectionOperatorMap);
116 for (
int i = 0; i < indexes.size(); ++i )
118 r = std::sqrt ( ( M_xcoord_known[index] - M_xcoord_known[indexes[i]] ) * ( M_xcoord_known[index] - M_xcoord_known[indexes[i]] ) +
119 ( M_ycoord_known[index] - M_ycoord_known[indexes[i]] ) * ( M_ycoord_known[index] - M_ycoord_known[indexes[i]] ) +
120 ( M_zcoord_known[index] - M_zcoord_known[indexes[i]] ) * ( M_zcoord_known[index] - M_zcoord_known[indexes[i]] ) );
121 r_max = ( r > r_max ) ? r : r_max;
131 for (
int i = 0; i < indexes.size(); ++i )
133 r = std::sqrt ( ( M_xcoord_unknown[index] - M_xcoord_known[indexes[i]] ) * ( M_xcoord_unknown[index] - M_xcoord_known[indexes[i]] ) +
134 ( M_ycoord_unknown[index] - M_ycoord_known[indexes[i]] ) * ( M_ycoord_unknown[index] - M_ycoord_known[indexes[i]] ) +
135 ( M_zcoord_unknown[index] - M_zcoord_known[indexes[i]] ) * ( M_zcoord_unknown[index] - M_zcoord_known[indexes[i]] ) );
136 r_max = ( r > r_max ) ? r : r_max;
146 int LocalNodesNumber = M_GIdsKnownMesh.size();
148 std::vector<
double> RBF_radius (LocalNodesNumber);
149 std::vector<std::vector<
int>> MatrixGraph (LocalNodesNumber);
150 int* GlobalID =
new int[LocalNodesNumber];
155 for (std::set<ID>::iterator it = M_GIdsKnownMesh.begin(); it != M_GIdsKnownMesh.end(); ++it)
158 MatrixGraph[k] = M_dof_connectivity_known[*it];
165 M_interpolationOperator.reset (
new matrix_Type (*M_interpolationOperatorMap, 100) );
169 M_interpolationOperator->zero();
172 for (
int i = 0 ; i < LocalNodesNumber; ++i )
175 for (
int it = 0; it < MatrixGraph[i].size(); ++it)
177 Values = rbf ( M_xcoord_known[GlobalID[i]],
178 M_ycoord_known[GlobalID[i]],
179 M_zcoord_known[GlobalID[i]],
180 M_xcoord_known[MatrixGraph[i][it]],
181 M_ycoord_known[MatrixGraph[i][it]],
182 M_zcoord_known[MatrixGraph[i][it]],
185 M_interpolationOperator->addToCoefficient( (*M_numerationInterfaceKnown)( GlobalID[i] ),
186 (*(M_numerationInterfaceKnownColumns[M_pid]))(MatrixGraph[i][it]),
191 M_interpolationOperator->globalAssemble();
200 CurrentFEManifold feBd1 ( fespace->refFE().boundaryFE(), getGeometricMap ( *fespace->mesh() ).boundaryMap() );
202 int numBFaces = fespace->mesh()->numBFaces();
203 int numTotalDof = fespace->dof().numTotalDof();
205 std::vector< std::vector<
int> > dof_element_connectivity(numTotalDof);
207 M_marker_known.resize(numTotalDof);
208 M_xcoord_known.resize(numTotalDof);
209 M_ycoord_known.resize(numTotalDof);
210 M_zcoord_known.resize(numTotalDof);
212 for (
int i = 0; i < numBFaces; ++i )
214 if ( fespace->mesh()->boundaryFacet ( i ).markerID() == M_flag )
216 feBd1.update ( fespace->mesh()->boundaryFacet ( i ), UPDATE_ONLY_CELL_NODES );
217 std::vector<ID> localToGlobalMapOnBFacet1 = fespace->dof().localToGlobalMapOnBdFacet (i);
223 for (ID lDof1 = 0; lDof1 < localToGlobalMapOnBFacet1.size(); lDof1++)
225 dof_element_connectivity[localToGlobalMapOnBFacet1[lDof1]].push_back(i);
227 feBd1.coorMap ( M_xcoord_known[localToGlobalMapOnBFacet1[lDof1]],
228 M_ycoord_known[localToGlobalMapOnBFacet1[lDof1]],
229 M_zcoord_known[localToGlobalMapOnBFacet1[lDof1]],
230 feBd1.refFE().xi ( lDof1 ),
231 feBd1.refFE().eta ( lDof1 ) );
234 FaceDof[lDof1] = fespace->mesh()->boundaryFacet ( i ).point ( lDof1 ).markerID ();
238 if ( localToGlobalMapOnBFacet1.size() > 3 )
241 FaceDof[3] = ( FaceDof[0] == FaceDof[1] ) ? FaceDof[0] : M_flag;
242 FaceDof[4] = ( FaceDof[1] == FaceDof[2] ) ? FaceDof[1] : M_flag;
243 FaceDof[5] = ( FaceDof[0] == FaceDof[2] ) ? FaceDof[0] : M_flag;
246 for (ID lDof1 = 0; lDof1 < localToGlobalMapOnBFacet1.size(); lDof1++)
248 M_marker_known[localToGlobalMapOnBFacet1[lDof1]] = FaceDof[lDof1];
249 if ( FaceDof[lDof1] == M_flag )
250 M_GIdsKnownMesh_common.insert(localToGlobalMapOnBFacet1[lDof1]);
255 M_dof_connectivity_known.resize(numTotalDof);
257 for (
int i = 0; i < numTotalDof; ++i )
259 if ( M_marker_known[i] == M_flag)
261 for (
int j = 0; j < numTotalDof; ++j )
263 if ( M_marker_known[j] == M_flag)
265 Real distance = std::sqrt( (M_xcoord_known[i] - M_xcoord_known[j])*(M_xcoord_known[i] - M_xcoord_known[j]) +
266 (M_ycoord_known[i] - M_ycoord_known[j])*(M_ycoord_known[i] - M_ycoord_known[j]) +
267 (M_zcoord_known[i] - M_zcoord_known[j])*(M_zcoord_known[i] - M_zcoord_known[j]) );
270 M_dof_connectivity_known[i].push_back(j);
346 M_marker_unknown.clear();
347 M_xcoord_unknown.clear();
348 M_ycoord_unknown.clear();
349 M_zcoord_unknown.clear();
350 M_marker_known.clear();
351 M_xcoord_known.clear();
352 M_ycoord_known.clear();
353 M_zcoord_known.clear();
354 M_GIdsUnknownMesh_common.clear();
355 M_GIdsKnownMesh_common.clear();
356 M_GIdsKnownMesh.clear();
357 M_GIdsUnknownMesh.clear();
363 CurrentFEManifold feBd1 ( fespace->refFE().boundaryFE(), getGeometricMap ( *fespace->mesh() ).boundaryMap() );
365 int numBFaces = fespace->mesh()->numBFaces();
366 int numTotalDof = fespace->dof().numTotalDof();
368 std::vector< std::vector<
int> > dof_element_connectivity(numTotalDof);
370 M_marker_unknown.resize(numTotalDof);
371 M_xcoord_unknown.resize(numTotalDof);
372 M_ycoord_unknown.resize(numTotalDof);
373 M_zcoord_unknown.resize(numTotalDof);
375 for (
int i = 0; i < numBFaces; ++i )
377 if ( fespace->mesh()->boundaryFacet ( i ).markerID() == M_flag )
379 feBd1.update ( fespace->mesh()->boundaryFacet ( i ), UPDATE_ONLY_CELL_NODES );
380 std::vector<ID> localToGlobalMapOnBFacet1 = fespace->dof().localToGlobalMapOnBdFacet (i);
386 for (ID lDof1 = 0; lDof1 < localToGlobalMapOnBFacet1.size(); lDof1++)
388 dof_element_connectivity[localToGlobalMapOnBFacet1[lDof1]].push_back(i);
390 feBd1.coorMap ( M_xcoord_unknown[localToGlobalMapOnBFacet1[lDof1]],
391 M_ycoord_unknown[localToGlobalMapOnBFacet1[lDof1]],
392 M_zcoord_unknown[localToGlobalMapOnBFacet1[lDof1]],
393 feBd1.refFE().xi ( lDof1 ),
394 feBd1.refFE().eta ( lDof1 ) );
397 FaceDof[lDof1] = fespace->mesh()->boundaryFacet ( i ).point ( lDof1 ).markerID ();
400 if ( localToGlobalMapOnBFacet1.size() > 3 )
403 FaceDof[3] = ( FaceDof[0] == FaceDof[1] ) ? FaceDof[0] : M_flag;
404 FaceDof[4] = ( FaceDof[1] == FaceDof[2] ) ? FaceDof[1] : M_flag;
405 FaceDof[5] = ( FaceDof[0] == FaceDof[2] ) ? FaceDof[0] : M_flag;
408 for (ID lDof1 = 0; lDof1 < localToGlobalMapOnBFacet1.size(); lDof1++)
410 M_marker_unknown[localToGlobalMapOnBFacet1[lDof1]] = FaceDof[lDof1];
411 if ( FaceDof[lDof1] == M_flag )
412 M_GIdsUnknownMesh_common.insert(localToGlobalMapOnBFacet1[lDof1]);
451 for (std::set<ID>::iterator it = M_GIdsKnownMesh_common.begin(); it != M_GIdsKnownMesh_common.end(); ++it)
453 if ( M_knownField->mapPtr()->map(Unique)->LID(
static_cast<EpetraInt_Type> ( *it ) ) >= 0 )
455 M_GIdsKnownMesh.insert(*it);
463 for (std::set<ID>::iterator it = M_GIdsUnknownMesh_common.begin(); it != M_GIdsUnknownMesh_common.end(); ++it)
465 if ( M_unknownField->mapPtr()->map(Unique)->LID(
static_cast<EpetraInt_Type> ( *it ) ) >= 0 )
467 M_GIdsUnknownMesh.insert(*it);
475 std::vector<
int> dofKnown;
476 dofKnown.reserve ( M_GIdsKnownMesh.size() );
478 std::set<ID>::const_iterator i;
480 for (UInt dim = 0; dim < nDimensions; ++dim)
481 for ( i = M_GIdsKnownMesh.begin(); i != M_GIdsKnownMesh.end(); ++i )
483 dofKnown.push_back ( *i + dim * M_knownField->size()/nDimensions );
486 int* pointerToDofs (0);
487 if (dofKnown.size() > 0)
489 pointerToDofs = &dofKnown[0];
492 M_knownInterfaceMap.reset (
new MapEpetra ( -1,
static_cast<
int> (dofKnown.size() ), pointerToDofs, M_knownField->mapPtr()->commPtr() ) );
501 std::vector<
int> dofunKnown;
502 dofunKnown.reserve ( M_GIdsUnknownMesh.size() );
504 std::set<ID>::const_iterator i;
506 for (UInt dim = 0; dim < nDimensions; ++dim)
507 for ( i = M_GIdsUnknownMesh.begin(); i != M_GIdsUnknownMesh.end(); ++i )
509 dofunKnown.push_back ( *i + dim * M_unknownField->size()/nDimensions );
512 int* pointerToDofs (0);
513 if (dofunKnown.size() > 0)
515 pointerToDofs = &dofunKnown[0];
518 M_unknownInterfaceMap.reset (
new MapEpetra ( -1,
static_cast<
int> (dofunKnown.size() ), pointerToDofs, M_unknownField->mapPtr()->commPtr() ) );
526 std::set<ID>::const_iterator ITrow;
528 Int numtasks = M_knownField->mapPtr()->commPtr()->NumProc();
529 int* numInterfaceDof (
new int[numtasks]);
530 int pid = M_knownField->mapPtr()->commPtr()->MyPID();
534 numMyElements = M_knownInterfaceMap->map (Unique)->NumMyElements();
535 numInterfaceDof[pid] = numMyElements;
538 subMap.reset (
new map_Type ( *M_knownInterfaceMap->map (Unique), (UInt) 0, M_knownField->size()/nDimensions) );
540 M_numerationInterfaceKnown.reset (
new VectorEpetra (*subMap, Unique) );
542 for (
int j = 0; j < numtasks; ++j)
544 M_knownField->mapPtr()->commPtr()->Broadcast ( &numInterfaceDof[j], 1, j);
547 for (
int j = numtasks - 1; j > 0 ; --j)
549 numInterfaceDof[j] = numInterfaceDof[j - 1];
551 numInterfaceDof[0] = 0;
552 for (
int j = 1; j < numtasks ; ++j)
554 numInterfaceDof[j] += numInterfaceDof[j - 1];
559 Real M_interface = (UInt) M_knownInterfaceMap->map (Unique)->NumGlobalElements() / nDimensions;
560 for (l = 0, ITrow = M_GIdsKnownMesh.begin(); ITrow != M_GIdsKnownMesh.end() ; ++ITrow)
562 if (M_knownInterfaceMap->map (Unique)->LID (
static_cast<EpetraInt_Type> (*ITrow) ) >= 0)
564 (*M_numerationInterfaceKnown) [*ITrow ] = l + (
int) (numInterfaceDof[pid] / nDimensions);
565 if ( (
int) (*M_numerationInterfaceKnown) (*ITrow ) != floor (l + numInterfaceDof[pid] / nDimensions + 0.2) )
567 std::cout <<
"ERROR! the numeration of the coupling map is not correct" << std::endl;
573 M_numerationInterfaceKnownColumns.resize(numtasks);
575 for (
int j = 0; j < numtasks ; ++j)
576 (M_numerationInterfaceKnownColumns[j]).reset(
new vector_Type ( *M_numerationInterfaceKnown, j ) );
578 std::vector<
int> couplingVector;
579 couplingVector.reserve ( (
int) (M_knownInterfaceMap->map (Unique)->NumMyElements() ) );
581 for ( ITrow = M_GIdsKnownMesh.begin(); ITrow != M_GIdsKnownMesh.end() ; ++ITrow)
583 if (M_knownInterfaceMap->map (Unique)->LID (
static_cast<EpetraInt_Type> (*ITrow) ) >= 0)
585 couplingVector.push_back ( (*M_numerationInterfaceKnown) (*ITrow ) );
589 M_interpolationOperatorMap.reset (
new MapEpetra (-1,
static_cast< Int> ( couplingVector.size() ), &couplingVector[0], M_knownField->mapPtr()->commPtr() ) );
591 M_interpolationOperatorMapVectorial.reset (
new MapEpetra ( *M_interpolationOperatorMap ) );
592 *M_interpolationOperatorMapVectorial += *M_interpolationOperatorMap;
593 *M_interpolationOperatorMapVectorial += *M_interpolationOperatorMap;
597 delete [] numInterfaceDof;
603 std::set<ID>::const_iterator ITrow;
605 Int numtasks = M_unknownField->mapPtr()->commPtr()->NumProc();
606 int* numInterfaceDof (
new int[numtasks]);
607 int pid = M_unknownField->mapPtr()->commPtr()->MyPID();
610 numMyElements = M_unknownInterfaceMap->map (Unique)->NumMyElements();
611 numInterfaceDof[pid] = numMyElements;
614 subMap.reset (
new map_Type ( *M_unknownInterfaceMap->map (Unique), (UInt) 0, M_unknownField->size()/nDimensions) );
616 M_numerationInterfaceUnknown.reset (
new VectorEpetra (*subMap, Unique) );
618 for (
int j = 0; j < numtasks; ++j)
620 M_unknownField->mapPtr()->commPtr()->Broadcast ( &numInterfaceDof[j], 1, j);
623 for (
int j = numtasks - 1; j > 0 ; --j)
625 numInterfaceDof[j] = numInterfaceDof[j - 1];
627 numInterfaceDof[0] = 0;
628 for (
int j = 1; j < numtasks ; ++j)
630 numInterfaceDof[j] += numInterfaceDof[j - 1];
635 Real M_interface = (UInt) M_unknownInterfaceMap->map (Unique)->NumGlobalElements() / nDimensions;
636 for (l = 0, ITrow = M_GIdsUnknownMesh.begin(); ITrow != M_GIdsUnknownMesh.end() ; ++ITrow)
638 if (M_unknownInterfaceMap->map (Unique)->LID (
static_cast<EpetraInt_Type> (*ITrow) ) >= 0)
640 (*M_numerationInterfaceUnknown) [*ITrow ] = l + (
int) (numInterfaceDof[pid] / nDimensions);
641 if ( (
int) (*M_numerationInterfaceUnknown) (*ITrow ) != floor (l + numInterfaceDof[pid] / nDimensions + 0.2) )
643 std::cout <<
"ERROR! the numeration of the coupling map is not correct" << std::endl;
649 std::vector<
int> couplingVector;
650 couplingVector.reserve ( (
int) (M_unknownInterfaceMap->map (Unique)->NumMyElements() ) );
652 for ( ITrow = M_GIdsUnknownMesh.begin(); ITrow != M_GIdsUnknownMesh.end() ; ++ITrow)
654 if (M_unknownInterfaceMap->map (Unique)->LID (
static_cast<EpetraInt_Type> (*ITrow) ) >= 0)
656 couplingVector.push_back ( (*M_numerationInterfaceUnknown) (*ITrow ) );
660 M_projectionOperatorMap.reset (
new MapEpetra (-1,
static_cast< Int> ( couplingVector.size() ), &couplingVector[0], M_unknownField->mapPtr()->commPtr() ) );
662 M_projectionOperatorMapVectorial.reset (
new MapEpetra ( *M_projectionOperatorMap ) );
663 *M_projectionOperatorMapVectorial += *M_projectionOperatorMap;
664 *M_projectionOperatorMapVectorial += *M_projectionOperatorMap;
666 delete [] numInterfaceDof;
672 M_RhsOne.reset (
new vector_Type (*M_interpolationOperatorMap) );
675 M_RhsF1.reset (
new vector_Type (*M_interpolationOperatorMap) );
676 M_RhsF2.reset (
new vector_Type (*M_interpolationOperatorMap) );
677 M_RhsF3.reset (
new vector_Type (*M_interpolationOperatorMap) );
679 UInt offset = M_knownField->size()/3;
681 for(
int i = 0; i < M_numerationInterfaceKnown->epetraVector().MyLength(); ++i)
683 (*M_RhsF1)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)]]
684 = (*M_knownField)(M_numerationInterfaceKnown->blockMap().GID(i));
686 (*M_RhsF2)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)]]
687 = (*M_knownField)(M_numerationInterfaceKnown->blockMap().GID(i) + offset);
689 (*M_RhsF3)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)]]
690 = (*M_knownField)(M_numerationInterfaceKnown->blockMap().GID(i) + 2*offset);
701 gamma_one.reset (
new vector_Type (*M_interpolationOperatorMap) );
707 precRawPtr->setDataFromGetPot ( M_datafile,
"prec" );
708 precPtr.reset ( precRawPtr );
711 solverOne.setCommunicator ( M_knownField->mapPtr()->commPtr() );
712 solverOne.setParameters ( *M_belosList );
719 M_rbf_one.reset (
new vector_Type (*M_projectionOperatorMap) );
720 M_projectionOperator->multiply (
false, *gamma_one, *M_rbf_one);
726 vectorOnOmega.reset (
new vector_Type ( M_knownField->map(), Unique ) );
727 vectorOnOmega->zero();
729 UInt offset = vectorOnOmega->map().map(Unique)->NumGlobalElements()/3;
730 UInt offsetGamma = vectorOnGamma->map().map(Unique)->NumGlobalElements()/3;
732 for(
int i = 0; i < M_numerationInterfaceKnown->epetraVector().MyLength(); ++i)
734 (*vectorOnOmega)[M_numerationInterfaceKnown->blockMap().GID(i)]
735 = (*vectorOnGamma)((*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)]);
737 (*vectorOnOmega)[M_numerationInterfaceKnown->blockMap().GID(i) + offset]
738 = (*vectorOnGamma)((*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)] + offsetGamma );
740 (*vectorOnOmega)[M_numerationInterfaceKnown->blockMap().GID(i) + 2*offset]
741 = (*vectorOnGamma)((*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)] + 2*offsetGamma);
751 vectorOnGamma.reset (
new vector_Type ( *M_interpolationOperatorMapVectorial, Unique ) );
752 vectorOnGamma->zero();
754 UInt offset = vectorOnOmega->map().map(Unique)->NumGlobalElements()/3;
755 UInt offsetGamma = vectorOnGamma->map().map(Unique)->NumGlobalElements()/3;
757 for (
int i = 0; i < M_numerationInterfaceKnown->epetraVector().MyLength(); ++i )
759 (*vectorOnGamma)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)]]
760 = (*vectorOnOmega)(M_numerationInterfaceKnown->blockMap().GID(i));
762 (*vectorOnGamma)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)] + offsetGamma ]
763 = (*vectorOnOmega)(M_numerationInterfaceKnown->blockMap().GID(i) + offset);
765 (*vectorOnGamma)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)] + 2*offsetGamma ]
766 = (*vectorOnOmega)(M_numerationInterfaceKnown->blockMap().GID(i) + 2*offset);
777 gamma_f1.reset (
new vector_Type (*M_interpolationOperatorMap) );
780 gamma_f2.reset (
new vector_Type (*M_interpolationOperatorMap) );
783 gamma_f3.reset (
new vector_Type (*M_interpolationOperatorMap) );
790 precRawPtr->setDataFromGetPot ( M_datafile,
"prec" );
791 M_precPtr.reset ( precRawPtr );
797 solverRBF1.setCommunicator ( M_knownField->mapPtr()->commPtr() );
798 solverRBF1.setParameters ( *M_belosList );
807 solverRBF2.setCommunicator ( M_knownField->mapPtr()->commPtr() );
808 solverRBF2.setParameters ( *M_belosList );
817 solverRBF3.setCommunicator ( M_knownField->mapPtr()->commPtr() );
818 solverRBF3.setParameters ( *M_belosList );
826 rbf_f1.reset (
new vector_Type (*M_projectionOperatorMap) );
829 solution1.reset (
new vector_Type (*M_projectionOperatorMap) );
831 M_projectionOperator->multiply (
false, *gamma_f1, *rbf_f1);
834 *solution1 = *rbf_f1;
835 *solution1 /= *M_rbf_one;
838 rbf_f2.reset (
new vector_Type (*M_projectionOperatorMap) );
841 solution2.reset (
new vector_Type (*M_projectionOperatorMap) );
843 M_projectionOperator->multiply (
false, *gamma_f2, *rbf_f2);
846 *solution2 = *rbf_f2;
847 *solution2 /= *M_rbf_one;
850 rbf_f3.reset (
new vector_Type (*M_projectionOperatorMap) );
853 solution3.reset (
new vector_Type (*M_projectionOperatorMap) );
855 M_projectionOperator->multiply (
false, *gamma_f3, *rbf_f3);
858 *solution3 = *rbf_f3;
859 *solution3 /= *M_rbf_one;
863 UInt offset = M_unknownField->size()/3;
865 for(
int i = 0; i < M_numerationInterfaceUnknown->epetraVector().MyLength(); ++i)
867 (*M_unknownField)[M_numerationInterfaceUnknown->blockMap().GID(i)]
868 = (*solution1)((*M_numerationInterfaceUnknown)[M_numerationInterfaceUnknown->blockMap().GID(i)]);
870 (*M_unknownField)[M_numerationInterfaceUnknown->blockMap().GID(i) + offset]
871 = (*solution2)((*M_numerationInterfaceUnknown)[M_numerationInterfaceUnknown->blockMap().GID(i)]);
873 (*M_unknownField)[M_numerationInterfaceUnknown->blockMap().GID(i) + 2*offset]
874 = (*solution3)((*M_numerationInterfaceUnknown)[M_numerationInterfaceUnknown->blockMap().GID(i)]);
882 M_solutionOnGamma.reset (
new vector_Type ( *M_projectionOperatorMapVectorial ) );
883 M_solutionOnGamma->zero();
885 UInt offsetScalar = M_solutionOnGamma->size()/3;
887 M_solutionOnGamma->subset(*solution1, *M_projectionOperatorMap, 0, 0);
888 M_solutionOnGamma->subset(*solution2, *M_projectionOperatorMap, 0, offsetScalar );
889 M_solutionOnGamma->subset(*solution3, *M_projectionOperatorMap, 0, 2*offsetScalar);
896 *Solution += *M_unknownField;
906 UInt offset = M_knownField->size()/3;
908 for(
int i = 0; i < M_numerationInterfaceKnown->epetraVector().MyLength(); ++i)
910 (*M_RhsF1)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)]]
911 = (*newRhs)(M_numerationInterfaceKnown->blockMap().GID(i));
913 (*M_RhsF2)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)]]
914 = (*newRhs)(M_numerationInterfaceKnown->blockMap().GID(i) + offset);
916 (*M_RhsF3)[(*M_numerationInterfaceKnown)[M_numerationInterfaceKnown->blockMap().GID(i)]]
917 = (*newRhs)(M_numerationInterfaceKnown->blockMap().GID(i) + 2*offset);
void identifyNodes_known()
std::shared_ptr< vector_Type > vectorPtr_Type
void solution(vectorPtr_Type &Solution)
double computeRBFradius_unknown(const ID &index, std::vector< int > indexes)
void interpolationOperator()
void buildInterpolationOperatorMap()
A class for a finite element on a manifold.
Teuchos::RCP< Teuchos::ParameterList > parameterList_Type
void buildKnownInterfaceMap()
void buildTableDofs_unknown(const FESpacePtr_Type &fespace)
int32_type Int
Generic integer data.
void updateInverseJacobian(const UInt &iQuadPt)
void setVectors(const vectorPtr_Type &KnownField, const vectorPtr_Type &UnknownField)
matrixPtr_Type M_interpolationOperator
LinearSolver - Class to wrap linear solver.
void projectionOperator()
void setOperator(operatorPtr_Type operPtr)
Method to set a general linear operator (of class derived from Epetra_Operator) defining the linear s...
std::shared_ptr< MapEpetra > mapPtr_Type
void setRightHandSide(const vectorPtr_Type rhsPtr)
Method to set the right hand side (rhs) of the linear system.
LifeV::PreconditionerIfpack prec_Type
void buildProjectionOperatorMap()
std::shared_ptr< basePrec_Type > basePrecPtr_Type
parameterList_Type M_belosList
double Real
Generic real data.
double computeRBFradius_known(const ID &index, std::vector< int > indexes)
void setPreconditioner(operatorPtr_Type preconditionerPtr)
Method to set a general Epetra_Operator as preconditioner.
void setup(const GetPot &datafile, parameterList_Type belosList)
void buildTableDofs_known(const FESpacePtr_Type &fespace)
std::shared_ptr< FESpace_Type > FESpacePtr_Type
void updateRhs(const vectorPtr_Type &newRhs)
void identifyNodes_unknown()
double rbf(double x1, double y1, double z1, double x2, double y2, double z2, double radius)
void buildUnknownInterfaceMap()
void expandGammaToOmega_Known(const vectorPtr_Type &vectorOnGamma, vectorPtr_Type &vectorOnOmega)
Int solve(vectorPtr_Type solutionPtr)
Solves the system and returns the number of iterations.
void interpolateCostantField()
basePrecPtr_Type M_precPtr
uint32_type UInt
generic unsigned integer (used mainly for addressing)
void restrictOmegaToGamma_Known(const vectorPtr_Type &vectorOnOmega, vectorPtr_Type &vectorOnGamma)