Just Launched: You can now import projects and releases from Google Code onto SourceForge
We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps. Read More
From: Karen Lee <kylkaren@gm...> - 2010-12-02 00:44:11
I'm trying to change the preconditioner and solver types of
linear_solver that exists in a LinearImplicitSystem object, and I'm
having some trouble with getting access to linear_solver of the
LinearSolver within a LinearImplicitSystem object.
1) I have no problem getting fe pointed to by an AutoPtr.
Even this declaration is giving me problems:
AutoPtr <LinearSolver<Real>> test_aptr;
Error as follows (the above is in line 167, and I did not get the
other 3 warnings if I take the above line out. line 196 has nothing to
do with LinearSolver):
warning: possible problem detected in invocation of delete operator:
warning: invalid use of undefined type ‘struct LinearSolver<Number>’
warning: declaration of ‘struct LinearSolver<Number>’
note: neither the destructor nor the class-specific operator delete
will be called, even if they are declared when the class is defined.
2) I looked at linear_implicit_system.h, but did not find
get_linear_solver () there (or in linear_implicit_system.C).
According to the class docs online, it should be there... How do I
access the object with the right type so that I can call
set_preconditioner_type (PRECOND_type) and set_solver_type
From: Roy Stogner <roystgnr@ic...> - 2010-12-02 02:20:18
On Wed, 1 Dec 2010, Karen Lee wrote:
> warning: possible problem detected in invocation of delete operator:
> warning: invalid use of undefined type ‘struct LinearSolver<Number>’
There are a lot of forward declarations in our headers. That means
that in user code you need to be sure to include precisely the header
that defines each class, and not rely on that definition being
included indirectly. In particular, AutoPtr<LinearSolver<T> > won't
work unless you've included linear_solver.h, because AutoPtr tries to
inline a call to delete which needs a defined destructor.
> 2) I looked at linear_implicit_system.h, but did not find
> get_linear_solver () there (or in linear_implicit_system.C).
It's declared in linear_implicit_system.h line 119, defined in
linear_implicit_system.C lines 351-354.