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 | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(method_factory_t), | intent(in) | :: | this | |||
| type(method_config_t), | intent(in) | :: | config |
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