Commit f187dd8a authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: finiteArea - integration updates

parent d20b981f
......@@ -15,7 +15,6 @@ EXE_LIBS = \
-ldecompositionMethods \
-L$(FOAM_LIBBIN)/dummy \
-lkahipDecomp -lmetisDecomp -lscotchDecomp \
-lfiniteArea \
-llagrangian \
-ldynamicMesh \
-lregionModels
......@@ -40,9 +40,8 @@ wmakeLnInclude -u fvOptions
wmake $targetType finiteVolume
wmake $targetType lagrangian/basic
wmake $targetType lagrangian/distributionModels
wmake $targetType genericPatchFields
wmake $targetType finiteArea
wmake $targetType genericPatchFields
conversion/Allwmake $targetType $*
wmake $targetType mesh/extrudeModel
......
......@@ -140,8 +140,8 @@ Foam::calculatedFaPatchField<Type>::valueInternalCoeffs
FatalErrorInFunction
<< "valueInternalCoeffs cannot be called for a calculatedFaPatchField"
<< "\n on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< "\n You are probably trying to solve for a field with a "
"default boundary condition."
<< exit(FatalError);
......@@ -160,8 +160,8 @@ Foam::calculatedFaPatchField<Type>::valueBoundaryCoeffs
FatalErrorInFunction
<< "valueBoundaryCoeffs cannot be called for a calculatedFaPatchField"
<< "\n on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< "\n You are probably trying to solve for a field with a "
"default boundary condition."
<< exit(FatalError);
......@@ -178,8 +178,8 @@ Foam::calculatedFaPatchField<Type>::gradientInternalCoeffs() const
<< "gradientInternalCoeffs cannot be called for a "
"calculatedFaPatchField"
<< "\n on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< "\n You are probably trying to solve for a field with a "
"default boundary condition."
<< exit(FatalError);
......@@ -197,8 +197,8 @@ Foam::calculatedFaPatchField<Type>::gradientBoundaryCoeffs() const
"gradientBoundaryCoeffs cannot be called for a "
"calculatedFaPatchField"
<< "\n on patch " << this->patch().name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< "\n You are probably trying to solve for a field with a "
"default boundary condition."
<< exit(FatalError);
......
......@@ -59,8 +59,8 @@ Foam::cyclicFaPatchField<Type>::cyclicFaPatchField
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
......@@ -83,8 +83,8 @@ Foam::cyclicFaPatchField<Type>::cyclicFaPatchField
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
......@@ -122,7 +122,7 @@ template<class Type>
Foam::tmp<Foam::Field<Type>>
Foam::cyclicFaPatchField<Type>::patchNeighbourField() const
{
const Field<Type>& iField = this->internalField();
const Field<Type>& iField = this->primitiveField();
const labelUList& faceCells = cyclicPatch_.faceCells();
tmp<Field<Type>> tpnf(new Field<Type>(this->size()));
......
......@@ -59,8 +59,8 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
......@@ -82,8 +82,8 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
......@@ -98,7 +98,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
faPatchField<Type>
(
ptf.patch(),
ptf.dimensionedInternalField(),
ptf.internalField(),
Field<Type>(0)
)
{}
......@@ -120,12 +120,12 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
template<class Type>
void Foam::emptyFaPatchField<Type>::updateCoeffs()
{
if (this->dimensionedInternalField().mesh().nFaces())
if (this->internalField().mesh().nFaces())
{
if
(
this->patch().faPatch::size()
% this->dimensionedInternalField().mesh().nFaces()
% this->internalField().mesh().nFaces()
)
{
FatalErrorInFunction
......
......@@ -76,8 +76,8 @@ Foam::processorFaPatchField<Type>::processorFaPatchField
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
......@@ -100,8 +100,8 @@ Foam::processorFaPatchField<Type>::processorFaPatchField
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
......
......@@ -57,8 +57,8 @@ Foam::symmetryFaPatchField<Type>::symmetryFaPatchField
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
......@@ -80,8 +80,8 @@ Foam::symmetryFaPatchField<Type>::symmetryFaPatchField
<< "\n patch type '" << p.type()
<< "' not constraint type '" << typeName << "'"
<< "\n for patch " << p.name()
<< " of field " << this->dimensionedInternalField().name()
<< " in file " << this->dimensionedInternalField().objectPath()
<< " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath()
<< exit(FatalIOError);
}
}
......
......@@ -270,14 +270,13 @@ public:
}
//- Return dimensioned internal field reference
const DimensionedField<Type, areaMesh>&
dimensionedInternalField() const
const DimensionedField<Type, areaMesh>& internalField() const
{
return internalField_;
}
//- Return internal field reference
const Field<Type>& internalField() const
const Field<Type>& primitiveField() const
{
return internalField_;
}
......
......@@ -93,7 +93,7 @@ Foam::emptyFaePatchField<Type>::emptyFaePatchField
faePatchField<Type>
(
ptf.patch(),
ptf.dimensionedInternalField(),
ptf.internalField(),
Field<Type>(0)
)
{}
......
......@@ -270,14 +270,13 @@ public:
}
//- Return dimensioned internal field reference
const DimensionedField<Type, edgeMesh>&
dimensionedInternalField() const
const DimensionedField<Type, edgeMesh>& internalField() const
{
return internalField_;
}
//- Return internal field reference
const Field<Type>& internalField() const
const Field<Type>& primitiveField() const
{
return internalField_;
}
......
genericFaPatchField/genericFaPatchFields.C
genericFvPatchField/genericFvPatchFields.C
genericPointPatchField/genericPointPatchFields.C
......
EXE_INC = \
-I$(LIB_SRC)/finiteArea/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
-lfiniteArea \
-lfiniteVolume
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ 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/>.
Class
Foam::genericFaPatchField
Description
This boundary condition provides a generic version of the \c calculated
condition, useful as a fallback for handling unknown patch types. Not
generally applicable as a user-specified condition.
See also
Foam::calculatedFaPatchField
SourceFiles
genericFaPatchField.C
\*---------------------------------------------------------------------------*/
#ifndef genericFaPatchField_H
#define genericFaPatchField_H
#include "calculatedFaPatchField.H"
#include "HashPtrTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class genericFaPatch Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class genericFaPatchField
:
public calculatedFaPatchField<Type>
{
// Private data
const word actualTypeName_;
dictionary dict_;
HashPtrTable<scalarField> scalarFields_;
HashPtrTable<vectorField> vectorFields_;
HashPtrTable<sphericalTensorField> sphericalTensorFields_;
HashPtrTable<symmTensorField> symmTensorFields_;
HashPtrTable<tensorField> tensorFields_;
public:
//- Runtime type information
TypeName("generic");
// Constructors
//- Construct from patch and internal field
genericFaPatchField
(
const faPatch&,
const DimensionedField<Type, areaMesh>&
);
//- Construct from patch, internal field and dictionary
genericFaPatchField
(
const faPatch&,
const DimensionedField<Type, areaMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<Type> onto a new patch
genericFaPatchField
(
const genericFaPatchField<Type>&,
const faPatch&,
const DimensionedField<Type, areaMesh>&,
const faPatchFieldMapper&
);
//- Construct as copy
genericFaPatchField
(
const genericFaPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<faPatchField<Type>> clone() const
{
return tmp<faPatchField<Type>>
(
new genericFaPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
genericFaPatchField
(
const genericFaPatchField<Type>&,
const DimensionedField<Type, areaMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<faPatchField<Type>> clone
(
const DimensionedField<Type, areaMesh>& iF
) const
{
return tmp<faPatchField<Type>>
(
new genericFaPatchField<Type>(*this, iF)
);
}
// Member functions
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual void autoMap
(
const faPatchFieldMapper&
);
//- Reverse map the given faPatchField onto this faPatchField
virtual void rmap
(
const faPatchField<Type>&,
const labelList&
);
// Evaluation functions
//- Return the matrix diagonal coefficients corresponding to the
// evaluation of the value of this patchField with given weights
virtual tmp<Field<Type>> valueInternalCoeffs
(
const tmp<scalarField>&
) const;
//- Return the matrix source coefficients corresponding to the
// evaluation of the value of this patchField with given weights
virtual tmp<Field<Type>> valueBoundaryCoeffs
(
const tmp<scalarField>&
) const;
//- Return the matrix diagonal coefficients corresponding to the
// evaluation of the gradient of this patchField
tmp<Field<Type>> gradientInternalCoeffs() const;
//- Return the matrix source coefficients corresponding to the
// evaluation of the gradient of this patchField
tmp<Field<Type>> gradientBoundaryCoeffs() const;
//- Return the actual type
const word& actualType() const;
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "genericFaPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ 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 "genericFaPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "areaFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeFaPatchFields(generic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ 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/>.
\*---------------------------------------------------------------------------*/
#ifndef genericFaPatchFields_H
#define genericFaPatchFields_H
#include "genericFaPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFaPatchTypeFieldTypedefs(generic);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#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