Exemplo n.º 1
0
relaxationShape::relaxationShape
(
    const word& subDictName,
    const fvMesh& mesh
)
:
    IOdictionary
    (
        mesh.thisDb().lookupObject<IOobject>("waveProperties")
    ),

    mesh_(mesh),
    coeffDict_(subDict(subDictName + "Coeffs").subDict("relaxationZone")),
    PI_( M_PI ),

    refreshIndexCells_(-1),

    refreshIndexSigma_(-1)
{
    vector g( uniformDimensionedVectorField
        (
            mesh_.thisDb()
            .lookupObject<uniformDimensionedVectorField>("g")).value()
        );

    direction_ = g/mag(g);
}
Exemplo n.º 2
0
autoPtr<wavesPorosityModel> wavesPorosityModel::New
(
    const fvMesh& mesh
)
{
    word wavesPorosityModelTypeName;

    // Enclose the creation of the dictionary to ensure it is deleted before
    // the actual porosity model is created
    {
    	// Not successful with porosityZones, because the reading of the
    	// porous zones properties was made impossible, if an additional
    	// keyword was added.
//        IOdictionary dict
//        (
//        	IOobject
//        	(
//        	    "porosityZones",
//        	    mesh.time().constant(),
//        	    mesh,
//        	    IOobject::MUST_READ,
//        	    IOobject::NO_WRITE
//        	)
//        );
//
//        dict.lookup("wavesPorosityModel") >> wavesPorosityModelTypeName;

    	mesh.thisDb().lookupObject<IOdictionary>("waveProperties")
    		.lookup("porosityModel") >> wavesPorosityModelTypeName;
    }

    wavesPorosityModelConstructorTable::iterator cstrIter =
    		wavesPorosityModelConstructorTablePtr_->find(wavesPorosityModelTypeName);

    if (cstrIter == wavesPorosityModelConstructorTablePtr_->end())
    {
        FatalErrorIn
        (
            "wavesPorosityModel::New(const fvMesh&)"
        )   << "Unknown porosity model of type " << wavesPorosityModelTypeName
            << endl << endl
            << "Valid porosity models are :" << endl
            << wavesPorosityModelConstructorTablePtr_->toc()
            << exit(FatalError);
    }

    return autoPtr<wavesPorosityModel>(cstrIter()(mesh));
}
Exemplo n.º 3
0
autoPtr<numericalBeach> numericalBeach::New
(
	const word & subDictName,
	const fvMesh & mesh_
)
{
    word beachTypeName;

    // Enclose the creation of the waveProp to ensure it is
    // deleted before the relaxationShape is created otherwise the dictionary
    // is entered in the database twice
    {
        const dictionary coeffDict_
        (
        	(mesh_.thisDb().lookupObject<IOdictionary>("waveProperties"))
        	 .subDict(subDictName + "Coeffs")
        	 .subDict("relaxationZone")
        );

        beachTypeName = coeffDict_.lookupOrDefault<word>("beachType","Empty");
    }

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find("numericalBeach"+beachTypeName);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorIn
        (
            "numericalBeach::New(const word &, const fvMesh &)"
        )   << "Unknown beach type 'numericalBeach" << beachTypeName << "'"
            << endl << endl
            << "Valid beach types are :" << endl
            << dictionaryConstructorTablePtr_->toc()
            << exit(FatalError);
    }

    return autoPtr<numericalBeach>(cstrIter()(subDictName,mesh_));
}