foamNewApp: added an example createFields.H file
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
# ========= |
|
# ========= |
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
# \\ / O peration | Website: https://openfoam.org
|
# \\ / O peration | Website: https://openfoam.org
|
||||||
# \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
|
# \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
@ -79,4 +79,7 @@ echo "Creating Make subdirectory" && mkdir "${app}/Make"
|
|||||||
sed "s#NAME#${app}#g" "${dir}/Make/files" > "${app}/Make/files"
|
sed "s#NAME#${app}#g" "${dir}/Make/files" > "${app}/Make/files"
|
||||||
cp "${dir}/Make/options" "${app}/Make"
|
cp "${dir}/Make/options" "${app}/Make"
|
||||||
|
|
||||||
|
echo "Copying example createFields.H file" && \
|
||||||
|
cp "${dir}/createFields.H" "${app}"
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -36,6 +36,8 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
#include "createMesh.H"
|
||||||
|
#include "createFields.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
13
etc/codeTemplates/app/createFields.H
Normal file
13
etc/codeTemplates/app/createFields.H
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
Info<< "Reading field p\n" << endl;
|
||||||
|
volScalarField p
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"p",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::AUTO_WRITE
|
||||||
|
),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user