https://linen.dev logo
Here, for example, why wrap this in a separate cod...
# programming
q
Here, for example, why wrap this in a separate codeWrite, if there is a write() at the end of the code anyway?
Copy code
codeWrite
#{
    const volVectorField& U(mesh().lookupObject<volVectorField>("U"));

    volScalarField::New
    (
        "strainRate",
        sqrt(2.0)*mag(symm(fvc::grad(U)))
    )->write();
#};