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

Read from dictionary inside new smoother class

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 14, 2020, 05:07
Default Read from dictionary inside new smoother class
  #1
New Member
 
Join Date: Mar 2016
Posts: 3
Rep Power: 10
TommyGun is on a distinguished road
Hi, I'm trying to develop a new smoother. The problem is that inside a smoother class I can't find any object, that has a reference to some dictionary so I am unable to read some parameters of the smoother.

For example the member function smooth for Gauss-Seidel smoother has the folowing arguments:
Code:
void Foam::GaussSeidelSmoother::smooth
(
    const word& fieldName_,
    scalarField& psi,
    const lduMatrix& matrix_,
    const scalarField& source,
    const FieldField<Field, scalar>& interfaceBouCoeffs_,
    const lduInterfaceFieldPtrsList& interfaces_,
    const direction cmpt,
    const label nSweeps
)
Is it somehow possible to read from dictionary inside this class or should I have to implement it as solver which has
Code:
const dictionary& solverControls
as argument in constructor?

Thanks in advance
TommyGun is offline   Reply With Quote

Old   May 20, 2020, 17:55
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 12
HPE is on a distinguished road
Hi,

- Which parameters of the smoother exactly do you want to access?
- If these are `the` parameters of the smoother, I assume they are members of the class? So, do you really need to access the dictionary?
HPE is offline   Reply With Quote

Old   May 21, 2020, 04:13
Default
  #3
New Member
 
Join Date: Mar 2016
Posts: 3
Rep Power: 10
TommyGun is on a distinguished road
It is supposed to be a variable parameter of the smoother, i.e. problem-dependent parameter like relaxation factor. Even if it will be a class member I need to read the actual value from dictionary (or set default one but I want to have a choice).
TommyGun is offline   Reply With Quote

Old   May 22, 2020, 18:08
Default
  #4
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 12
HPE is on a distinguished road
Hi,

- If it is a class member, it is initialised by the constructor or a read() function? so that you can access the dictionary content?
- I am pretty sure, I'm missing something in my understanding. I'm sorry for that.
HPE is offline   Reply With Quote

Reply


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
Field value inside a boundary condition class pcaron OpenFOAM Programming & Development 14 October 17, 2022 09:40
given a volScalarField object, how to read inputs from its dictionary anon_q OpenFOAM Programming & Development 6 August 9, 2019 02:07
Parallel computing error using multiple nodes Jingxue Wang OpenFOAM Running, Solving & CFD 11 January 14, 2018 10:51
How to read a list from a dictionary? ivan_cozza OpenFOAM Programming & Development 6 November 7, 2014 08:31
Phase locked average in run time panara OpenFOAM 2 February 20, 2008 14:37


All times are GMT -4. The time now is 15:13.