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

Is there a global container where all Function1 are stored?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 10, 2020, 04:32
Default Is there a global container where all Function1 are stored?
  #1
Member
 
Join Date: Jun 2011
Location: Germany
Posts: 59
Rep Power: 14
Siassei is on a distinguished road
Hello,

for a plugin I need an way to manipulate a Function1<scalar> value each time step. I knowing the type of Function1, the patches of interesset and the boundary condition.

BC: externalWallHeatFluxTemperatureFvPatchScalarField
The function1 for the heat flux is stored in local private member q_. The function1 is of type constant for that example.

The way as shown in followed code is not possible. So, perhaps it is a global storage of all Function1-Objects with corresponding patchIds.
Do have OpenFOAM an global Function1-Storage?

Code:
// get T field
auto T_ = const_cast<volScalarField*>(&mesh.lookupObject<volScalarField>(nameTField))

// get bc for path with Id
auto bPatch = refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(T_->boundaryField()[patchID]);

// how to access the q_ Function1<...> of patch ...?
bPatch.q_[0] = 1.0;
Siassei 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
pimpleDyMFoam computation randomly stops babapeti OpenFOAM Running, Solving & CFD 5 January 24, 2018 05:28
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 02:50
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 18:07


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