18#ifndef FACTORY_HELPER_HPP
19#define FACTORY_HELPER_HPP
24#include "MetaMat/MetaMat"
27 switch(W->storage_type) {
30 if(
SolverType::CUDA == W->solver)
return std::make_unique<FullMatCUDA<T>>(W->n_size, W->n_size);
32 return std::make_unique<FullMat<T>>(W->n_size, W->n_size);
34 if(
SolverType::SPIKE == W->solver)
return std::make_unique<BandMatSpike<T>>(W->n_size, W->n_lobw, W->n_upbw);
35 return std::make_unique<BandMat<T>>(W->n_size, W->n_lobw, W->n_upbw);
37 return std::make_unique<BandSymmMat<T>>(W->n_size, W->n_lobw);
39 return std::make_unique<SymmPackMat<T>>(W->n_size);
41 if(
SolverType::MUMPS == W->solver)
return std::make_unique<SparseMatMUMPS<T>>(W->n_size, W->n_size, W->n_elem);
42 if(
SolverType::SUPERLU == W->solver)
return std::make_unique<SparseMatSuperLU<T>>(W->n_size, W->n_size, W->n_elem);
44 if(
SolverType::PARDISO == W->solver)
return std::make_unique<SparseMatPARDISO<T>>(W->n_size, W->n_size, W->n_elem);
45 if(
SolverType::FGMRES == W->solver)
return std::make_unique<SparseMatFGMRES<T>>(W->n_size, W->n_size, W->n_elem);
48 if(
SolverType::CUDA == W->solver)
return std::make_unique<SparseMatCUDA<T>>(W->n_size, W->n_size, W->n_elem);
50 return std::make_unique<SparseMatSuperLU<T>>(W->n_size, W->n_size, W->n_elem);
53 if(
SolverType::FGMRES == W->solver)
return std::make_unique<SparseSymmMatFGMRES<T>>(W->n_size, W->n_size, W->n_elem);
55 return std::make_unique<SparseSymmMatMUMPS<T>>(W->n_size, W->n_size, W->n_elem);
57 throw invalid_argument(
"need a proper storage scheme");
64 global_mat->set_solver_setting(W->setting);
69template<sp_d T1> shared_ptr<MetaMat<T1>>&
get_mass(
const shared_ptr<
Factory<T1>>& W) {
return W->global_mass; }
71template<sp_d T1> shared_ptr<MetaMat<T1>>&
get_damping(
const shared_ptr<
Factory<T1>>& W) {
return W->global_damping; }
Col< T > & get_trial_resistance(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:107
Col< T > & get_current_displacement(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:157
Col< T > & get_pre_velocity(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:181
SpMat< T > & get_auxiliary_stiffness(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:93
Col< T > & get_incre_resistance(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:129
Col< T > & get_trial_settlement(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:105
SpCol< T1 > & get_current_constraint_resistance(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:97
Col< T1 > & get_incre_load_factor(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:123
Col< T > & get_incre_inertial_force(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:133
shared_ptr< MetaMat< T1 > > & get_geometry(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:75
Col< T > & get_current_velocity(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:159
Col< T > & get_pre_acceleration(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:183
Col< T > & get_current_damping_force(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:153
Col< T > & get_trial_temperature(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:119
Col< T > & get_trial_velocity(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:115
Mat< T > & get_eigenvector(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:189
SpMat< T > & get_reference_load(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:83
unique_ptr< MetaMat< T > > get_basic_container(const Factory< T > *const W)
Definition: FactoryHelper.hpp:26
Col< T > & get_incre_temperature(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:141
Col< T > & get_trial_damping_force(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:109
Col< T > & get_incre_displacement(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:135
Col< T > & get_trial_load(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:103
T & get_incre_time(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:121
Col< T > & get_pre_load(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:169
Col< T > & get_eigenvalue(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:187
Col< T > & get_current_load(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:147
Col< T > & get_trial_inertial_force(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:111
Col< T1 > & get_pre_load_factor(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:167
Col< T > & get_current_acceleration(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:161
SpCol< T1 > & get_trial_constraint_resistance(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:95
shared_ptr< MetaMat< T1 > > & get_mass(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:69
shared_ptr< MetaMat< T1 > > & get_stiffness(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:73
Col< T > & get_current_resistance(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:151
Col< T1 > & get_auxiliary_lambda(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:87
Col< T > & get_ninja(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:77
Col< T > & get_incre_acceleration(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:139
Col< T > & get_auxiliary_load(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:91
Col< T > & get_incre_velocity(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:137
Col< T > & get_current_inertial_force(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:155
suanpan::set< uword > & get_reference_dof(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:81
Col< T > & get_pre_inertial_force(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:177
Col< T > & get_pre_damping_force(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:175
Col< T1 > & get_current_load_factor(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:145
unique_ptr< MetaMat< T > > get_matrix_container(const Factory< T > *const W)
Definition: FactoryHelper.hpp:61
T & get_pre_time(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:165
Col< T > & get_incre_settlement(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:127
Col< T > & get_incre_load(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:125
Col< T > & get_trial_displacement(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:113
Col< T > & get_pre_settlement(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:171
uvec & get_auxiliary_encoding(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:85
Col< T > & get_sushi(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:79
Col< T > & get_pre_temperature(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:185
Col< T > & get_trial_acceleration(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:117
Col< T > & get_current_temperature(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:163
Col< T1 > & get_trial_load_factor(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:101
Col< T > & get_current_settlement(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:149
Col< T > & get_pre_displacement(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:179
Col< T > & get_incre_damping_force(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:131
Col< T > & get_auxiliary_resistance(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:89
Col< T > & get_pre_resistance(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:173
T & get_current_time(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:143
T & get_trial_time(const shared_ptr< Factory< T > > &W)
Definition: FactoryHelper.hpp:99
shared_ptr< MetaMat< T1 > > & get_damping(const shared_ptr< Factory< T1 > > &W)
Definition: FactoryHelper.hpp:71
A Factory class.
Definition: Factory.hpp:67
std::set< T > set
Definition: container.h:54