Commit ad0f31b8 authored by mark's avatar mark

COMP: adjust for new functionObject framework

- and updates to GeometricField
parent 4d364cdb
......@@ -3,15 +3,15 @@ cd ${0%/*} || exit 1 # run from this directory
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
if [ -n "$ADIOS_DIR" ]
if [ -n "$ADIOS_ARCH_PATH" ]
then
echo "using ADIOS_DIR=$ADIOS_DIR"
echo "using ADIOS_ARCH_PATH=$ADIOS_ARCH_PATH"
else
export ADIOS_DIR=$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/adios-git
echo "setting ADIOS_DIR=$ADIOS_DIR"
export ADIOS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/adios-git
echo "setting ADIOS_ARCH_PATH=$ADIOS_ARCH_PATH"
fi
adiosFoam/Allwmake $targetType $*
postProcessing/Allwmake $targetType $*
functionObjects/Allwmake $targetType $*
# ----------------------------------------------------------------- end-of-file
......@@ -3,12 +3,12 @@ cd ${0%/*} || exit 1 # run from this directory
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
if [ -n "$ADIOS_DIR" ]
if [ -n "$ADIOS_ARCH_PATH" ]
then
echo "using ADIOS_DIR=$ADIOS_DIR"
echo "using ADIOS_ARCH_PATH=$ADIOS_ARCH_PATH"
else
export ADIOS_DIR=$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/adios-git
echo "setting ADIOS_DIR=$ADIOS_DIR"
export ADIOS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/adios-git
echo "setting ADIOS_ARCH_PATH=$ADIOS_ARCH_PATH"
fi
set -x
......
sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB)
sinclude $(RULES)/mplib$(WM_MPLIB)
ADIOS_LIBS := ${shell ${ADIOS_DIR}/bin/adios_config -l}
ADIOS_LIBS := ${shell ${ADIOS_ARCH_PATH}/bin/adios_config -l}
EXE_INC = -DFOAM_PLATFORM="$(WM_ARCH)$(WM_COMPILER)" \
$(PFLAGS) $(PINC) \
-I${ADIOS_DIR}/include \
-I${ADIOS_ARCH_PATH}/include \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
......
......@@ -153,18 +153,18 @@ int64_t Foam::adiosCoreWrite::writeFieldObject
}
// internal volume fields
else if (fieldType == volScalarField::DimensionedInternalField::typeName)
else if (fieldType == volScalarField::Internal::typeName)
{
varid = testOnly ? 1 : writeInternalField
(
static_cast<const volScalarField::DimensionedInternalField&>(obj)
static_cast<const volScalarField::Internal&>(obj)
);
}
else if (fieldType == volVectorField::DimensionedInternalField::typeName)
else if (fieldType == volVectorField::Internal::typeName)
{
varid = testOnly ? 1 : writeInternalField
(
static_cast<const volVectorField::DimensionedInternalField&>(obj)
static_cast<const volVectorField::Internal&>(obj)
);
}
......
......@@ -33,6 +33,7 @@ License
#include "IOstreams.H"
#include "Ostream.H"
#warning "TODO - truncrate patch-names to non-processor patches"
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * * //
......@@ -49,8 +50,7 @@ int64_t Foam::adiosCoreWrite::writeField
);
{
const typename FieldType::GeometricBoundaryField& bfield =
field.boundaryField();
const typename FieldType::Boundary& bfield = field.boundaryField();
// independent of how we store fields,
// a quick lookup of field patch types may prove useful
......@@ -87,8 +87,7 @@ int64_t Foam::adiosCoreWrite::writeInternalField
int64_t varid = defineStreamVariable(varName, counter.size());
// use iobuffer_ to avoid too many reallocations
// Needs rework?
// use iobuffer_ to avoid too many reallocations - needs some rework?
iobuffer_.reserve(adios_expected_var_size(varid));
OutputBufStreamer os(iobuffer_, adiosCore::strFormat);
......
......@@ -3,16 +3,16 @@ cd ${0%/*} || exit 1 # run from this directory
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
if [ -n "$ADIOS_DIR" ]
if [ -n "$ADIOS_ARCH_PATH" ]
then
echo "using ADIOS_DIR=$ADIOS_DIR"
echo "using ADIOS_ARCH_PATH=$ADIOS_ARCH_PATH"
else
export ADIOS_DIR=$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/adios-git
echo "setting ADIOS_DIR=$ADIOS_DIR"
export ADIOS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/linux64Gcc/adios-git
echo "setting ADIOS_ARCH_PATH=$ADIOS_ARCH_PATH"
fi
# extra compile/link options
adiosFoam=$(cd ../../adiosFoam && pwd -P)
adiosFoam=$(cd ../adiosFoam && pwd -P)
export ADIOS_EXTRA_COMP="-I$adiosFoam/lnInclude"
export ADIOS_EXTRA_LINK='-L$(FOAM_USER_LIBBIN) -ladiosFoam'
......
adiosRegion.C
adiosWrite.C
adiosWriteCloud.C
adiosWriteFunctionObject.C
adiosReadData.C
adiosReadField.C
......
......@@ -3,7 +3,7 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
EXE_INC = \
$(PFLAGS) $(PINC) \
-I${ADIOS_DIR}/include $(ADIOS_EXTRA_COMP) \
-I${ADIOS_ARCH_PATH}/include $(ADIOS_EXTRA_COMP) \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/lagrangian/spray/lnInclude \
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
......
......@@ -58,7 +58,7 @@ bool Foam::adiosWrite::fieldRead
// could also verify dimensions
field.readField(dict, "internalField");
field.boundaryField().readField(field, dict.subDict("boundaryField"));
field.boundaryFieldRef().readField(field, dict.subDict("boundaryField"));
// TODO: adjust for referenceLevel?
//
......@@ -108,7 +108,7 @@ bool Foam::adiosWrite::fieldRead
// could also verify dimensions
field.readField(dict, "internalField");
field.boundaryField().readField(field, dict.subDict("boundaryField"));
field.boundaryFieldRef().readField(field, dict.subDict("boundaryField"));
// TODO: adjust for referenceLevel?
//
......
......@@ -30,13 +30,20 @@ License
#include "scalar.H"
#include "SortableList.H"
#include "FlatListOutput.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(adiosWrite, 0);
addToRunTimeSelectionTable
(
functionObject,
adiosWrite,
dictionary
);
}
......@@ -73,10 +80,10 @@ Foam::adiosWrite::adiosWrite
(
const word& groupName,
const objectRegistry& obr,
const dictionary& dict,
const bool loadFromFiles
const dictionary& dict
)
:
functionObject("adiosWrite"),
adiosCoreWrite(groupName, dict),
obr_(obr),
time_(refCast<const fvMesh>(obr).time()),
......@@ -110,7 +117,7 @@ Foam::adiosWrite::~adiosWrite()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::adiosWrite::read(const dictionary& dict)
bool Foam::adiosWrite::read(const dictionary& dict)
{
regions_.clear();
......@@ -206,7 +213,7 @@ void Foam::adiosWrite::read(const dictionary& dict)
writeInterval_ = dict.lookupOrDefault<label>("writeInterval", 1);
// Print info to terminal
Info<< type() << " " << name() << ":" << endl
Info<< type() << " " << adiosCore::name() << ":" << endl
<< " Compiled with " << adiosTraits<scalar>::adiosSize
<< " bytes precision." << nl
<< " Writing every " << writeInterval_ << " iterations:" << endl;
......@@ -230,6 +237,7 @@ void Foam::adiosWrite::read(const dictionary& dict)
// Info<< type() << " " << name() << ":" << nl
// << " ADIOS writeMethod: " << writeMethod_ << nl
// << " writeParams: " << writeParams_ << nl;
return true;
}
......@@ -299,7 +307,7 @@ bool Foam::adiosWrite::restart()
}
void Foam::adiosWrite::execute()
bool Foam::adiosWrite::execute()
{
// execute() is called at the first non-zero time, after the calculation,
// before write() is called.
......@@ -316,28 +324,23 @@ void Foam::adiosWrite::execute()
restarted = true;
restart();
}
return true;
}
void Foam::adiosWrite::end()
bool Foam::adiosWrite::end()
{
// Nothing to be done here
Info<< "adiosWrite::end() called at time "
<< obr_.time().timeName() << " time index "
<< obr_.time().timeIndex() << endl;
}
void Foam::adiosWrite::timeSet()
{
// Nothing to be done here
Info<< "adiosWrite::timeSet() called at time "
<< obr_.time().timeName() << " time index "
<< obr_.time().timeIndex() << endl;
return true;
}
void Foam::adiosWrite::write()
bool Foam::adiosWrite::write()
{
Info<< "adiosWrite::write() called at time "
<< obr_.time().timeName() << " time index "
......@@ -393,6 +396,8 @@ void Foam::adiosWrite::write()
}
++timeSteps_; // update counter
return true;
}
......
......@@ -58,6 +58,8 @@ Author
#include "adios.h"
#include "adios_read.h"
#include "functionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -74,6 +76,7 @@ class dictionary;
class adiosWrite
:
public functionObject,
public adiosCoreWrite
{
// Forward declarations of various sub-components
......@@ -232,13 +235,11 @@ public:
// Constructors
//- Construct for given objectRegistry and dictionary.
// Allow the possibility to load fields from files
adiosWrite
(
const word& groupName,
const objectRegistry&,
const dictionary&,
const bool loadFromFiles = false
const dictionary&
);
......@@ -249,28 +250,17 @@ public:
// Member Functions
//- Read the adiosWrite data
virtual void read(const dictionary&);
virtual bool read(const dictionary&);
//- Execute, handles restart at first call if requested
virtual void execute();
virtual bool execute();
//- Execute at the final time-loop, currently does nothing
virtual void end();
//- Called when time was set at the end of the Time::operator++,
// Note: currently does nothing
virtual void timeSet();
virtual bool end();
//- Write a timestep to file
virtual void write();
//- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh&)
{}
virtual bool write();
//- Update for changes of mesh
virtual void movePoints(const polyMesh&)
{}
};
......
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
targetType=libso
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
functionObjects/Allwmake $targetType $*
# ----------------------------------------------------------------- end-of-file
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 Norbert Podhorszki
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::IOadiosWrite
Description
Writes fields and parcel clouds to an ADIOS file.
Author
Norbert Podhorszki, pnorbert@ornl.gov, 2015
\*---------------------------------------------------------------------------*/
#ifndef IOadiosWrite_H
#define IOadiosWrite_H
#include "adiosWrite.H"
#include "IOOutputFilter.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOOutputFilter<adiosWrite> IOadiosWrite;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 Norbert Podhorszki
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "adiosWriteFunctionObject.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineNamedTemplateTypeNameAndDebug
(
adiosWriteFunctionObject,
0
);
addToRunTimeSelectionTable
(
functionObject,
adiosWriteFunctionObject,
dictionary
);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 Norbert Podhorszki
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Typedef
Foam::IOadiosWrite
Description
FunctionObject wrapper around adiosWrite to allow it to be
created via the functions list within controlDict.
SourceFiles
adiosWriteFunctionObject.C
\*---------------------------------------------------------------------------*/
#ifndef adiosWriteFunctionObject_H
#define adiosWriteFunctionObject_H
#include "adiosWrite.H"
#include "OutputFilterFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef OutputFilterFunctionObject<adiosWrite>
adiosWriteFunctionObject;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment