factory_create Function

private function factory_create(this, config) result(method)

Create a quantum chemistry method instance from configuration

Instantiates the appropriate concrete method type based on config%method_type and configures it from the nested config.

Type Bound

method_factory_t

Arguments

Type IntentOptional Attributes Name
class(method_factory_t), intent(in) :: this
type(method_config_t), intent(in) :: config

Return Value class(qc_method_t), allocatable


Calls

proc~~factory_create~~CallsGraph proc~factory_create method_factory_t%factory_create proc~configure_dft configure_dft proc~factory_create->proc~configure_dft proc~configure_hf configure_hf proc~factory_create->proc~configure_hf proc~configure_mcscf configure_mcscf proc~factory_create->proc~configure_mcscf proc~configure_xtb configure_xtb proc~factory_create->proc~configure_xtb state_weights state_weights proc~configure_mcscf->state_weights proc~method_type_to_string method_type_to_string proc~configure_xtb->proc~method_type_to_string proc~xtb_has_solvation xtb_config_t%xtb_has_solvation proc~configure_xtb->proc~xtb_has_solvation

Called by

proc~~factory_create~~CalledByGraph proc~factory_create method_factory_t%factory_create proc~create_method create_method proc~create_method->proc~factory_create proc~do_fragment_work do_fragment_work proc~do_fragment_work->proc~create_method proc~hessian_coordinator hessian_coordinator proc~hessian_coordinator->proc~create_method proc~hessian_worker hessian_worker proc~hessian_worker->proc~create_method interface~do_fragment_work do_fragment_work interface~do_fragment_work->proc~do_fragment_work interface~hessian_coordinator hessian_coordinator interface~hessian_coordinator->proc~hessian_coordinator interface~hessian_worker hessian_worker interface~hessian_worker->proc~hessian_worker proc~distributed_unfragmented_hessian distributed_unfragmented_hessian proc~distributed_unfragmented_hessian->interface~hessian_coordinator proc~distributed_unfragmented_hessian->interface~hessian_worker proc~node_worker node_worker proc~node_worker->interface~do_fragment_work proc~serial_fragment_processor serial_fragment_processor proc~serial_fragment_processor->interface~do_fragment_work proc~serial_gmbe_pie_processor serial_gmbe_pie_processor proc~serial_gmbe_pie_processor->interface~do_fragment_work proc~unfragmented_calculation unfragmented_calculation proc~unfragmented_calculation->interface~do_fragment_work interface~distributed_unfragmented_hessian distributed_unfragmented_hessian interface~distributed_unfragmented_hessian->proc~distributed_unfragmented_hessian interface~node_worker node_worker interface~node_worker->proc~node_worker interface~serial_fragment_processor serial_fragment_processor interface~serial_fragment_processor->proc~serial_fragment_processor interface~unfragmented_calculation unfragmented_calculation interface~unfragmented_calculation->proc~unfragmented_calculation proc~gmbe_run_serial gmbe_context_t%gmbe_run_serial proc~gmbe_run_serial->proc~serial_gmbe_pie_processor

Source Code

   function factory_create(this, config) result(method)
      !! Create a quantum chemistry method instance from configuration
      !!
      !! Instantiates the appropriate concrete method type based on
      !! config%method_type and configures it from the nested config.
      class(method_factory_t), intent(in) :: this
      type(method_config_t), intent(in) :: config
      class(qc_method_t), allocatable :: method

      select case (config%method_type)
#ifndef MQC_WITHOUT_TBLITE
      case (METHOD_TYPE_GFN1, METHOD_TYPE_GFN2)
         allocate (xtb_method_t :: method)
         call configure_xtb(method, config)
#else
      case (METHOD_TYPE_GFN1, METHOD_TYPE_GFN2)
         error stop "XTB methods require tblite library (MQC_ENABLE_TBLITE)"
#endif

      case (METHOD_TYPE_HF)
         allocate (hf_method_t :: method)
         call configure_hf(method, config)

      case (METHOD_TYPE_DFT)
         allocate (dft_method_t :: method)
         call configure_dft(method, config)

      case (METHOD_TYPE_MCSCF)
         allocate (mcscf_method_t :: method)
         call configure_mcscf(method, config)

      case default
         error stop "Unknown method type in method_factory_t%create"
      end select
   end function factory_create