CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

find the hanging pointer ...

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By l_r_mcglashan

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   December 20, 2010, 11:09
Question find the hanging pointer ...
  #1
Senior Member
 
Matthias Voß
Join Date: Mar 2009
Location: Berlin, Germany
Posts: 449
Rep Power: 20
mvoss is on a distinguished road
hi,

this is concerning the very general question about how to find a hanging pointer.
I am working on a MultiRegion-Solver, so i was starting from chtMultiRegionsFoam.

I followed the pattern in the solver
by addressing the pointers first with the appropriate size of the meshRegion with
Code:
PtrList<basicPsiThermo> thermoFluid(fluidRegions.size());
and then setting the pointerlists to the IOobjects by e.g.
Code:
 
Info<< "    Adding to KFluid\n" << endl;
                KFluid.set
                (
                    i,
                    new volScalarField
                    (
                        IOobject
                        (
                            "K",
                            runTime.timeName(),
                            fluidRegions[i],
                            IOobject::NO_READ,
                            IOobject::NO_WRITE
                        ),
                        thermoFluid[i].Cp()*thermoFluid[i].alpha()
                    )
                );
and finally use the local-"region"-variables in the normal manner.
Code:
fvScalarMatrix tEqn
        (
            -fvm::laplacian(K, T)
        );
        tEqn.relax();
        TEqnResidual = tEqn.solve().initialResidual();
Then i added the "solve"-part by including some working header-files.
The code is compiling but i am receiving an ERROR about: hanging pointer, cannot dereference .

So. How to solve this since there are plenty of pointers.
Is there a way to find the "bad" one? I just need some general advice where to search or how to look at that problem ... and maybe solving it the next time on my own.

Thanks in advance...

neewbie
mvoss is offline   Reply With Quote

 

Tags
multiregion, pointer


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
FATAL ERROR hanging pointer cannot dereference tsencic OpenFOAM Running, Solving & CFD 8 January 7, 2021 03:10
Hanging pointer fabianpk OpenFOAM Running, Solving & CFD 8 January 28, 2011 10:29
YPlus nowhere to be find Daniel CFX 3 May 1, 2006 16:22
Can U find this Solution Report N°229 Mohamed FLUENT 5 June 19, 2003 03:28
hanging node Ludovit FLUENT 0 March 26, 2003 12:42


All times are GMT -4. The time now is 08:05.