示例#1
0
Foam::autoPtr<Foam::IsotropyModel<CloudType>>
Foam::IsotropyModel<CloudType>::New
(
    const dictionary& dict,
    CloudType& owner
)
{
    word modelType(dict.lookup(typeName));

    Info<< "Selecting isotropy model " << modelType << endl;

    typename dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(modelType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown isotropy model type " << modelType
            << ", constructor not in hash table" << nl << nl
            << "    Valid isotropy model types are:" << nl
            << dictionaryConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

    return
        autoPtr<IsotropyModel<CloudType>>
        (
            cstrIter()(dict, owner)
        );
}
autoPtr<heatTransferModel> heatTransferModel::New
(
    const surfaceFilmModel& model,
    const dictionary& dict
)
{
    word modelType(dict.lookup("heatTransferModel"));

    Info<< "    Selecting heatTransferModel " << modelType << endl;

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(modelType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorIn
        (
            "heatTransferModel::New(const surfaceFilmModel&, const dictionary&)"
        )   << "Unknown heatTransferModel type " << modelType << nl << nl
            << "Valid heatTransferModel types are:" << nl
            << dictionaryConstructorTablePtr_->toc()
            << exit(FatalError);
    }

    return autoPtr<heatTransferModel>(cstrIter()(model, dict));
}
Foam::autoPtr<Foam::StochasticCollisionModel<CloudType> >
Foam::StochasticCollisionModel<CloudType>::New
(
    const dictionary& dict,
    CloudType& owner
)
{
    word modelType(dict.lookup("stochasticCollisionModel"));

    Info<< "Selecting StochasticCollisionModel " << modelType << endl;

    typename dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(modelType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorIn
        (
            "StochasticCollisionModel<CloudType>::New"
            "("
                "const dictionary&, "
                "CloudType&"
            ")"
        )   << "Unknown StochasticCollisionModelType type "
            << modelType << ", constructor not in hash table" << nl << nl
            << "    Valid StochasticCollisionModel types are:" << nl
            << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError);
    }

    return autoPtr<StochasticCollisionModel<CloudType> >
    (
        cstrIter()(dict, owner)
    );
}
autoPtr<filmRadiationModel> filmRadiationModel::New
(
    const surfaceFilmModel& model,
    const dictionary& dict
)
{
    word modelType(dict.lookup("radiationModel"));

    Info<< "    Selecting radiationModel " << modelType << endl;

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(modelType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorIn
        (
            "filmRadiationModel::New"
            "("
                "const surfaceFilmModel&, "
                "const dictionary&"
            ")"
        )   << "Unknown radiationModel type " << modelType << nl << nl
            << "Valid filmRadiationModel types are:" << nl
            << dictionaryConstructorTablePtr_->toc()
            << exit(FatalError);
    }

    return autoPtr<filmRadiationModel>(cstrIter()(model, dict));
}
Foam::autoPtr<Foam::relativeVelocityModel> Foam::relativeVelocityModel::New
(
    const dictionary& dict,
    const incompressibleTwoPhaseInteractingMixture& mixture
)
{
    word modelType(dict.lookup(typeName));

    Info<< "Selecting relative velocity model " << modelType << endl;

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(modelType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown time scale model type " << modelType
            << ", constructor not in hash table" << nl << nl
            << "    Valid time scale model types are:" << nl
            << dictionaryConstructorTablePtr_->sortedToc()
            << abort(FatalError);
    }

    return
        autoPtr<relativeVelocityModel>
        (
            cstrIter()
            (
                dict.subDict(modelType + "Coeffs"),
                mixture
            )
        );
}
示例#6
0
Foam::autoPtr<Foam::fv::option> Foam::fv::option::New
(
    const word& name,
    const dictionary& coeffs,
    const fvMesh& mesh
)
{
    word modelType(coeffs.lookup("type"));

    Info<< indent
        << "Selecting finite volume options model type " << modelType << endl;

    const_cast<Time&>(mesh.time()).libs().open
    (
        coeffs,
        "libs",
        dictionaryConstructorTablePtr_
    );

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(modelType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown Model type " << modelType << nl << nl
            << "Valid model types are:" << nl
            << dictionaryConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

    return autoPtr<option>(cstrIter()(name, modelType, coeffs, mesh));
}
示例#7
0
Foam::autoPtr<Foam::radiation::sootModel>
Foam::radiation::sootModel::New
(
    const dictionary& dict,
    const fvMesh& mesh
)
{
    word modelType("none");

    if (dict.found("sootModel"))
    {
        dict.lookup("sootModel") >> modelType;

        Info<< "Selecting sootModel " << modelType << endl;
    }
示例#8
0
	void SolarSimulation::processScenario ( const SolarScenario &scenario )
	{
		//Logger::debug("SolarSimulation::initScenario");
		
		std::string file = scenario.getModelFilename();

		FILE_TYPE type = modelType(file.c_str());
		if ( type == T3DS ) {
			figure.import3ds(file);
		} else if ( type == GTS ) {
			//Logger::debug("Calling figure.importGts("+file+")");
			figure.importGts(file);
		}
		
		input = scenario.getParameters();
		radTran = new SunRayRadiativeTransferModel(input);
	}
示例#9
0
int main(int argc, char** argv) {
	if (argc == 3) {
		// ex. "Commander.s3o"
		std::string modelName(argv[1]);
		std::string modelType(argv[2]);

		if (modelType == "--3do") {
			// CModelReader3DO m;
			// m.Load(modelName);
		}

		if (modelType == "--s3o") {
			CModelReaderS3O m;
			m.Load(modelName);
		}
	}

	return 0;
}
Foam::autoPtr<Foam::radiation::radiationModel>
Foam::radiation::radiationModel::New
(
    const volScalarField& T
)
{
    IOobject radIO
    (
        "radiationProperties",
        T.time().constant(),
        T.mesh(),
        IOobject::MUST_READ_IF_MODIFIED,
        IOobject::NO_WRITE,
        false
    );

    word modelType("none");
    if (radIO.typeHeaderOk<IOdictionary>(false))
    {
        IOdictionary(radIO).lookup("radiationModel") >> modelType;
    }
示例#11
0
QDomElement ModelPlus::toXmlData(QDomDocument &doc)
{
    QDomElement root = doc.createElement(ModelPlus::className());

    // Project info
    QDomElement cBasic = doc.createElement( "Basic" );
    cBasic.setAttribute( "name", name() );
    cBasic.setAttribute( "modelName", modelName());
    cBasic.setAttribute( "modelType", modelType());
    root.appendChild(cBasic);

    // Infos
    QDomElement cInfos = doc.createElement( "Infos" );
    cInfos.setAttribute("text",infos());
    root.appendChild(cInfos);

    // Variables
    QDomElement cVariables = variables()->toXmlData(doc,"Variables");
    root.appendChild(cVariables);

    return root;
}
bool SelectQueryResult::isValid() const
{
    return modelType() != SQLModelType::UNDEFINED
             && type() != SQLQueryResultType::UNDEFINED && !m_rows.empty();
}