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

Adding non-static function to Foam::myPCG::solve?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 25, 2017, 14:01
Default Adding non-static function to Foam::myPCG::solve?
  #1
Senior Member
 
Klaus
Join Date: Mar 2009
Posts: 250
Rep Power: 22
klausb will become famous soon enough
Hello,

I get the following compile error:

myPCG.C: In member function ‘virtual Foam::solverPerformance Foam::myPCG::solve(Foam::scalarField&, const scalarField&, Foam::direction) const’:myPCG.C:171:33: error: invalid use of non-static member function ldu2ublas(matrix, ublas_matrix);

Code:
Foam::solverPerformance Foam::myPCG::solve
(
    scalarField& psi,
    const scalarField& source,
    const direction cmpt
) const
{

    // --- Setup class containing solver performance data
    solverPerformance solverPerf
    (
        lduMatrix::preconditioner::getName(controlDict_) + typeName,
        fieldName_
    );

    uint n = psi.size();

    boost::numeric::ublas::compressed_matrix<scalar> ublas_matrix(n,n);

    ldu2ublas(matrix, ublas_matrix);  // error: invalid use of non-static member function 

...
ldu2ublas() is used to store the OpenFoam matrix which has LDU format in CSR format in a boost ublas compressed_matrix.

Where/How must I introduce the function so it can be used in the solve section in PCG.C?

Klaus
klausb is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
conjugateHeatFoam + interFoam farhagim OpenFOAM Programming & Development 15 July 19, 2016 08:55
Adding a new member function to SingleStepCombustion tatu OpenFOAM Programming & Development 1 January 9, 2014 00:54
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 07:42
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 21:50


All times are GMT -4. The time now is 12:54.