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

Assign one vector to another - still a field?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   May 26, 2011, 11:01
Default Assign one vector to another - still a field?
  #1
Member
 
David GISEN
Join Date: Jul 2009
Location: Germany
Posts: 68
Rep Power: 16
David* is on a distinguished road
Hi Foamers,

I have some problems with a vector assignment. To do some further computations, I need the unit normal vector of a patch stored as a vector. My command for this is

Code:
vector unitNormalVector;
...
forAll(wallshearstress4Rho.boundaryField(), patchi)
{
unitNormalVector(-mesh.Sf().boundaryField()[patchi]/mesh.magSf().boundaryField()[patchi]);
...
}
I tried also with an equal (=) symbol. I assume, that on both sides of the equation is a vector with three components. But on the right hand side, it's something more complicated, as wmake's error message shows:

Code:
error: no match for call to ‘(Foam::vector) (Foam::tmp<Foam::Field<Foam::Vector<double> > >)’
Which looks like a template vector field (?). But how can there be a field, if I choose a specific patch by using [patchi] within a forAll-loop?
I'm a beginner with C++, so I ask someone more experienced to tell me what I'm doing wrong.

Regards,
David
David* is offline   Reply With Quote

 


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
Phase Field modeling in OpenFOAM adona058 OpenFOAM Running, Solving & CFD 35 November 16, 2021 00:16
problems after decomposing for running alessio.nz OpenFOAM 7 March 5, 2021 04:49
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
Zero size field taranov OpenFOAM Bugs 2 April 20, 2010 04:51
Problem with rhoSimpleFoam matteo_gautero OpenFOAM Running, Solving & CFD 0 February 28, 2008 06:51


All times are GMT -4. The time now is 01:16.