|
[Sponsors] | |||||
|
|
|
#1 |
|
Senior Member
n/a
Join Date: Sep 2009
Posts: 199
Rep Power: 18 ![]() |
Hello to all the Foamers all around the world. I have a set of points, x, y, and z coordinates, and I would like to put them into a vectorField. The code that I have written thus far gives me an error message when I try to execute it:
scalar xVSL = 0.8; vectorField WallCell = mesh.C().boundaryField()[patchK]; scalarField XNearWall = WallCell.component(vector::X)+ xVSL; scalarField YNearWall = WallCell.component(vector::Y); scalarField ZNearWall = WallCell.component(vector::Z); label vectorLength = XNearWall.size(); vectorField positions; positions.component(vector::X)= XNearWall; positions.component(vector::Y)= YNearWall; positions.component(vector::Z)= ZNearWall; OpenFOAM doesn't like the way I am assigning the positions vectorFIeld, the error states the error is "attempted to assign to a const reference to constant object... Any thoughts on this?? I have checked the forum, but nothing really near what I need... |
|
|
|
|
|
|
|
|
#2 |
|
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 30 ![]() ![]() |
why not write it like this
Code:
vector VSL(0.8, 0, 0); vectorField positions = mesh.C().boundaryField()[patchK] + VSL; |
|
|
|
|
|
|
|
|
#3 |
|
Senior Member
n/a
Join Date: Sep 2009
Posts: 199
Rep Power: 18 ![]() |
Hey Niklas. Thanks for the feedback, it works this time...
![]() Cheers, Deji |
|
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solving for an additional species CO in coalChemistryFoam | N. A. | OpenFOAM Programming & Development | 3 | February 18, 2019 06:58 |
| [snappyHexMesh] No layers in a small gap | bobburnquist | OpenFOAM Meshing & Mesh Conversion | 6 | August 26, 2015 10:38 |
| dieselFoam problem!! trying to introduce a new heat transfer model | vivek070176 | OpenFOAM Programming & Development | 10 | December 24, 2014 00:48 |
| Climbing inlet pressure with simpleFoam and directMappedPatches | chegdan | OpenFOAM Running, Solving & CFD | 1 | January 2, 2012 20:35 |
| [blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 08:36 |