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

Make full copy of a volScalarField

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 9, 2023, 04:13
Default Make full copy of a volScalarField
  #1
New Member
 
Join Date: Dec 2022
Posts: 14
Rep Power: 3
kilimanjaro2 is on a distinguished road
Hello to all,

I have a field, say:

Code:
volScalarField field1
(
    IOobject
    (
        "field1",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
    ),
    mesh
);
and another:

Code:
volScalarField field2
(
    IOobject
    (
        "field2",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ,
        IOobject::AUTO_WRITE
    ),
    mesh,
    dimensionedScalar(dimless, Zero)
);
I am performing some computations with field2 e.g:

field2 = field2 + 20;

Now, I would like that field1 be a copy of field2 down to the boundary conditions and values.

How can I achieve this?
kilimanjaro2 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
Error message Bruno_Jorge Main CFD Forum 1 February 5, 2019 11:12
namespace Foam Argen OpenFOAM 4 February 5, 2019 08:55
Compressible 2D airfoil rhoSimpleFoam fatal error volScalarField none jfournier OpenFOAM Running, Solving & CFD 4 September 28, 2017 06:28
make a dimensionedScalar to be volScalarField sharonyue OpenFOAM Programming & Development 4 April 2, 2014 05:44
a way to make lots of money quick and easy no lies Dob Main CFD Forum 0 October 10, 2006 16:45


All times are GMT -4. The time now is 08:19.