当前位置: 首页>>代码示例>>C++>>正文


C++ ConfigTree::ignoreConfParam方法代码示例

本文整理汇总了C++中baselib::ConfigTree::ignoreConfParam方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigTree::ignoreConfParam方法的具体用法?C++ ConfigTree::ignoreConfParam怎么用?C++ ConfigTree::ignoreConfParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在baselib::ConfigTree的用法示例。


在下文中一共展示了ConfigTree::ignoreConfParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

ProcessVariable::ProcessVariable(BaseLib::ConfigTree const& config,
                                 MeshLib::Mesh& mesh,
                                 GeoLib::GEOObjects const& geometries)
    : _name(config.getConfParam<std::string>("name")),
      _mesh(mesh),
      _n_components(config.getConfParam<int>("components"))
{
	DBUG("Constructing process variable %s", this->_name.c_str());

	// Initial condition
	if (auto ic_config = config.getConfSubtreeOptional("initial_condition"))
	{
		auto const type = ic_config->peekConfParam<std::string>("type");
		if (type == "Uniform")
		{
			_initial_condition =
			    createUniformInitialCondition(*ic_config, _n_components);
		}
		else if (type == "MeshProperty")
		{
			_initial_condition =
			    createMeshPropertyInitialCondition(*ic_config, _mesh, _n_components);
		}
		else
		{
			ERR("Unknown type of the initial condition.");
		}
	}
	else
	{
		INFO("No initial condition found.");
	}

	// Boundary conditions
	if (auto bcs_config = config.getConfSubtreeOptional("boundary_conditions"))
	{
		for (auto bc_config
			 : bcs_config->getConfSubtreeList("boundary_condition"))
		{
			auto const geometrical_set_name =
					bc_config.getConfParam<std::string>("geometrical_set");
			auto const geometry_name =
					bc_config.getConfParam<std::string>("geometry");

			GeoLib::GeoObject const* const geometry =
			    geometries.getGeoObject(geometrical_set_name, geometry_name);
			DBUG(
			    "Found geometry type \"%s\"",
			    GeoLib::convertGeoTypeToString(geometry->getGeoType()).c_str());

			// Construct type dependent boundary condition
			auto const type = bc_config.peekConfParam<std::string>("type");

			if (type == "UniformDirichlet")
			{
				_dirichlet_bc_configs.emplace_back(
				    new UniformDirichletBoundaryCondition(geometry, bc_config));
			}
			else if (type == "UniformNeumann")
			{
				_neumann_bc_configs.emplace_back(
				    new NeumannBcConfig(geometry, bc_config));
			}
			else
			{
				ERR("Unknown type \'%s\' of the boundary condition.",
				    type.c_str());
			}
		}
	} else {
		INFO("No boundary conditions found.");
	}

	// Source Terms
	config.ignoreConfParam("source_terms");
}
开发者ID:yajiewu,项目名称:ogs,代码行数:76,代码来源:ProcessVariable.cpp


注:本文中的baselib::ConfigTree::ignoreConfParam方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。