コード例 #1
0
ファイル: MembraneDeformer.cpp プロジェクト: ahmidou/aphid
void MembraneDeformer::setMesh(BaseMesh * mesh)
{
	BaseDeformer::setMesh(mesh);
	
	printf("init membrane deformer");
	buildTopology();
}
コード例 #2
0
ファイル: TopologyFatTree.C プロジェクト: jinyh99/NoC-sim
void TopologyFatTree::buildTopology()
{
    buildTopology(g_cfg.net_fattree_way);
}
コード例 #3
0
Polyhedron_3 EdgeCorrector::run()
{
	DEBUG_START;
	std::map<int, int> halfedgesMap;
	std::vector<SimpleEdge_3> edges = getEdges(initialP, halfedgesMap);
	associateEdges(edges, SData);

	printAssociatedEdges(initialP, edges, halfedgesMap);

	std::vector<SimpleEdge_3> mainEdges = extractEdges(edges);
	std::cout << "Number of extracted edges: " << mainEdges.size()
		<< std::endl;
	if (mainEdges.size() == 0)
	{
		DEBUG_END;
		return initialP;
	}

	printColouredExtractedPolyhedron(initialP, mainEdges);

	std::vector<Vector_3> u, U, points;
	std::vector<double> h, H;
	std::map<int, int> map;
	FixedTopology *FT = buildTopology(initialP, mainEdges, u, U, points, h,
			H, map);
	IpoptTopologicalCorrector *FTNLP = new IpoptTopologicalCorrector(
			u, h, U, H, points, FT);
	FTNLP->enableModeZfixed();

	IpoptApplication *app = IpoptApplicationFactory();

	/* Intialize the IpoptApplication and process the options */
	if (app->Initialize() != Solve_Succeeded)
	{
		MAIN_PRINT("*** Error during initialization!");
		return initialP;
	}

	app->Options()->SetStringValue("linear_solver", "ma57");
	if (getenv("DERIVATIVE_TEST_FIRST"))
		app->Options()->SetStringValue("derivative_test", "first-order");
	else if (getenv("DERIVATIVE_TEST_SECOND"))
		app->Options()->SetStringValue("derivative_test", "second-order");
	else if (getenv("DERIVATIVE_TEST_ONLY_SECOND"))
		app->Options()->SetStringValue("derivative_test", "only-second-order");
	if (getenv("HESSIAN_APPROX"))
		app->Options()->SetStringValue("hessian_approximation", "limited-memory");

	/* Ask Ipopt to solve the problem */
	auto status = app->OptimizeTNLP(FTNLP);
	if (status != Solve_Succeeded && status != Solved_To_Acceptable_Level)
	{
		MAIN_PRINT("** The problem FAILED!");
		DEBUG_END;
		return initialP;
	}

	MAIN_PRINT("*** The problem solved!");
	globalPCLDumper(PCL_DUMPER_LEVEL_DEBUG, "INSIDE_FT_NLP-initial.ply") << initialP;
	Polyhedron_3 correctedP = obtainPolyhedron(initialP, map, FTNLP);
	globalPCLDumper(PCL_DUMPER_LEVEL_DEBUG, "INSIDE_FT_NLP-from-planes.ply") << correctedP;

	delete FTNLP;
	DEBUG_END;
	return correctedP;
}