Compare commits

..

4 Commits

Author SHA1 Message Date
93f4b6aea0 BACKPORT: error handling for empty surfaces in surfaceFieldValue (#2966)
- for workflows with appearing/disappearing patches (for example)
  can specify that empty surfaces should be ignored or warned about
  instead of raising a FatalError.

  Note that this handling is additional to the regular top-level
  "errors" specification. So specifying 'strict' will only actually
  result in a FatalError if the "errors" does not trap errors.

- "ignore" : any empty surfaces are simply ignored and no
  file output (besides the header).

- "warn" : empty surfaces are warned about a few times (10)
  and the file output contains a NaN entry

- "strict" : corresponds to the default behaviour.
  Throws a FatalError if the surface is empty.
  This error may still be caught by the top-level "errors" handling.
2024-01-19 20:52:34 +01:00
d3a079b4da COMP: g++11: suppress optimisation. See #3024 2024-01-19 20:52:34 +01:00
177176c5ff BUG: particle: use correct celli. Fixes #1992
Was checking the old celli instead of the result of
re-finding the position. See also Foundation commit 50a965f8866683a81d79cbc7811af7333baf9d10.
2023-10-10 15:40:47 +01:00
53feaf2560 BUG: mapFields: incorrect patches. Fixes #2944. 2023-08-30 16:39:16 +02:00
9 changed files with 189 additions and 132 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2015-2023 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -34,24 +34,8 @@ License
#include "Pstream.H"
#include "foamVersion.H"
#include "OSspecific.H"
#include "Enum.H"
#include "Switch.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::Enum
<
Foam::error::handlerTypes
>
Foam::error::handlerNames
({
{ handlerTypes::DEFAULT, "default" },
{ handlerTypes::IGNORE, "ignore" },
{ handlerTypes::WARN, "warn" },
{ handlerTypes::STRICT, "strict" },
});
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
void Foam::error::warnAboutAge(const char* what, const int version)

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2015 OpenFOAM Foundation
Copyright (C) 2015-2023 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -53,8 +53,8 @@ SeeAlso
\*---------------------------------------------------------------------------*/
#ifndef Foam_error_H
#define Foam_error_H
#ifndef error_H
#define error_H
#include "messageStream.H"
#include <memory>
@ -64,10 +64,6 @@ SeeAlso
namespace Foam
{
// Forward Declarations
class OStringStream;
template<class EnumType> class Enum;
/*---------------------------------------------------------------------------*\
Class error Declaration
\*---------------------------------------------------------------------------*/
@ -96,21 +92,6 @@ protected:
public:
// Data Types
//- Handling of errors. The exact handling depends on the local context.
enum class handlerTypes : char
{
DEFAULT = 0, //!< Default behaviour (local meaning)
IGNORE, //!< Ignore on errors/problems
WARN, //!< Warn on errors/problems
STRICT //!< Fatal on errors/problems
};
//- Names of the error handler types
static const Enum<handlerTypes> handlerNames;
// Constructors
//- Construct from title string

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2015-2023 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,7 +43,7 @@ License
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
//- Max number of warnings (per functionObject)
static constexpr const unsigned maxWarnings = 10u;
static constexpr const uint32_t maxWarnings = 10u;
Foam::fileName Foam::functionObjectList::functionObjectDictPath
(
@ -51,6 +51,19 @@ Foam::fileName Foam::functionObjectList::functionObjectDictPath
);
const Foam::Enum
<
Foam::functionObjectList::errorHandlingType
>
Foam::functionObjectList::errorHandlingNames_
({
{ errorHandlingType::DEFAULT, "default" },
{ errorHandlingType::WARN, "warn" },
{ errorHandlingType::IGNORE, "ignore" },
{ errorHandlingType::STRICT, "strict" },
});
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
namespace Foam
@ -383,12 +396,12 @@ bool Foam::functionObjectList::readFunctionObject
}
Foam::error::handlerTypes
Foam::functionObjectList::errorHandlingType
Foam::functionObjectList::getOrDefaultErrorHandling
(
const word& key,
const dictionary& dict,
const error::handlerTypes deflt
const errorHandlingType deflt
) const
{
const entry* eptr = dict.findEntry(key, keyType::LITERAL);
@ -405,16 +418,16 @@ Foam::functionObjectList::getOrDefaultErrorHandling
{
const word enumName(eptr->get<word>());
if (!error::handlerNames.found(enumName))
if (!errorHandlingNames_.found(enumName))
{
// Failed the name lookup
FatalIOErrorInFunction(dict)
<< enumName << " is not in enumeration: "
<< error::handlerNames << nl
<< errorHandlingNames_ << nl
<< exit(FatalIOError);
}
return error::handlerNames.get(enumName);
return errorHandlingNames_.get(enumName);
}
}
@ -670,15 +683,15 @@ bool Foam::functionObjectList::execute()
for (functionObject& funcObj : functions())
{
const auto errorHandling = *errIter;
const errorHandlingType errorHandling = *errIter;
++errIter;
const word& objName = funcObj.name();
if
(
errorHandling == error::handlerTypes::WARN
|| errorHandling == error::handlerTypes::IGNORE
errorHandling == errorHandlingType::WARN
|| errorHandling == errorHandlingType::IGNORE
)
{
// Throw FatalError, FatalIOError as exceptions
@ -702,12 +715,12 @@ bool Foam::functionObjectList::execute()
catch (const Foam::error& err)
{
// Treat IOerror and error identically
unsigned nWarnings;
uint32_t nWarnings;
hadError = true;
if
(
(errorHandling != error::handlerTypes::IGNORE)
errorHandling != errorHandlingType::IGNORE
&& (nWarnings = ++warnings_(objName)) <= maxWarnings
)
{
@ -748,11 +761,11 @@ bool Foam::functionObjectList::execute()
catch (const Foam::error& err)
{
// Treat IOerror and error identically
unsigned nWarnings;
uint32_t nWarnings;
if
(
(errorHandling != error::handlerTypes::IGNORE)
errorHandling != errorHandlingType::IGNORE
&& (nWarnings = ++warnings_(objName)) <= maxWarnings
)
{
@ -881,7 +894,7 @@ bool Foam::functionObjectList::end()
for (functionObject& funcObj : functions())
{
const auto errorHandling = *errIter;
const errorHandlingType errorHandling = *errIter;
++errIter;
const word& objName = funcObj.name();
@ -900,11 +913,11 @@ bool Foam::functionObjectList::end()
catch (const Foam::error& err)
{
// Treat IOerror and error identically
unsigned nWarnings;
uint32_t nWarnings;
if
(
(errorHandling != error::handlerTypes::IGNORE)
errorHandling != errorHandlingType::IGNORE
&& (nWarnings = ++warnings_(objName)) <= maxWarnings
)
{
@ -1012,7 +1025,7 @@ bool Foam::functionObjectList::read()
errorHandling_.resize
(
functionsDict.size(),
error::handlerTypes::DEFAULT
errorHandlingType::DEFAULT
);
HashTable<label> newIndices;
@ -1028,12 +1041,12 @@ bool Foam::functionObjectList::read()
);
// Top-level "errors" specification (optional)
const error::handlerTypes errorHandlingFallback =
const errorHandlingType errorHandlingFallback =
getOrDefaultErrorHandling
(
"errors",
functionsDict,
error::handlerTypes::DEFAULT
errorHandlingType::DEFAULT
);
label nFunc = 0;
@ -1058,7 +1071,7 @@ bool Foam::functionObjectList::read()
bool enabled = dict.getOrDefault("enabled", true);
// Per-function "errors" specification
const error::handlerTypes errorHandling =
const errorHandlingType errorHandling =
getOrDefaultErrorHandling
(
"errors",
@ -1148,16 +1161,16 @@ bool Foam::functionObjectList::read()
switch (errorHandling)
{
case error::handlerTypes::IGNORE:
case errorHandlingType::IGNORE:
break;
case error::handlerTypes::STRICT:
case errorHandlingType::STRICT:
{
exitNow(err);
break;
}
case error::handlerTypes::DEFAULT:
case errorHandlingType::DEFAULT:
{
if (isA<Foam::IOerror>(err))
{
@ -1170,7 +1183,7 @@ bool Foam::functionObjectList::read()
[[fallthrough]];
}
case error::handlerTypes::WARN:
case errorHandlingType::WARN:
{
// Trickery to get original message
err.write(Warning, false);

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2023 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -77,10 +77,11 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef Foam_functionObjectList_H
#define Foam_functionObjectList_H
#ifndef functionObjectList_H
#define functionObjectList_H
#include "PtrList.H"
#include "Enum.H"
#include "functionObject.H"
#include "SHA1Digest.H"
#include "HashTable.H"
@ -105,10 +106,25 @@ class functionObjectList
:
private PtrList<functionObject>
{
// Data Types
//- Handling of construction or execution errors
enum class errorHandlingType : uint8_t
{
DEFAULT = 0, //!< Warn on construct, Fatal on runtime
WARN, //!< Warn on construct, Warn on runtime
IGNORE, //!< Ignore on construct, Ignore on runtime
STRICT, //!< Fatal on construct, Fatal on runtime
};
//- Names for error handling types
static const Enum<errorHandlingType> errorHandlingNames_;
// Private Data
//- A list of error/warning handling
List<error::handlerTypes> errorHandling_;
List<errorHandlingType> errorHandling_;
//- A list of SHA1 digests for the function object dictionaries
List<SHA1Digest> digests_;
@ -119,7 +135,7 @@ class functionObjectList
//- Track the number of warnings per function object and limit
// to a predefined number to avoid flooding the display.
// Clear on re-read of functions.
HashTable<unsigned> warnings_;
HashTable<uint32_t> warnings_;
//- Reference to Time
const Time& time_;
@ -169,11 +185,11 @@ class functionObjectList
//
// This additional treatment is to ensure that potentially existing
// code with an "errors" functionObject will continue to run.
error::handlerTypes getOrDefaultErrorHandling
errorHandlingType getOrDefaultErrorHandling
(
const word& key,
const dictionary& dict,
const error::handlerTypes deflt
const errorHandlingType deflt
) const;

View File

@ -513,6 +513,10 @@ inline Foam::Tensor<Cmpt> Foam::Tensor<Cmpt>::T() const
template<class Cmpt>
#if defined(__GNUC__) && !defined(__clang__)
// Workaround for gcc (11+) that fails to handle tensor dot vector
__attribute__((optimize("no-tree-vectorize")))
#endif
inline Foam::Tensor<Cmpt>
Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const
{
@ -536,6 +540,10 @@ Foam::Tensor<Cmpt>::inner(const Tensor<Cmpt>& t2) const
template<class Cmpt>
#if defined(__GNUC__) && !defined(__clang__)
// Workaround for gcc (11+) that fails to handle tensor dot vector
__attribute__((optimize("no-tree-vectorize")))
#endif
inline Foam::Tensor<Cmpt>
Foam::Tensor<Cmpt>::schur(const Tensor<Cmpt>& t2) const
{
@ -970,6 +978,10 @@ operator&(const Tensor<Cmpt>& t1, const Tensor<Cmpt>& t2)
//- Inner-product of a SphericalTensor and a Tensor
template<class Cmpt>
#if defined(__GNUC__) && !defined(__clang__)
// Workaround for gcc (11+) that fails to handle tensor dot vector
__attribute__((optimize("no-tree-vectorize")))
#endif
inline Tensor<Cmpt>
operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
{
@ -984,6 +996,10 @@ operator&(const SphericalTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
//- Inner-product of a Tensor and a SphericalTensor
template<class Cmpt>
#if defined(__GNUC__) && !defined(__clang__)
// Workaround for gcc (11+) that fails to handle tensor dot vector
__attribute__((optimize("no-tree-vectorize")))
#endif
inline Tensor<Cmpt>
operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
{
@ -998,6 +1014,10 @@ operator&(const Tensor<Cmpt>& t1, const SphericalTensor<Cmpt>& st2)
//- Inner-product of a SymmTensor and a Tensor
template<class Cmpt>
#if defined(__GNUC__) && !defined(__clang__)
// Workaround for gcc (11+) that fails to handle tensor dot vector
__attribute__((optimize("no-tree-vectorize")))
#endif
inline Tensor<Cmpt>
operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
{
@ -1020,6 +1040,10 @@ operator&(const SymmTensor<Cmpt>& st1, const Tensor<Cmpt>& t2)
//- Inner-product of a Tensor and a SymmTensor
template<class Cmpt>
#if defined(__GNUC__) && !defined(__clang__)
// Workaround for gcc (11+) that fails to handle tensor dot vector
__attribute__((optimize("no-tree-vectorize")))
#endif
inline Tensor<Cmpt>
operator&(const Tensor<Cmpt>& t1, const SymmTensor<Cmpt>& st2)
{
@ -1046,7 +1070,7 @@ template<class Cmpt>
// Workaround for gcc (11+) that fails to handle tensor dot vector
__attribute__((optimize("no-tree-vectorize")))
#endif
inline typename innerProduct<Tensor<Cmpt>, Vector<Cmpt>>::type
inline Vector<Cmpt>
operator&(const Tensor<Cmpt>& t, const Vector<Cmpt>& v)
{
return Vector<Cmpt>
@ -1060,7 +1084,11 @@ operator&(const Tensor<Cmpt>& t, const Vector<Cmpt>& v)
//- Inner-product of a Vector and a Tensor
template<class Cmpt>
inline typename innerProduct<Vector<Cmpt>, Tensor<Cmpt>>::type
#if defined(__GNUC__) && !defined(__clang__)
// Workaround for gcc (11+) that fails to handle tensor dot vector
__attribute__((optimize("no-tree-vectorize")))
#endif
inline Vector<Cmpt>
operator&(const Vector<Cmpt>& v, const Tensor<Cmpt>& t)
{
return Vector<Cmpt>

View File

@ -36,6 +36,20 @@ License
#include "PatchTools.H"
#include "addToRunTimeSelectionTable.H"
// BACKPORT:
const Foam::Enum
<
Foam::functionObjects::fieldValues::surfaceFieldValue::error_handlerTypes
>
Foam::functionObjects::fieldValues::surfaceFieldValue::error_handlerNames
({
{ error_handlerTypes::DEFAULT, "default" },
{ error_handlerTypes::IGNORE, "ignore" },
{ error_handlerTypes::WARN, "warn" },
{ error_handlerTypes::STRICT, "strict" },
});
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
// Max number of warnings
@ -220,12 +234,12 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setFaceZoneFaces()
switch (emptySurfaceError_)
{
case error::handlerTypes::IGNORE:
case error_handlerTypes::IGNORE:
{
break;
}
case error::handlerTypes::WARN:
case error_handlerTypes::WARN:
{
if (nWarnings_ <= maxWarnings)
{
@ -380,12 +394,12 @@ void Foam::functionObjects::fieldValues::surfaceFieldValue::setPatchFaces()
switch (emptySurfaceError_)
{
case error::handlerTypes::IGNORE:
case error_handlerTypes::IGNORE:
{
break;
}
case error::handlerTypes::WARN:
case error_handlerTypes::WARN:
{
if (nWarnings_ <= maxWarnings)
{
@ -724,12 +738,12 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::update()
switch (emptySurfaceError_)
{
case error::handlerTypes::IGNORE:
case error_handlerTypes::IGNORE:
{
break;
}
case error::handlerTypes::WARN:
case error_handlerTypes::WARN:
{
if (nWarnings_ <= maxWarnings)
{
@ -1069,7 +1083,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
),
needsUpdate_(true),
writeArea_(false),
emptySurfaceError_(error::handlerTypes::DEFAULT),
emptySurfaceError_(error_handlerTypes::DEFAULT),
selectionNames_(),
weightFieldNames_(),
totalArea_(0),
@ -1105,7 +1119,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::surfaceFieldValue
),
needsUpdate_(true),
writeArea_(false),
emptySurfaceError_(error::handlerTypes::DEFAULT),
emptySurfaceError_(error_handlerTypes::DEFAULT),
selectionNames_(),
weightFieldNames_(),
totalArea_(0),
@ -1130,11 +1144,11 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
needsUpdate_ = true;
writeArea_ = dict.getOrDefault("writeArea", false);
emptySurfaceError_ = error::handlerNames.getOrDefault
emptySurfaceError_ = error_handlerNames.getOrDefault
(
"empty-surface",
dict,
error::handlerTypes::DEFAULT,
error_handlerTypes::DEFAULT,
true // Failsafe behaviour
);
@ -1322,37 +1336,44 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::write()
writeCurrentTime(file());
}
// Handle ignore/warn about empty-surface
if (!nFaces_)
{
totalArea_ = 0; // Update the area (safety)
if (operation_ != opNone)
{
if (emptySurfaceError_ == error_handlerTypes::WARN)
{
if (writeArea_)
{
Log << " total area = " << totalArea_ << endl;
file() << tab << totalArea_;
}
file() << tab << "NaN";
Log << endl;
}
file() << endl;
}
// Early exit on error
return true;
}
if (writeArea_)
{
// Update the area
if (!nFaces_)
{
totalArea_ = 0;
}
else
{
totalArea_ = totalArea();
}
totalArea_ = totalArea();
Log << " total area = " << totalArea_ << endl;
if (operation_ != opNone && Pstream::master())
if (operation_ != opNone && UPstream::master())
{
file() << tab << totalArea_;
}
}
if (!nFaces_)
{
// Early exit on error
if (operation_ != opNone)
{
file() << endl;
Log << endl;
}
return true;
}
// Many operations use the Sf field
vectorField Sf;
if (usesSf())

View File

@ -179,12 +179,11 @@ Note
Instead specify the regionType 'functionObjectSurface' and provide
the name.
- Using \c sampledSurface:
- not available for surface fields
- if interpolate=true they use \c interpolationCellPoint
otherwise they use cell values
- each triangle in \c sampledSurface is logically only in one cell
so interpolation will be wrong when triangles are larger than
cells. This can only happen for sampling on a \c triSurfaceMesh
- surface fields only supported by some surfaces
- default uses sampleScheme \c cell
- each face in \c sampledSurface is logically only in one cell
so sampling will be wrong when they are larger than cells.
This can only happen for sampling on a \c triSurfaceMesh
- take care when using isoSurfaces - these might have duplicate
triangles and so integration might be wrong
@ -384,6 +383,21 @@ private:
scalar totalArea() const;
// BACKPORT:
//- Handling of errors. The exact handling depends on the local context.
enum class error_handlerTypes : char
{
DEFAULT = 0, //!< Default behaviour (local meaning)
IGNORE, //!< Ignore on errors/problems
WARN, //!< Warn on errors/problems
STRICT //!< Fatal on errors/problems
};
//- Names of the error handler types
static const Enum<error_handlerTypes> error_handlerNames;
protected:
// Protected Data
@ -404,7 +418,7 @@ protected:
bool writeArea_;
//- Handling of empty surfaces (nFaces = 0). Default is Fatal.
error::handlerTypes emptySurfaceError_;
error_handlerTypes emptySurfaceError_; // BACKPORT
//- Extended selections
wordRes selectionNames_;

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017, 2020 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -415,21 +415,21 @@ void Foam::particle::locate
{
if (debug)
{
Info << "Particle " << origId() << nl << FUNCTION_NAME << nl << endl;
Pout<< "Particle " << origId() << nl << FUNCTION_NAME << nl << endl;
}
celli_ = celli;
// Find the cell, if it has not been given
if (celli < 0)
if (celli_ < 0)
{
celli_ = mesh_.cellTree().findInside(position);
}
if (celli < 0)
{
FatalErrorInFunction
<< "Cell not found for particle position " << position << "."
<< exit(FatalError);
if (celli_ < 0)
{
FatalErrorInFunction
<< "Cell not found for particle position " << position << "."
<< exit(FatalError);
}
}
const vector displacement = position - mesh_.cellCentres()[celli_];
@ -811,10 +811,10 @@ Foam::scalar Foam::particle::trackToStationaryTri
if (debug)
{
Info << "Step Fraction : " << stepFraction_ << endl;
Info << "fraction*muH*detA : " << fraction*muH*detA << endl;
Info << "static muH : " << muH << endl;
Info << "origId() : " << origId() << endl;
Pout << "Step Fraction : " << stepFraction_ << endl;
Pout << "fraction*muH*detA : " << fraction*muH*detA << endl;
Pout << "static muH : " << muH << endl;
Pout << "origId() : " << origId() << endl;
}
// Accumulate displacement behind
@ -864,7 +864,7 @@ Foam::scalar Foam::particle::trackToMovingTri
{
Pair<vector> o, b, v1, v2;
movingTetGeometry(fraction, o, b, v1, v2);
Info<< "Tet points o=" << o[0] << ", b=" << b[0]
Pout<< "Tet points o=" << o[0] << ", b=" << b[0]
<< ", v1=" << v1[0] << ", v2=" << v2[0] << endl
<< "Tet determinant = " << detA[0] << endl
<< "Start local coordinates = " << y0[0] << endl;
@ -895,10 +895,10 @@ Foam::scalar Foam::particle::trackToMovingTri
{
for (label i = 0; i < 4; ++ i)
{
Info<< (i ? " " : "Hit equation ") << i << " = "
Pout<< (i ? " " : "Hit equation ") << i << " = "
<< hitEqn[i] << endl;
}
Info<< " DetA equation = " << detA << endl;
Pout<< " DetA equation = " << detA << endl;
}
// Calculate the hit fraction
@ -927,12 +927,12 @@ Foam::scalar Foam::particle::trackToMovingTri
);
const scalar detAH = detAEqn.value(mu[j]);
Info<< "Hit on tet face " << i << " at local coordinate "
Pout<< "Hit on tet face " << i << " at local coordinate "
<< (std::isnormal(detAH) ? name(yH/detAH) : "???")
<< ", " << mu[j]*detA[0]*100 << "% of the "
<< "way along the track" << endl;
Info<< "derivative : " << hitEqn[i].derivative(mu[j]) << nl
Pout<< "derivative : " << hitEqn[i].derivative(mu[j]) << nl
<< " coord " << j << " mu[j]: " << mu[j] << nl
<< " hitEq " << i << endl;
}

View File

@ -843,15 +843,15 @@ Foam::meshToMesh::mapTgtToSrc
label srcPatchi = srcPatchID_[i];
label tgtPatchi = tgtPatchID_[i];
if (!srcPatchFields.set(tgtPatchi))
if (!srcPatchFields.set(srcPatchi))
{
srcPatchFields.set
(
srcPatchi,
fvPatchField<Type>::New
(
tgtBfld[srcPatchi],
srcMesh.boundary()[tgtPatchi],
tgtBfld[tgtPatchi],
srcMesh.boundary()[srcPatchi],
DimensionedField<Type, volMesh>::null(),
directFvPatchFieldMapper
(