|
[Sponsors] |
March 28, 2018, 04:13 |
Class word
|
#1 |
New Member
Jose
Join Date: Dec 2017
Location: Madrid
Posts: 6
Rep Power: 8 |
Dear all,
I'm trying to code a solver where some boundaries are moved according to the solution, and I need the user to specify in a file NumericalParameters the names of the patches whose nodes will be displaced. I do this with the following piece of code in createFields.H: Code:
IOdictionary numericalParameters ( IOobject ( "numericalParameters", runTime.constant(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ) ); scalar gamma(readScalar(numericalParameters.lookup("gamma"))); label incount(readLabel(numericalParameters.lookup("incount"))); wordList movingPatches(numericalParameters.lookup("movingPatches")); Code:
forAll(movingPatches,i) { const word& patchName = movingPatches[i]; label patchID = mesh.boundaryMesh().findPatchID(patchName); // Extra code } Code:
label patchID = mesh.boundaryMesh().findPatchID(patchName); Thank you in advance.
__________________
Jose |
|
April 3, 2018, 04:32 |
|
#2 |
Member
|
Hi,
It would be useful if you could post the error as well. My guess is that the word list is not stored properly. Can you access all of the patches? Code:
forAll(movingPatches,i) { const word& patchName = movingPatches[i]; Info << "patch name = " << patchName << endl; } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' | muth | OpenFOAM Running, Solving & CFD | 3 | August 27, 2018 04:18 |
error with reactingFoam | BakedAlmonds | OpenFOAM Running, Solving & CFD | 4 | June 22, 2016 02:21 |
The udf.h headers are unable to open- in VISUAL STUDIO 13 | sanjeetlimbu | Fluent UDF and Scheme Programming | 4 | May 2, 2016 05:38 |
Run time Selection Mechanism - Some help required to understand | jaswi | OpenFOAM Programming & Development | 3 | October 29, 2015 13:42 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 20:30 |