Skip to content

Commit

Permalink
LCM: fixing issue #107 (matrix-free with no DTK seg faults) by changing
Browse files Browse the repository at this point in the history
setting of x_, xdot_, etc. using copy constructor from xT, xdotT, etc., rather
than setting pointers equal to each other.  With this fix, getX() returns a valid
pointer to a Tpetra_Vector, for which get1DView() works.
  • Loading branch information
ikalash committed Apr 13, 2017
1 parent 89991f5 commit 9cebedc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Albany_Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,9 +1263,12 @@ computeGlobalResidualImplT(
#if defined(ALBANY_LCM)
// Store pointers to solution and time derivatives.
// Needed for Schwarz coupling.
x_ = xT;
xdot_ = xdotT;
xdotdot_ = xdotdotT;
if (xT != Teuchos::null) x_ = Teuchos::rcp(new Tpetra_Vector(*xT));
else x_ = Teuchos::null;
if (xdotT != Teuchos::null) xdot_ = Teuchos::rcp(new Tpetra_Vector(*xdotT));
else xdot_ = Teuchos::null;
if (xdotdotT != Teuchos::null) xdotdot_ = Teuchos::rcp(new Tpetra_Vector(*xdotdotT));
else xdotdot_ = Teuchos::null;
#endif

// Mesh motion needs to occur here on the global mesh befor
Expand Down

0 comments on commit 9cebedc

Please sign in to comment.