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

Create new member variable for lduMatrix

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 13, 2017, 05:39
Default Create new member variable for lduMatrix
  #1
New Member
 
Join Date: Dec 2017
Posts: 1
Rep Power: 0
FabianL is on a distinguished road
Hello everybody,
I try to create a new member variable for the lduMatrix class. For test purposes I want to count the number of lduMatrix objects. Therefore I added the line

int number;

in the public section of lduMatrix.H.
In the constructor Foam::lduMatrix::ludMatrix(const lduMesh& mesh) in lduMatrix.C I added the following lines

static int count=0;
count++;
number=count;


In order to see which Matrices have been initialized, I added the line

cout<<"number: "<<matrix_.number<<endl;

in GaussSeidelSmoother.C.

The output is a little bit confusing. The first lines look like this:
number: 0
number: 0
number: 0
number: 0
number: 0
number: 0
number: 20
number: 19
number: 13
number: 17
.
.
.
number: 0
number: 0
number: 0
number: 0

How is it possible, that number equals 0? With my implementation in lduMatrix.C the lowest digit for number should be 1. Therefore I conclude, that Matrix objects have to be initialized by a another way than Foam::lduMatrix::ludMatrix(const lduMesh& mesh), but where?

Can somebody tell me, why "number: 0" is printed and how to fix my problem.

Thank you in advance
FabianL is offline   Reply With Quote

Reply

Tags
ldumatrix


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
Compiling dynamicTopoFvMesh for OpenFOAM 2.1.x Saxwax OpenFOAM Installation 25 November 29, 2013 06:34
OpenFoam-1.6-ext Allwmake compilation error - one last barrier Pat84 OpenFOAM Installation 15 July 25, 2012 22:49
Condensation as an additional variable Clark Griswold CFX 2 April 21, 2012 08:20
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 05:35
[OpenFOAM] LibvtkFoamso fred ParaView 2 November 18, 2005 20:01


All times are GMT -4. The time now is 18:55.