10 #ifndef MUELU_SEMICOARSENPFACTORY_DEF_HPP
11 #define MUELU_SEMICOARSENPFACTORY_DEF_HPP
17 #include <Xpetra_CrsMatrixWrap.hpp>
20 #include <Xpetra_MultiVectorFactory.hpp>
31 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
35 #define SET_VALID_ENTRY(name) validParamList->setEntry(name, MasterList::getEntry(name))
40 #undef SET_VALID_ENTRY
45 validParamList->
set<
RCP<const FactoryBase> >(
"LineDetection_VertLineIds", Teuchos::null,
"Generating factory for LineDetection vertical line ids");
46 validParamList->
set<
RCP<const FactoryBase> >(
"LineDetection_Layers", Teuchos::null,
"Generating factory for LineDetection layer ids");
47 validParamList->
set<
RCP<const FactoryBase> >(
"CoarseNumZLayers", Teuchos::null,
"Generating factory for number of coarse z-layers");
49 return validParamList;
52 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
54 Input(fineLevel,
"A");
55 Input(fineLevel,
"Nullspace");
57 Input(fineLevel,
"LineDetection_VertLineIds");
58 Input(fineLevel,
"LineDetection_Layers");
59 Input(fineLevel,
"CoarseNumZLayers");
67 bTransferCoordinates_ =
true;
69 }
else if (bTransferCoordinates_ ==
true) {
74 if (myCoordsFact == Teuchos::null) {
83 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
85 return BuildP(fineLevel, coarseLevel);
88 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
94 RCP<MultiVector> fineNullspace = Get<RCP<MultiVector> >(fineLevel,
"Nullspace");
98 LO CoarsenRate = as<LO>(pL.get<
int>(
"semicoarsen: coarsen rate"));
99 bool buildRestriction = pL.get<
bool>(
"semicoarsen: calculate nonsym restriction");
100 bool doLinear = pL.get<
bool>(
"semicoarsen: piecewise linear");
103 LO BlkSize = A->GetFixedBlockSize();
105 LO Ndofs = rowMap->getLocalNumElements();
106 LO Nnodes = Ndofs / BlkSize;
109 LO FineNumZLayers = Get<LO>(fineLevel,
"CoarseNumZLayers");
110 Teuchos::ArrayRCP<LO> TVertLineId = Get<Teuchos::ArrayRCP<LO> >(fineLevel,
"LineDetection_VertLineIds");
113 LO* LayerId = TLayerId.getRawPtr();
119 GO Ncoarse = MakeSemiCoarsenP(Nnodes, FineNumZLayers, CoarsenRate, LayerId, VertLineId,
120 BlkSize, A, P, theCoarseMap, fineNullspace, coarseNullspace, R, buildRestriction, doLinear);
123 if (A->IsView(
"stridedMaps") ==
true)
124 P->CreateView(
"stridedMaps", A->getRowMap(
"stridedMaps"), theCoarseMap);
126 P->CreateView(
"stridedMaps", P->getRangeMap(), theCoarseMap);
128 if (buildRestriction) {
129 if (A->IsView(
"stridedMaps") ==
true)
130 R->CreateView(
"stridedMaps", theCoarseMap, A->getRowMap(
"stridedMaps"));
132 R->CreateView(
"stridedMaps", theCoarseMap, R->getDomainMap());
134 if (pL.get<
bool>(
"semicoarsen: piecewise constant")) {
136 RevertToPieceWiseConstant(P, BlkSize);
138 if (pL.get<
bool>(
"semicoarsen: piecewise linear")) {
147 LO CoarseNumZLayers = FineNumZLayers * Ncoarse;
148 CoarseNumZLayers /= Ndofs;
152 Set(coarseLevel,
"P", P);
153 if (buildRestriction) Set(coarseLevel,
"RfromPfactory", R);
155 Set(coarseLevel,
"Nullspace", coarseNullspace);
158 if (bTransferCoordinates_) {
161 if (fineLevel.GetLevelID() == 0 &&
166 if (myCoordsFact == Teuchos::null) {
167 myCoordsFact = fineLevel.GetFactoryManager()->GetFactory(
"Coordinates");
169 if (fineLevel.IsAvailable(
"Coordinates", myCoordsFact.
get())) {
170 fineCoords = fineLevel.Get<
RCP<xdMV> >(
"Coordinates", myCoordsFact.
get());
184 for (
auto it = z.
begin(); it != z.
end(); ++it) {
185 if (*it > zval_max) zval_max = *it;
186 if (*it < zval_min) zval_min = *it;
189 LO myCoarseZLayers = Teuchos::as<LO>(CoarseNumZLayers);
192 if (myCoarseZLayers == 1) {
193 myZLayerCoords[0] = zval_min;
196 for (LO k = 0; k < myCoarseZLayers; ++k) {
197 myZLayerCoords[k] = k * dz;
205 LO numVertLines = Nnodes / FineNumZLayers;
206 LO numLocalCoarseNodes = numVertLines * myCoarseZLayers;
209 MapFactory::Build(fineCoords->getMap()->lib(),
211 Teuchos::as<size_t>(numLocalCoarseNodes),
212 fineCoords->getMap()->getIndexBase(),
213 fineCoords->getMap()->getComm());
215 coarseCoords->putScalar(-1.0);
221 LO cntCoarseNodes = 0;
222 for (LO vt = 0; vt < TVertLineId.size(); ++vt) {
224 LO curVertLineId = TVertLineId[vt];
226 if (cx[curVertLineId * myCoarseZLayers] == -1.0 &&
227 cy[curVertLineId * myCoarseZLayers] == -1.0) {
229 for (LO n = 0; n < myCoarseZLayers; ++n) {
230 cx[curVertLineId * myCoarseZLayers + n] = x[vt];
231 cy[curVertLineId * myCoarseZLayers + n] = y[vt];
232 cz[curVertLineId * myCoarseZLayers + n] = myZLayerCoords[n];
234 cntCoarseNodes += myCoarseZLayers;
238 if (cntCoarseNodes == numLocalCoarseNodes)
break;
242 Set(coarseLevel,
"Coordinates", coarseCoords);
246 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
277 NCpts = (
LO)ceil(temp);
279 NCpts = (
LO)floor(temp);
283 if (NCpts < 1) NCpts = 1;
293 for (i = 1; i <= NCpts; i++) {
294 (*LayerCpts)[i] = (
LO)floor(di);
301 #define MaxHorNeighborNodes 75
303 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
359 int NLayers, NVertLines, MaxNnz, NCLayers, MyLine, MyLayer;
360 int *InvLineLayer = NULL, *CptLayers = NULL, StartLayer, NStencilNodes;
361 int BlkRow = -1, dof_j, node_k, *Sub2FullMap = NULL, RowLeng;
362 int i, j, iii, col, count, index, loc, PtRow, PtCol;
363 SC *BandSol = NULL, *BandMat = NULL, TheSum, *RestrictBandMat = NULL, *RestrictBandSol = NULL;
364 int *IPIV = NULL, KL, KU, KLU, N, NRHS, LDAB, INFO;
371 int MaxStencilSize, MaxNnzPerRow;
373 int CurRow, LastGuy = -1, NewPtr, RLastGuy = -1;
376 LO *Layerdofs = NULL, *Col2Dof = NULL;
391 Nghost = Amat->getColMap()->getLocalNumElements() - Amat->getDomainMap()->getLocalNumElements();
392 if (Nghost < 0) Nghost = 0;
402 for (i = 0; i < Ntotal * DofsPerNode; i++)
403 valptr[i] = LayerId[i / DofsPerNode];
407 importer = Amat->getCrsGraph()->getImporter();
408 if (importer == Teuchos::null) {
409 importer = ImportFactory::Build(Amat->getDomainMap(), Amat->getColMap());
413 valptr = dtemp->getDataNonConst(0);
414 for (i = 0; i < Ntotal * DofsPerNode + Nghost; i++) Layerdofs[i] = valptr[i];
415 valptr = localdtemp->getDataNonConst(0);
416 for (i = 0; i < Ntotal * DofsPerNode; i++) valptr[i] = i % DofsPerNode;
420 valptr = dtemp->getDataNonConst(0);
421 for (i = 0; i < Ntotal * DofsPerNode + Nghost; i++) Col2Dof[i] = valptr[i];
425 NLayers = LayerId[0];
426 NVertLines = VertLineId[0];
432 for (i = 1; i < Ntotal; i++) {
433 if (VertLineId[i] > NVertLines) NVertLines = VertLineId[i];
434 if (LayerId[i] > NLayers) NLayers = LayerId[i];
445 InvLineLayer = TInvLineLayer.
getRawPtr();
446 for (i = 0; i < Ntotal; i++) {
447 InvLineLayer[VertLineId[i] + 1 + LayerId[i] * NVertLines] = i;
456 NCLayers = FindCpts(nz, CoarsenRate, 0, &CptLayers);
468 MaxStencilSize = CptLayers[2];
470 for (i = 3; i <= NCLayers; i++) {
471 if (MaxStencilSize < CptLayers[i] - CptLayers[i - 2])
472 MaxStencilSize = CptLayers[i] - CptLayers[i - 2];
475 if (MaxStencilSize < nz - CptLayers[NCLayers - 1] + 1)
476 MaxStencilSize = nz - CptLayers[NCLayers - 1] + 1;
488 Teuchos::ArrayRCP<SC> TBandSol = Teuchos::arcp<SC>((MaxStencilSize + 1) * DofsPerNode * DofsPerNode);
491 if (buildRestriction) {
492 TResBandSol = Teuchos::arcp<SC>((MaxStencilSize + 1) * DofsPerNode * DofsPerNode);
493 RestrictBandSol = TResBandSol.
getRawPtr();
498 KL = 2 * DofsPerNode - 1;
499 KU = 2 * DofsPerNode - 1;
501 LDAB = 2 * KL + KU + 1;
509 if (buildRestriction) {
510 TResBandMat = Teuchos::arcp<SC>(LDAB * MaxStencilSize * DofsPerNode + 1);
511 RestrictBandMat = TResBandMat.
getRawPtr();
521 Ndofs = DofsPerNode * Ntotal;
522 MaxNnz = 2 * DofsPerNode * Ndofs;
527 std::vector<size_t> stridingInfo_;
528 stridingInfo_.push_back(DofsPerNode);
531 coarseMap = StridedMapFactory::Build(rowMap->lib(),
533 NCLayers * NVertLines * DofsPerNode,
542 P =
rcp(
new CrsMatrixWrap(rowMap, coarseMap, 0));
543 coarseNullspace = MultiVectorFactory::Build(coarseMap, fineNullspace->getNumVectors());
559 LO RmaxNnz = -1, RmaxPerRow = -1;
560 if (buildRestriction) {
561 RmaxPerRow = ((
LO)ceil(((
double)(MaxNnz + 7)) / ((double)(coarseMap->getLocalNumElements()))));
562 RmaxNnz = RmaxPerRow * coarseMap->getLocalNumElements();
563 TRvals = Teuchos::arcp<SC>(1 + RmaxNnz);
565 TRptr = Teuchos::arcp<size_t>((2 + coarseMap->getLocalNumElements()));
567 TRcols = Teuchos::arcp<LO>(1 + RmaxNnz);
579 for (i = 1; i <= MaxNnz; i++) Pcols[i] = -1;
581 for (i = 1; i <= DofsPerNode * Ntotal + 1; i++) {
583 count += (2 * DofsPerNode);
585 if (buildRestriction) {
586 for (i = 1; i <= RmaxNnz; i++) Rcols[i] = -1;
588 for (i = 1; i <= (int)(coarseMap->getLocalNumElements() + 1); i++) {
602 for (MyLine = 1; MyLine <= NVertLines; MyLine += 1) {
603 for (iii = 1; iii <= NCLayers; iii += 1) {
605 MyLayer = CptLayers[iii];
619 StartLayer = CptLayers[iii - 1] + 1;
624 NStencilNodes = CptLayers[iii + 1] - StartLayer;
626 NStencilNodes = NLayers - StartLayer + 1;
628 N = NStencilNodes * DofsPerNode;
635 for (i = 0; i < NStencilNodes * DofsPerNode * DofsPerNode; i++) BandSol[i] = 0.0;
636 for (i = 0; i < LDAB * N; i++) BandMat[i] = 0.0;
637 if (buildRestriction) {
638 for (i = 0; i < NStencilNodes * DofsPerNode * DofsPerNode; i++) RestrictBandSol[i] = 0.0;
639 for (i = 0; i < LDAB * N; i++) RestrictBandMat[i] = 0.0;
648 for (node_k = 1; node_k <= NStencilNodes; node_k++) {
653 BlkRow = InvLineLayer[MyLine + (StartLayer + node_k - 2) * NVertLines] + 1;
654 Sub2FullMap[node_k] = BlkRow;
667 for (
int dof_i = 0; dof_i < DofsPerNode; dof_i++) {
668 j = (BlkRow - 1) * DofsPerNode + dof_i;
671 Amat->getLocalRowView(j, AAcols, AAvals);
674 RowLeng = AAvals.
size();
678 for (i = 0; i < RowLeng; i++) {
679 LayDiff[i] = Layerdofs[Acols[i]] - StartLayer - node_k + 2;
687 PtRow = (node_k - 1) * DofsPerNode + dof_i + 1;
688 for (dof_j = 0; dof_j < DofsPerNode; dof_j++) {
689 PtCol = (node_k - 1) * DofsPerNode + dof_j + 1;
693 for (i = 0; i < RowLeng; i++) {
694 if ((LayDiff[i] == 0) && (Col2Dof[Acols[i]] == dof_j))
697 index = LDAB * (PtCol - 1) + KLU + PtRow - PtCol;
698 BandMat[index] = TheSum;
699 if (buildRestriction) RestrictBandMat[index] = TheSum;
700 if (node_k != NStencilNodes) {
704 for (i = 0; i < RowLeng; i++) {
705 if ((LayDiff[i] == 1) && (Col2Dof[Acols[i]] == dof_j))
708 j = PtCol + DofsPerNode;
709 index = LDAB * (j - 1) + KLU + PtRow - j;
710 BandMat[index] = TheSum;
711 if (buildRestriction) RestrictBandMat[index] = TheSum;
717 for (i = 0; i < RowLeng; i++) {
718 if ((LayDiff[i] == -1) && (Col2Dof[Acols[i]] == dof_j))
721 j = PtCol - DofsPerNode;
722 index = LDAB * (j - 1) + KLU + PtRow - j;
723 BandMat[index] = TheSum;
724 if (buildRestriction) RestrictBandMat[index] = TheSum;
729 node_k = MyLayer - StartLayer + 1;
730 for (
int dof_i = 0; dof_i < DofsPerNode; dof_i++) {
733 PtRow = (node_k - 1) * DofsPerNode + dof_i + 1;
734 BandSol[(dof_i)*DofsPerNode * NStencilNodes + PtRow - 1] = 1.;
735 if (buildRestriction) RestrictBandSol[(dof_i)*DofsPerNode * NStencilNodes + PtRow - 1] = 1.;
737 for (dof_j = 0; dof_j < DofsPerNode; dof_j++) {
738 PtCol = (node_k - 1) * DofsPerNode + dof_j + 1;
739 index = LDAB * (PtCol - 1) + KLU + PtRow - PtCol;
741 BandMat[index] = 1.0;
743 BandMat[index] = 0.0;
744 if (buildRestriction) {
745 index = LDAB * (PtRow - 1) + KLU + PtCol - PtRow;
747 RestrictBandMat[index] = 1.0;
749 RestrictBandMat[index] = 0.0;
751 if (node_k != NStencilNodes) {
752 PtCol = (node_k)*DofsPerNode + dof_j + 1;
753 index = LDAB * (PtCol - 1) + KLU + PtRow - PtCol;
754 BandMat[index] = 0.0;
755 if (buildRestriction) {
756 index = LDAB * (PtRow - 1) + KLU + PtCol - PtRow;
757 RestrictBandMat[index] = 0.0;
761 PtCol = (node_k - 2) * DofsPerNode + dof_j + 1;
762 index = LDAB * (PtCol - 1) + KLU + PtRow - PtCol;
763 BandMat[index] = 0.0;
764 if (buildRestriction) {
765 index = LDAB * (PtRow - 1) + KLU + PtCol - PtRow;
766 RestrictBandMat[index] = 0.0;
774 lapack.
GBTRF(N, N, KL, KU, BandMat, LDAB, IPIV, &INFO);
778 lapack.
GBTRS(notrans[0], N, KL, KU, NRHS, BandMat, LDAB, IPIV,
783 for (dof_j = 0; dof_j < DofsPerNode; dof_j++) {
784 for (
int dof_i = 0; dof_i < DofsPerNode; dof_i++) {
785 for (i = 1; i <= NStencilNodes; i++) {
786 index = (Sub2FullMap[i] - 1) * DofsPerNode + dof_i + 1;
788 Pcols[loc] = (col - 1) * DofsPerNode + dof_j + 1;
789 Pvals[loc] = BandSol[dof_j * DofsPerNode * NStencilNodes +
790 (i - 1) * DofsPerNode + dof_i];
791 Pptr[index] = Pptr[index] + 1;
795 if (buildRestriction) {
796 lapack.
GBTRF(N, N, KL, KU, RestrictBandMat, LDAB, IPIV, &INFO);
798 lapack.
GBTRS(trans[0], N, KL, KU, NRHS, RestrictBandMat, LDAB, IPIV, RestrictBandSol, N, &INFO);
800 for (dof_j = 0; dof_j < DofsPerNode; dof_j++) {
801 for (
int dof_i = 0; dof_i < DofsPerNode; dof_i++) {
802 for (i = 1; i <= NStencilNodes; i++) {
803 index = (col - 1) * DofsPerNode + dof_j + 1;
805 Rcols[loc] = (Sub2FullMap[i] - 1) * DofsPerNode + dof_i + 1;
806 Rvals[loc] = RestrictBandSol[dof_j * DofsPerNode * NStencilNodes +
807 (i - 1) * DofsPerNode + dof_i];
808 Rptr[index] = Rptr[index] + 1;
814 int denom1 = MyLayer - StartLayer + 1;
815 int denom2 = StartLayer + NStencilNodes - MyLayer;
816 for (
int dof_i = 0; dof_i < DofsPerNode; dof_i++) {
817 for (i = 1; i <= NStencilNodes; i++) {
818 index = (InvLineLayer[MyLine + (StartLayer + i - 2) * NVertLines]) * DofsPerNode + dof_i + 1;
820 Pcols[loc] = (col - 1) * DofsPerNode + dof_i + 1;
822 Pvals[loc] = 1.0 + ((double)(denom1 - i)) / ((
double)denom2);
824 Pvals[loc] = ((double)(i)) / ((
double)denom1);
825 Pptr[index] = Pptr[index] + 1;
833 BlkRow = InvLineLayer[MyLine + (MyLayer - 1) * NVertLines] + 1;
834 for (
int k = 0; k < static_cast<int>(fineNullspace->getNumVectors()); k++) {
837 for (
int dof_i = 0; dof_i < DofsPerNode; dof_i++) {
838 OneCNull[(col - 1) * DofsPerNode + dof_i] = OneFNull[(BlkRow - 1) * DofsPerNode + dof_i];
853 for (
size_t ii = 1; ii <= Pptr[Ntotal * DofsPerNode] - 1; ii++) {
854 if (ii == Pptr[CurRow]) {
855 Pptr[CurRow] = LastGuy;
857 while (ii > Pptr[CurRow]) {
858 Pptr[CurRow] = LastGuy;
862 if (Pcols[ii] != -1) {
863 Pcols[NewPtr - 1] = Pcols[ii] - 1;
864 Pvals[NewPtr - 1] = Pvals[ii];
869 for (i = CurRow; i <= Ntotal * DofsPerNode; i++) Pptr[CurRow] = LastGuy;
874 for (i = -Ntotal * DofsPerNode + 1; i >= 2; i--) {
875 Pptr[i - 1] = Pptr[i - 2];
880 if (buildRestriction) {
883 for (
size_t ii = 1; ii <= Rptr[coarseMap->getLocalNumElements()] - 1; ii++) {
884 if (ii == Rptr[CurRow]) {
885 Rptr[CurRow] = RLastGuy;
887 while (ii > Rptr[CurRow]) {
888 Rptr[CurRow] = RLastGuy;
892 if (Rcols[ii] != -1) {
893 Rcols[NewPtr - 1] = Rcols[ii] - 1;
894 Rvals[NewPtr - 1] = Rvals[ii];
899 for (i = CurRow; i <= ((int)coarseMap->getLocalNumElements()); i++) Rptr[CurRow] = RLastGuy;
900 for (i = -coarseMap->getLocalNumElements() + 1; i >= 2; i--) {
901 Rptr[i - 1] = Rptr[i - 2];
909 RCP<CrsMatrix> PCrs = rcp_dynamic_cast<CrsMatrixWrap>(P)->getCrsMatrix();
910 LO nnz = Pptr[Ndofs];
911 PCrs->allocateAllValues(nnz, rcpRowPtr, rcpColumns, rcpValues);
919 for (
LO ii = 0; ii <= Ndofs; ii++) rowPtr[ii] = Pptr[ii];
920 for (
LO ii = 0; ii < nnz; ii++) columns[ii] = Pcols[ii];
921 for (
LO ii = 0; ii < nnz; ii++) values[ii] = Pvals[ii];
922 PCrs->setAllValues(rcpRowPtr, rcpColumns, rcpValues);
923 PCrs->expertStaticFillComplete(coarseMap, Amat->getDomainMap());
928 if (buildRestriction) {
929 R =
rcp(
new CrsMatrixWrap(coarseMap, rowMap, 0));
930 RCrs = rcp_dynamic_cast<CrsMatrixWrap>(R)->getCrsMatrix();
931 nnz = Rptr[coarseMap->getLocalNumElements()];
932 RCrs->allocateAllValues(nnz, RrcpRowPtr, RrcpColumns, RrcpValues);
940 for (
LO ii = 0; ii <= ((
LO)coarseMap->getLocalNumElements()); ii++) RrowPtr[ii] = Rptr[ii];
941 for (
LO ii = 0; ii < nnz; ii++) Rcolumns[ii] = Rcols[ii];
942 for (
LO ii = 0; ii < nnz; ii++) Rvalues[ii] = Rvals[ii];
943 RCrs->setAllValues(RrcpRowPtr, RrcpColumns, RrcpValues);
944 RCrs->expertStaticFillComplete(Amat->getRangeMap(), coarseMap);
947 return NCLayers * NVertLines * DofsPerNode;
949 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
963 for (
size_t i = 0; i < P->getRowMap()->getLocalNumElements(); i++) {
964 P->getLocalRowView(i, inds, vals1);
966 size_t nnz = inds.
size();
969 LO largestIndex = -1;
970 Scalar largestValue = ZERO;
973 LO rowDof = i % BlkSize;
974 for (
size_t j = 0; j < nnz; j++) {
976 if (inds[j] % BlkSize == rowDof) {
977 largestValue = vals[j];
978 largestIndex = (int)j;
983 if (largestIndex != -1)
984 vals[largestIndex] = ONE;
994 #define MUELU_SEMICOARSENPFACTORY_SHORT
995 #endif // MUELU_SEMICOARSENPFACTORY_DEF_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
Timer to be used in factories. Similar to Monitor but with additional timers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void DeclareInput(Level &fineLevel, Level &coarseLevel) const
Input.
void GBTRF(const OrdinalType &m, const OrdinalType &n, const OrdinalType &kl, const OrdinalType &ku, ScalarType *A, const OrdinalType &lda, OrdinalType *IPIV, OrdinalType *info) const
ParameterList & set(std::string const &name, T &&value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
LO MakeSemiCoarsenP(LO const Ntotal, LO const nz, LO const CoarsenRate, LO const LayerId[], LO const VertLineId[], LO const DofsPerNode, RCP< Matrix > &Amat, RCP< Matrix > &P, RCP< const Map > &coarseMap, const RCP< MultiVector > fineNullspace, RCP< MultiVector > &coarseNullspace, RCP< Matrix > &R, bool buildRestriction, bool doLinear) const
void Build(Level &fineLevel, Level &coarseLevel) const
Build an object with this factory.
static const NoFactory * get()
void RevertToPieceWiseConstant(RCP< Matrix > &P, LO BlkSize) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
MueLu::DefaultScalar Scalar
void BuildP(Level &fineLevel, Level &coarseLevel) const
Abstract Build method.
Class that holds all level-specific information.
LO FindCpts(LO const PtsPerLine, LO const CoarsenRate, LO const Thin, LO **LayerCpts) const
void Set(const std::string &ename, const T &entry, const FactoryBase *factory=NoFactory::get())
static RCP< Vector > Build(const Teuchos::RCP< const Map > &map, bool zeroOut=true)
void GBTRS(const char &TRANS, const OrdinalType &n, const OrdinalType &kl, const OrdinalType &ku, const OrdinalType &nrhs, const ScalarType *A, const OrdinalType &lda, const OrdinalType *IPIV, ScalarType *B, const OrdinalType &ldb, OrdinalType *info) const
#define SET_VALID_ENTRY(name)
#define MaxHorNeighborNodes
const RCP< const FactoryManagerBase > GetFactoryManager()
returns the current factory manager
int GetLevelID() const
Return level number.
Exception throws to report errors in the internal logical of the program.
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()
bool IsAvailable(const std::string &ename, const FactoryBase *factory=NoFactory::get()) const
Test whether a need's value has been saved.