- Timestamp:
- Apr 23, 2021, 8:51:43 PM (5 years ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- 1be100
- Parents:
- 0f9eb0
- git-author:
- Frederik Heber <frederik.heber@…> (03/27/21 14:54:53)
- git-committer:
- Frederik Heber <frederik.heber@…> (04/23/21 20:51:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/GraphAction/ChemicalSpaceEvaluatorAction.cpp
r0f9eb0 rd951a5 160 160 static SaturatedGraph saturateGraph( 161 161 const graph_type &graph, 162 const Extractors::nodes_t &nodes,163 162 const BoostGraphCreator::name_map_t &name_map, 164 163 const Extractors::type_index_lookup_t &type_index_lookup, … … 192 191 } 193 192 193 LOG(2, "DEBUG: Saturating graph with " << boost::num_vertices(newgraph.saturated_graph) << " nodes."); 194 194 size_t no_nodes = boost::num_vertices(newgraph.saturated_graph); 195 195 // step through every node, sum up its degrees … … 406 406 } 407 407 408 // put all nodes in a list 409 Extractors::nodes_t nodes; 410 for (size_t nodeid = 0; nodeid < nodes_in_graph; ++nodeid) { 411 nodes.insert(nodeid); 412 } 413 408 414 typedef std::vector< 409 415 std::pair< … … 416 422 degrees_iter != list_of_edge_degrees.end(); ++degrees_iter) { 417 423 const degrees_t ¤t_degrees = *degrees_iter; 424 LOG(2, "DEBUG: Current degree combination is " << current_degrees); 425 426 // saturate subgraph: add to nodes, add to type_index_lookup, index_map 427 // saturate any leftover valence with hydrogen nodes 428 SaturatedGraph fullgraph = 429 saturateGraph(graph, name_map, 430 type_index_lookup, type_valence_map, edge_index, 431 edges, current_degrees); 432 433 // don't add if one of the node's valence cannot be fulfilled 434 if (!fullgraph.ValencesAllFulfilled) { 435 LOG(2, "DEBUG: The degree combination " << current_degrees << " can NOT be fulfilled."); 436 continue; 437 } else { 438 LOG(2, "DEBUG: The degree combination is admissable."); 439 } 440 418 441 419 442 // simply sum up the contributions from all fragments for the total energy … … 426 449 nodesiter != set_of_nodes.end(); ++nodesiter) { 427 450 const Extractors::nodes_t ¤t_nodes = *nodesiter; 428 LOG(2, "DEBUG: Nodes for graph are " << current_nodes);451 LOG(2, "DEBUG: Fragment nodes for graph are " << current_nodes); 429 452 430 453 // create subgraph … … 438 461 for (; viter != vend; ++viter) { 439 462 const atomId_t vindex = boost::get(new_name_map, *viter); 440 LOG(4, "DEBUG: Copied node has index " << vindex);463 LOG(4, "DEBUG: Copied node in fragment has index " << vindex); 441 464 } 442 465 } … … 444 467 // saturate subgraph: add to nodes, add to type_index_lookup, index_map 445 468 // saturate any leftover valence with hydrogen nodes 446 SaturatedGraph f ullgraph =447 saturateGraph(newgraph, current_nodes,new_name_map,469 SaturatedGraph fragmentgraph = 470 saturateGraph(newgraph, new_name_map, 448 471 type_index_lookup, type_valence_map, edge_index, 449 472 edges, current_degrees); 450 473 451 474 // don't add if one of the node's valence cannot be fulfilled 452 if (!fullgraph.ValencesAllFulfilled)453 continue;475 ASSERT(fragmentgraph.ValencesAllFulfilled, 476 "GraphChemicalSpaceEvaluatorAction::performCall() - encountered subgraph whose valences cannot be fulfilled."); 454 477 455 478 const Extractors::index_map_t subgraph_index_map = 456 boost::get(boost::vertex_index, f ullgraph.saturated_graph);457 const BoostGraphCreator::name_map_t subgraph_name_map =458 boost::get(boost::vertex_name, fullgraph.saturated_graph);479 boost::get(boost::vertex_index, fragmentgraph.saturated_graph); 480 // const BoostGraphCreator::name_map_t subgraph_name_map = 481 // boost::get(boost::vertex_name, fragmentgraph.saturated_graph); 459 482 460 483 Extractors::nodes_t saturated_nodes; 461 484 BoostGraphCreator::vertex_iter viter, vend; 462 boost::tie(viter, vend) = boost::vertices(f ullgraph.saturated_graph);485 boost::tie(viter, vend) = boost::vertices(fragmentgraph.saturated_graph); 463 486 for (; viter != vend; ++viter) { 464 487 const Extractors::node_t vindex = boost::get(subgraph_index_map, *viter); 465 LOG(4, "DEBUG: Adding node index " << vindex << " to saturated nodes list."); 488 LOG(4, "DEBUG: Adding fragment node index " << vindex << " of type " 489 << Extractors::getParticleTypeToNode(fragmentgraph.type_index_lookup, vindex) 490 << " to saturated fragment nodes list."); 466 491 saturated_nodes.insert(vindex); 467 492 } … … 470 495 Extractors::createHomologyGraphFromNodes( 471 496 saturated_nodes, 472 f ullgraph.type_index_lookup,473 f ullgraph.saturated_graph,497 fragmentgraph.type_index_lookup, 498 fragmentgraph.saturated_graph, 474 499 subgraph_index_map); 475 LOG(2, "DEBUG: Looking for graph " << nodes_graph);500 LOG(2, "DEBUG: Looking for fragment graphs " << nodes_graph << " in homology container."); 476 501 477 502 /// Query HomologyContainer for this HomologyGraph. … … 487 512 } 488 513 } 489 LOG(1, "The graph with degrees " << *degrees_iter << " has a totalenergy of " << total_energy);514 LOG(1, "The graph with degrees " << current_degrees << " has a total BOSSANOVA energy of " << total_energy); 490 515 } 491 516
Note:
See TracChangeset
for help on using the changeset viewer.
