Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dynamicFvMesh dynamicRefineFvMeshNew;
dynamicFvMesh dfDynamicRefineFvMesh;

multiCritRefinementControls
{
enableMultiCritRefinementControl false;
}

dynamicRefineFvMeshNewCoeffs
dfDynamicRefineFvMeshCoeffs
{
// How often to refine
refineInterval 1;
Expand Down
5 changes: 2 additions & 3 deletions examples/dfHighSpeedFoam/oneD_detonationH2/system/controlDict
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
libs (
"libfieldFunctionObjects.so"
"libnewdynamicFvMesh.so"
"libdfDynamicFvMesh.so"
);

application dfHighSpeedFoam;
Expand Down Expand Up @@ -60,7 +59,7 @@ functions
minMax
{
type fieldMinMax;
libs ("libfieldFunctionObjects.so");
libs ("libdfFieldFunctionObjects.so");
writeControl writeTime; //timeStep;
fields (p);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ method scotch;

constraints
{
refinementHistory
dfRefinementHistory
{
//- Decompose cells such that all cell originating from single cell
// end up on same processor
type refinementHistory;
type dfRefinementHistory;
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/dynamicFvMesh/Make/files
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dynamicRefineFvMeshNew/multiCritRefinement.C
dynamicRefineFvMeshNew/dynamicRefineFvMeshNew.C
dfDynamicRefineFvMesh/multiCritRefinement.C
dfDynamicRefineFvMesh/dfDynamicRefineFvMesh.C

LIB = $(FOAM_USER_LIBBIN)/libnewdynamicFvMesh
dfRefinementHistoryConstraint/dfRefinementHistoryConstraint.C

LIB = $(FOAM_USER_LIBBIN)/libdfDynamicFvMesh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ License

\*---------------------------------------------------------------------------*/

#include "dynamicRefineFvMeshNew.H"
#include "dfDynamicRefineFvMesh.H"
#include "addToRunTimeSelectionTable.H"
#include "surfaceInterpolate.H"
#include "volFields.H"
Expand All @@ -40,8 +40,8 @@ License

namespace Foam
{
defineTypeNameAndDebug(dynamicRefineFvMeshNew, 0);
addToRunTimeSelectionTable(dynamicFvMesh, dynamicRefineFvMeshNew, IOobject);
defineTypeNameAndDebug(dfDynamicRefineFvMesh, 0);
addToRunTimeSelectionTable(dynamicFvMesh, dfDynamicRefineFvMesh, IOobject);


// Helper class for accessing max cell level of faces accross processor patches
Expand All @@ -58,7 +58,7 @@ namespace Foam

// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //

Foam::label Foam::dynamicRefineFvMeshNew::count
Foam::label Foam::dfDynamicRefineFvMesh::count
(
const PackedBoolList& l,
const unsigned int val
Expand All @@ -84,7 +84,7 @@ Foam::label Foam::dynamicRefineFvMeshNew::count
}


void Foam::dynamicRefineFvMeshNew::calculateProtectedCells
void Foam::dfDynamicRefineFvMesh::calculateProtectedCells
(
PackedBoolList& unrefineableCell
) const
Expand Down Expand Up @@ -190,7 +190,7 @@ void Foam::dynamicRefineFvMeshNew::calculateProtectedCells
}


void Foam::dynamicRefineFvMeshNew::readDict()
void Foam::dfDynamicRefineFvMesh::readDict()
{
dictionary refineDict
(
Expand Down Expand Up @@ -239,7 +239,7 @@ void Foam::dynamicRefineFvMeshNew::readDict()

// Refines cells, maps fields and recalculates (an approximate) flux
Foam::autoPtr<Foam::mapPolyMesh>
Foam::dynamicRefineFvMeshNew::refine
Foam::dfDynamicRefineFvMesh::refine
(
const labelList& cellsToRefine
)
Expand Down Expand Up @@ -501,7 +501,7 @@ Foam::dynamicRefineFvMeshNew::refine


Foam::autoPtr<Foam::mapPolyMesh>
Foam::dynamicRefineFvMeshNew::unrefine
Foam::dfDynamicRefineFvMesh::unrefine
(
const labelList& splitElems
)
Expand Down Expand Up @@ -667,7 +667,7 @@ Foam::dynamicRefineFvMeshNew::unrefine


Foam::scalarField
Foam::dynamicRefineFvMeshNew::maxPointField(const scalarField& pFld) const
Foam::dfDynamicRefineFvMesh::maxPointField(const scalarField& pFld) const
{
scalarField vFld(nCells(), -GREAT);

Expand All @@ -684,7 +684,7 @@ Foam::dynamicRefineFvMeshNew::maxPointField(const scalarField& pFld) const
}

Foam::scalarField
Foam::dynamicRefineFvMeshNew::maxCellField(const volScalarField& vFld) const
Foam::dfDynamicRefineFvMesh::maxCellField(const volScalarField& vFld) const
{
scalarField pFld(nPoints(), -GREAT);

Expand All @@ -702,7 +702,7 @@ Foam::dynamicRefineFvMeshNew::maxCellField(const volScalarField& vFld) const

/*
Foam::scalarField
Foam::dynamicRefineFvMeshNew::minCellField(const volScalarField& vFld) const
Foam::dfDynamicRefineFvMesh::minCellField(const volScalarField& vFld) const
{
scalarField pFld(nPoints(), -GREAT);

Expand All @@ -721,7 +721,7 @@ Foam::dynamicRefineFvMeshNew::minCellField(const volScalarField& vFld) const

// Simple (non-parallel) interpolation by averaging.
Foam::scalarField
Foam::dynamicRefineFvMeshNew::cellToPoint(const scalarField& vFld) const
Foam::dfDynamicRefineFvMesh::cellToPoint(const scalarField& vFld) const
{
scalarField pFld(nPoints());

Expand All @@ -740,7 +740,7 @@ Foam::dynamicRefineFvMeshNew::cellToPoint(const scalarField& vFld) const
}


Foam::scalarField Foam::dynamicRefineFvMeshNew::error
Foam::scalarField Foam::dfDynamicRefineFvMesh::error
(
const scalarField& fld,
const scalar minLevel,
Expand All @@ -762,7 +762,7 @@ Foam::scalarField Foam::dynamicRefineFvMeshNew::error
}


void Foam::dynamicRefineFvMeshNew::selectRefineCandidates
void Foam::dfDynamicRefineFvMesh::selectRefineCandidates
(
const scalar lowerRefineLevel,
const scalar upperRefineLevel,
Expand Down Expand Up @@ -810,7 +810,7 @@ void Foam::dynamicRefineFvMeshNew::selectRefineCandidates
}


Foam::labelList Foam::dynamicRefineFvMeshNew::selectRefineCells
Foam::labelList Foam::dfDynamicRefineFvMesh::selectRefineCells
(
const label maxCells,
const label maxRefinement,
Expand Down Expand Up @@ -900,7 +900,7 @@ Foam::labelList Foam::dynamicRefineFvMeshNew::selectRefineCells
// YO- This is here only to preserve compatibility with the official release.
// It is not used by the refinement procedure, but some utilities such as
// decomposePar rely on it.
Foam::labelList Foam::dynamicRefineFvMeshNew::selectUnrefinePoints
Foam::labelList Foam::dfDynamicRefineFvMesh::selectUnrefinePoints
(
const scalar unrefineLevel,
const PackedBoolList& markedCell,
Expand Down Expand Up @@ -960,7 +960,7 @@ Foam::labelList Foam::dynamicRefineFvMeshNew::selectUnrefinePoints
}
//-YO

void Foam::dynamicRefineFvMeshNew::extendMarkedCells
void Foam::dfDynamicRefineFvMesh::extendMarkedCells
(
PackedBoolList& markedCell
) const
Expand Down Expand Up @@ -1002,7 +1002,7 @@ void Foam::dynamicRefineFvMeshNew::extendMarkedCells
}


void Foam::dynamicRefineFvMeshNew::checkEightAnchorPoints
void Foam::dfDynamicRefineFvMesh::checkEightAnchorPoints
(
PackedBoolList& protectedCell,
label& nProtected
Expand Down Expand Up @@ -1053,7 +1053,7 @@ void Foam::dynamicRefineFvMeshNew::checkEightAnchorPoints


template <class T>
void Foam::dynamicRefineFvMeshNew::mapNewInternalFaces
void Foam::dfDynamicRefineFvMesh::mapNewInternalFaces
(
const labelList& faceMap
)
Expand All @@ -1073,7 +1073,7 @@ void Foam::dynamicRefineFvMeshNew::mapNewInternalFaces
{
if (debug)
{
Info << "dynamicRefineFvMeshNew::mapNewInternalFaces(): " <<iter.key()<< endl;
Info << "dfDynamicRefineFvMesh::mapNewInternalFaces(): " <<iter.key()<< endl;
}

Field<T> tsFld(this->nFaces(), pTraits<T>::zero);
Expand Down Expand Up @@ -1183,7 +1183,7 @@ void Foam::dynamicRefineFvMeshNew::mapNewInternalFaces

// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

Foam::dynamicRefineFvMeshNew::dynamicRefineFvMeshNew(const IOobject& io)
Foam::dfDynamicRefineFvMesh::dfDynamicRefineFvMesh(const IOobject& io)
:
dynamicFvMesh(io),
meshCutter_(hexRef::New(*this)),
Expand Down Expand Up @@ -1574,13 +1574,13 @@ Foam::dynamicRefineFvMeshNew::dynamicRefineFvMeshNew(const IOobject& io)

// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //

Foam::dynamicRefineFvMeshNew::~dynamicRefineFvMeshNew()
Foam::dfDynamicRefineFvMesh::~dfDynamicRefineFvMesh()
{}


// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

bool Foam::dynamicRefineFvMeshNew::update()
bool Foam::dfDynamicRefineFvMesh::update()
{
// Re-read dictionary. Choosen since usually -small so trivial amount
// of time compared to actual refinement. Also very useful to be able
Expand Down Expand Up @@ -1633,7 +1633,7 @@ bool Foam::dynamicRefineFvMeshNew::update()
// reads multiple refinement criteria if subdict multiCritRefinementControls
// in dynamicMeshDict is present or else does nothing
// calculates the multiCritRefinementField which needs to be set as field in
// dynamicRefineFvMeshNewCoeffs.field multiCritRefinementField;
// dfDynamicRefineFvMeshCoeffs.field multiCritRefinementField;
multiCritRefinement_.updateRefinementField();
}

Expand Down Expand Up @@ -1783,7 +1783,7 @@ bool Foam::dynamicRefineFvMeshNew::update()
{
// Compact refinement history occassionally (how often?).
// Unrefinement causes holes in the refinementHistory.
const_cast<refinementHistory&>(meshCutter()->history()).compact();
const_cast<dfRefinementHistory&>(meshCutter()->history()).compact();
}
nRefinementIterations_++;
}
Expand All @@ -1800,20 +1800,21 @@ bool Foam::dynamicRefineFvMeshNew::update()
}


bool Foam::dynamicRefineFvMeshNew::writeObject
bool Foam::dfDynamicRefineFvMesh::writeObject
(
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp
IOstream::compressionType cmp,
const bool write
) const
{
// Force refinement data to go to the current time directory.
const_cast<hexRef&>(meshCutter_()).setInstance(time().timeName());

bool writeOk =
(
dynamicFvMesh::writeObject(fmt, ver, cmp)
&& meshCutter_->write()
dynamicFvMesh::writeObject(fmt, ver, cmp, write)
&& meshCutter_->write(write)
);

if (dumpLevel_)
Expand All @@ -1830,7 +1831,8 @@ bool Foam::dynamicRefineFvMeshNew::writeObject
false
),
*this,
dimensionedScalar("level", dimless, 0)
// dimensionedScalar("level", dimless, 0)
dimensionedScalar(dimless, 0)
);

const labelList& cellLevel = meshCutter_->cellLevel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.

Class
Foam::dynamicRefineFvMesh
Foam::dfDynamicRefineFvMesh

Description
A fvMesh with built-in multi-criteria refinement.
Expand Down Expand Up @@ -89,8 +89,8 @@ Authors:

\*---------------------------------------------------------------------------*/

#ifndef dynamicRefineFvMeshNew_H
#define dynamicRefineFvMeshNew_H
#ifndef dfDynamicRefineFvMesh_H
#define dfDynamicRefineFvMesh_H

#include "dynamicFvMesh.H"
#include "hexRef.H"
Expand All @@ -105,10 +105,10 @@ namespace Foam
{

/*---------------------------------------------------------------------------*\
Class dynamicRefineFvMeshNew Declaration
Class dfDynamicRefineFvMesh Declaration
\*---------------------------------------------------------------------------*/

class dynamicRefineFvMeshNew
class dfDynamicRefineFvMesh
:
public dynamicFvMesh
{
Expand Down Expand Up @@ -230,25 +230,25 @@ protected:
private:

//- Disallow default bitwise copy construct
dynamicRefineFvMeshNew(const dynamicRefineFvMeshNew&);
dfDynamicRefineFvMesh(const dfDynamicRefineFvMesh&);

//- Disallow default bitwise assignment
void operator=(const dynamicRefineFvMeshNew&);
void operator=(const dfDynamicRefineFvMesh&);

public:

//- Runtime type information
TypeName("dynamicRefineFvMeshNew");
TypeName("dfDynamicRefineFvMesh");


// Constructors

//- Construct from IOobject
explicit dynamicRefineFvMeshNew(const IOobject& io);
explicit dfDynamicRefineFvMesh(const IOobject& io);


//- Destructor
virtual ~dynamicRefineFvMeshNew();
virtual ~dfDynamicRefineFvMesh();


// Member Functions
Expand Down Expand Up @@ -282,7 +282,8 @@ public:
(
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
IOstream::compressionType cmp
IOstream::compressionType cmp,
const bool write = true
) const;

};
Expand Down
Loading