Skip to content

Commit

Permalink
MueLu MatrixLoad: Allow to read in coordinates, nullspace, material i…
Browse files Browse the repository at this point in the history
…ndependently of matrix

Signed-off-by: Christian Glusa <[email protected]>
  • Loading branch information
cgcgcg committed Jan 21, 2025
1 parent 1ab92df commit 8488365
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions packages/muelu/test/scaling/MatrixLoad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,23 +180,29 @@ void MatrixLoad(Teuchos::RCP<const Teuchos::Comm<int> >& comm, Xpetra::Underlyin
}

comm->barrier();
}

if (!coordFile.empty()) {
RCP<TimeMonitor> tm = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("Driver: 1c - Read coordinates")));
RCP<const Map> coordMap;
if (!coordMapFile.empty())
coordMap = Xpetra::IO<SC, LO, GO, Node>::ReadMap(coordMapFile, lib, comm);
else
coordMap = map;
coordinates = Xpetra::IO<real_type, LO, GO, Node>::ReadMultiVector(coordFile, coordMap);
comm->barrier();
}
if (!coordFile.empty()) {
RCP<TimeMonitor> tm = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("Driver: 1c - Read coordinates")));
RCP<const Map> coordMap;
if (!coordMapFile.empty())
coordMap = Xpetra::IO<SC, LO, GO, Node>::ReadMap(coordMapFile, lib, comm);
else
coordMap = map;
coordinates = Xpetra::IO<real_type, LO, GO, Node>::ReadMultiVector(coordFile, coordMap);
comm->barrier();
}

if (!nullFile.empty())
nullspace = Xpetra::IO<SC, LO, GO, Node>::ReadMultiVector(nullFile, map);
if (!nullFile.empty()) {
RCP<TimeMonitor> tm = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("Driver: 1d - Read nullspace")));
nullspace = Xpetra::IO<SC, LO, GO, Node>::ReadMultiVector(nullFile, map);
comm->barrier();
}

if (!materialFile.empty())
material = Xpetra::IO<SC, LO, GO, Node>::ReadMultiVector(materialFile, map);
if (!materialFile.empty()) {
RCP<TimeMonitor> tm = rcp(new TimeMonitor(*TimeMonitor::getNewTimer("Driver: 1e - Read material")));
material = Xpetra::IO<SC, LO, GO, Node>::ReadMultiVector(materialFile, map);
comm->barrier();
}

X = MultiVectorFactory::Build(map, numVectors);
Expand Down

0 comments on commit 8488365

Please sign in to comment.