PanPhaseField SDK
PFM_SDK Class Referenceabstract

PanDataNet/PanEngine API for Phase Field Model. More...

#include <pfm_sdk.h>

Public Member Functions

virtual int PFDB_variables (PFM_SDK_Variables *variables, char *msg)=0
 To extract the all the SDK variables defined in the current plugin. More...
 
virtual int PFDB_matrix_parameter (PFM_SDK_Variables *variables, const char *tabletype, const char *parameter, double *value, char *msg)=0
 To extract a PFDB parameter of the matrix phase. More...
 
virtual int PFDB_phase_parameter (PFM_SDK_Variables *variables, const char *phasename, const char *tabletype, const char *parameter, double *value, char *msg)=0
 To extract a PFDB parameter of a precipitate phase. More...
 
virtual int PFDB_matrix_parameter_needs_update (const char *tabletype, const char *parameter, int *needs_update, char *msg)=0
 To check if a specific matrix parameter needs a update. Typically, a parameter needs an update if it is function of SDK variables that evolves with time. More...
 
virtual int PFDB_phase_parameter_needs_update (const char *phasename, const char *tabletype, const char *parameter, int *needs_update, char *msg)=0
 To check if a parameter of precipitate phase needs a update. Typically, a parameter needs an update if it is function of SDK variables that evolves with time. More...
 
virtual int PFDB_isexist_matrix (const char *tabletype, const char *parameter)=0
 To check whether a parameter is defined in the matrix phase in the input *.pfdb file. More...
 
virtual int PFDB_isexist_phase (const char *phasename, const char *tabletype, const char *parameter)=0
 To check whether a parameter (of a precipitate phase) is defined in the matrix phase in the input *.pfdb file. More...
 
virtual int PFDB_expression_value (PFM_SDK_Variables *variables, const char *expression, double *value)=0
 To evaluate a mathematical expression that depends on the SDK variables. More...
 
virtual void get_pt_val (int thread_id, int engine_id, PFM_SDK_Input_Condition *input, PFM_SDK_Output_Data *output, char *msg, int m_panengine_mode=0)=0
 
virtual void get_pt_val_by_global (PFM_SDK_Input_Condition *input, PFM_SDK_Output_Data *output, char *msg, bool no_self_check=false)=0
 
virtual PFM_SDK_Protocal get_phase_name_protocol (char *msg)=0
 
virtual PFM_SDK_Protocal get_comp_name_protocol (char *msg)=0
 
virtual void update_comp_name_protocal (PFM_SDK_Protocal *new_protocal, char *msg)=0
 
virtual int get_num_threads ()=0
 
virtual void get_cal_condition (PFM_SDK_Input_Condition *state, int engine_id)=0
 
virtual void get_phase_names_by_initial_condition (char **&phase_names, size_t *n_names, int engine_id, char *msg)=0
 
virtual void statistic_calc_cnt (int *new_point_cnt, int *reused_point_cnt)=0
 Get counts of newly calculated points and reused points. More...
 
virtual void file_save_sdk_intermediate (int *tot_sdk_file_size_KB)=0
 Save intermedate files (binary fromat) and get the totla size of sdk intermediate files. The intermediate files are saved by SDK descontructor at the end of simulation. However, users are encouraged to save intermediate files during simulation. More...
 
virtual bool nucleation_define_user (PF_ARGS *m_args, char *msg, bool single_thread=false)=0
 Initialize SDK to calculate nucleation related properties. More...
 
virtual bool nucleation_get_prop (PFM_SDK_Input_Condition *in, PFM_SDK_Output_Data *out, int thread_id, char *msg, int m_engine_mode=0)=0
 Get precipitate composition, precipiate driving force and matrix mobility. More...
 
virtual bool get_line_compound_info (int phase_id)=0
 Get line compound info for a phase. More...
 
virtual void nucleation_file_save_sdk_intermediate (int *tot_sdk_file_size_KB)=0
 Save intermedate files (binary fromat) and get the totla size of sdk intermediate files. The intermediate files are saved by SDK descontructor at the end of simulation. However, users are encouraged to save intermediate files during simulation. More...
 
virtual shared_ptr< P_Point > debug_get_cal_pt (int thread_id, int engine_id)=0
 Get a copy of the PanEngine calculation point object. The returned object can be used to debug model calculations. More...
 
virtual int verify_dongle_for_plugin (const char *plugin_name, char *msg)=0
 To verify the dongle information for user's plugin. More...
 

Detailed Description

PanDataNet/PanEngine API for Phase Field Model.

Member Function Documentation

◆ PFDB_variables()

virtual int PFM_SDK::PFDB_variables ( PFM_SDK_Variables variables,
char *  msg 
)
pure virtual

To extract the all the SDK variables defined in the current plugin.

Parameters
[out]variablesTo store the SDK variables with their initial values.
[out]msgTo store the error message if any
Returns
0 : Success.
-1 : Error.

◆ PFDB_matrix_parameter()

virtual int PFM_SDK::PFDB_matrix_parameter ( PFM_SDK_Variables variables,
const char *  tabletype,
const char *  parameter,
double *  value,
char *  msg 
)
pure virtual

To extract a PFDB parameter of the matrix phase.

Parameters
[in]variablesSDK variables and their values.
[in]tabletypeThe type of the parameter table. (eg: phase_field_general, custom, stiffness_tensor, etc ...)
[in]parameterThe name/type of the parameter. (eg: Chemical_Gradient_Factor, Interface_Width, etc ...)
[out]valueThe value of the parameter.
[out]msgError message if any.
Returns
0 : Success.
-1 : Error.

◆ PFDB_phase_parameter()

virtual int PFM_SDK::PFDB_phase_parameter ( PFM_SDK_Variables variables,
const char *  phasename,
const char *  tabletype,
const char *  parameter,
double *  value,
char *  msg 
)
pure virtual

To extract a PFDB parameter of a precipitate phase.

Parameters
[in]variablesSDK variables and their values.
[in]phasenameThe name of the phase that the parameter belongs to.
[in]tabletypeThe type of the parameter table. (eg: custom, inter_phase, stiffness_tensor, etc ...)
[in]parameterThe name/type of the parameter. (eg: Atomic_Spacing, Interfacial_Energy, etc ...)
[out]valueThe value of the parameter.
[out]msgError message if any.
Returns
0 : Success.
-1 : Error.

◆ PFDB_matrix_parameter_needs_update()

virtual int PFM_SDK::PFDB_matrix_parameter_needs_update ( const char *  tabletype,
const char *  parameter,
int *  needs_update,
char *  msg 
)
pure virtual

To check if a specific matrix parameter needs a update. Typically, a parameter needs an update if it is function of SDK variables that evolves with time.

Parameters
[in]tabletypeThe type of the parameter table. (eg: phase_field_general, custom, stiffness_tensor, etc ...)
[in]parameterThe name/type of the parameter. (eg: Chemical_Gradient_Factor, Interface_Width, etc ...)
[out]needs_update1 : If the parameter needs to be updated, 0 : If these is no need to update.
[out]msgError message if any.
Returns
0 : Success.
-1 : Error.

◆ PFDB_phase_parameter_needs_update()

virtual int PFM_SDK::PFDB_phase_parameter_needs_update ( const char *  phasename,
const char *  tabletype,
const char *  parameter,
int *  needs_update,
char *  msg 
)
pure virtual

To check if a parameter of precipitate phase needs a update. Typically, a parameter needs an update if it is function of SDK variables that evolves with time.

Parameters
[in]phasenameThe name of the phase that the parameter belongs to.
[in]tabletypeThe type of the parameter table. (eg: custom, inter_phase, stiffness_tensor, etc ...)
[in]parameterThe name/type of the parameter. (eg: Atomic_Spacing, Interfacial_Energy, etc ...)
[out]needs_update1 : If the parameter needs to be updated, 0 : If these is no need to update.
[out]msgError message if any.
Returns
0 : Success.
-1 : Error.

◆ PFDB_isexist_matrix()

virtual int PFM_SDK::PFDB_isexist_matrix ( const char *  tabletype,
const char *  parameter 
)
pure virtual

To check whether a parameter is defined in the matrix phase in the input *.pfdb file.

Parameters
[in]tabletypeThe type of the parameter table. (eg: phase_field_general, custom, stiffness_tensor, etc ...)
[in]parameterThe name/type of the parameter. (eg: Chemical_Gradient_Factor, Interface_Width, etc ...)
Returns
1 : Parameter exists in the input *.pfdb file.
-1 : Parameter does not exist in the input *.pfdb file.

◆ PFDB_isexist_phase()

virtual int PFM_SDK::PFDB_isexist_phase ( const char *  phasename,
const char *  tabletype,
const char *  parameter 
)
pure virtual

To check whether a parameter (of a precipitate phase) is defined in the matrix phase in the input *.pfdb file.

Parameters
phasenameThe name of the phase that the parameter belongs to.
tabletypeThe type of the parameter table. (eg: custom, inter_phase, stiffness_tensor, etc ...)
parameterThe name/type of the parameter. (eg: Atomic_Spacing, Interfacial_Energy, etc ...)
Returns
1 : Parameter exists in the input *.pfdb file.
-1 : Parameter does not exist in the input *.pfdb file.

◆ PFDB_expression_value()

virtual int PFM_SDK::PFDB_expression_value ( PFM_SDK_Variables variables,
const char *  expression,
double *  value 
)
pure virtual

To evaluate a mathematical expression that depends on the SDK variables.

Parameters
[in]variablesSDK variables and their values.
[in]expressionMathematical expression.
[out]valueThe value of the expression.
Returns
0 : Success.
-1 : Error.

◆ get_pt_val()

virtual void PFM_SDK::get_pt_val ( int  thread_id,
int  engine_id,
PFM_SDK_Input_Condition input,
PFM_SDK_Output_Data output,
char *  msg,
int  m_panengine_mode = 0 
)
pure virtual

Do a point calculation using an engine

Parameters
[in]thread_idthe id of the thread (if the thread_id is beyong available number of thread, the first thread will be used). Use PFM_SDK::get_num_threads to get total number of threads
[in]engine_idthe id of the engine in the selected thread. engine_id follows the rule: (1) When only one phase is active, for example in spinodal decomposition, engine_id should always be 0; (2) When multiple phases are active, for example in precipitation with 1 matrix phase and 1 precipitate phases, the first two engines (engine_id = 0, 1) are for individual phase (mapping between phase name and engine_id is available through PFM_SDK::get_phase_name_protocol). The last engine (engine_id = 2) is for phase equilibiruim. If incorrect number of engine id is used, an error message "Error: Invalid engine id" will be returned without doing any calculation.
[in]inputthe point calculation condition
[in]m_panengine_mode(default = 0) 0: try to reuse calculated points; 1: disregarding calculated points
[out]outputthe properties from this calculation
[out]msgthe message
Returns
void

◆ get_pt_val_by_global()

virtual void PFM_SDK::get_pt_val_by_global ( PFM_SDK_Input_Condition input,
PFM_SDK_Output_Data output,
char *  msg,
bool  no_self_check = false 
)
pure virtual

Do a point calculation using global method, disregarding calculated points. When PFM_SDK::get_pt_val method gives parallel tangent phase equilibrium (for KKS model), use this method to get common tangent phase equilibrium,

Parameters
[in]inputthe point calculation condition
[in]no_self_check(default = false) self-checking is disabled or enabled. Self-chekcing of calculation result should be disabled when doing cooling simulation, since the global calculation may give unexpected phases.
[out]outputthe properties from this calculation
[out]msgthe message
Returns
void

◆ get_phase_name_protocol()

virtual PFM_SDK_Protocal PFM_SDK::get_phase_name_protocol ( char *  msg)
pure virtual

Get protocol of phase names: order of phase names used by SDK. The order of phases in PFM_SDK_Input_Condition and PFM_SDK_Output_Data should be consistent with this protocol

Returns
protocol(order) of phase names used by SDK

◆ get_comp_name_protocol()

virtual PFM_SDK_Protocal PFM_SDK::get_comp_name_protocol ( char *  msg)
pure virtual

Get protocol of element names: order of element names used by SDK. The order of component in PFM_SDK_Input_Condition and PFM_SDK_Output_Data should be consistent with this protocol

Returns
protocol(order) of component names used by SDK

◆ update_comp_name_protocal()

virtual void PFM_SDK::update_comp_name_protocal ( PFM_SDK_Protocal new_protocal,
char *  msg 
)
pure virtual

Update protocol of element names(order of element names) used by SDK.

Parameters
[in]new_protocalthe new protocol of component order
[out]msgthe message
Returns
void

◆ get_num_threads()

virtual int PFM_SDK::get_num_threads ( )
pure virtual

Get total number of available threads of engine

Returns
the number of available threads

◆ get_cal_condition()

virtual void PFM_SDK::get_cal_condition ( PFM_SDK_Input_Condition state,
int  engine_id 
)
pure virtual

Get the latest cacluation condition of engine with id of engine_id, in the first thread

Parameters
[out]statethe calculation condition (state) from the last calculation
[in]engine_idthe id of the engine where the state is queried

◆ get_phase_names_by_initial_condition()

virtual void PFM_SDK::get_phase_names_by_initial_condition ( char **&  phase_names,
size_t *  n_names,
int  engine_id,
char *  msg 
)
pure virtual

Get all phaes names from initially global point calculation. This is important when determine if the initial condition is proper for a model. For example in spinodal decomposition, phase number should be at least 2 and all names should be identical. In precipitation, at least two different phase names should be there.

Parameters
[in]engine_idthe id of the engine where phase information is queired
[out]phase_namesthe array of phase names
[out]n_namesthe number of phases
[out]msgthe message
Returns
void

◆ statistic_calc_cnt()

virtual void PFM_SDK::statistic_calc_cnt ( int *  new_point_cnt,
int *  reused_point_cnt 
)
pure virtual

Get counts of newly calculated points and reused points.

Note
Statistics of SDK
Parameters
[out]new_point_cntthe count of newly calculated points
[out]reused_point_cntthe count of reused points
Returns
void

◆ file_save_sdk_intermediate()

virtual void PFM_SDK::file_save_sdk_intermediate ( int *  tot_sdk_file_size_KB)
pure virtual

Save intermedate files (binary fromat) and get the totla size of sdk intermediate files. The intermediate files are saved by SDK descontructor at the end of simulation. However, users are encouraged to save intermediate files during simulation.

Note
File operation of SDK
Parameters
[out]tot_sdk_file_size_KBthe total size of sdk intermediate files
Returns
void

◆ nucleation_define_user()

virtual bool PFM_SDK::nucleation_define_user ( PF_ARGS m_args,
char *  msg,
bool  single_thread = false 
)
pure virtual

Initialize SDK to calculate nucleation related properties.

Note
For Nucleation model
Parameters
[out]msgthe message from the initializer
[in]m_argsthe arguments from phase field module
[in]single_threada boolean controllin tag which decides whether to use single thread for nucleation model (default is false). This option is useful when mean-field nucleation model is applied

◆ nucleation_get_prop()

virtual bool PFM_SDK::nucleation_get_prop ( PFM_SDK_Input_Condition in,
PFM_SDK_Output_Data out,
int  thread_id,
char *  msg,
int  m_engine_mode = 0 
)
pure virtual

Get precipitate composition, precipiate driving force and matrix mobility.

Parameters
[in]inthe input of calculation
[out]outthe output of calculation
[in]thread_idthe id of thread for this calculation
[out]msgthe message from the function
[out]m_engine_mode(default = 0) 0: try to reuse calculated points; 1: disregarding calculated points

◆ get_line_compound_info()

virtual bool PFM_SDK::get_line_compound_info ( int  phase_id)
pure virtual

Get line compound info for a phase.

Parameters
[in]phase_idthe id of phase according to protocol
Returns
true if it is line compound

◆ nucleation_file_save_sdk_intermediate()

virtual void PFM_SDK::nucleation_file_save_sdk_intermediate ( int *  tot_sdk_file_size_KB)
pure virtual

Save intermedate files (binary fromat) and get the totla size of sdk intermediate files. The intermediate files are saved by SDK descontructor at the end of simulation. However, users are encouraged to save intermediate files during simulation.

Note
For Nucleation model
Parameters
[out]tot_sdk_file_size_KBthe total size of sdk intermediate files
Returns
void

◆ debug_get_cal_pt()

virtual shared_ptr< P_Point > PFM_SDK::debug_get_cal_pt ( int  thread_id,
int  engine_id 
)
pure virtual

Get a copy of the PanEngine calculation point object. The returned object can be used to debug model calculations.

Parameters
[in]thread_idthe id of thread from which the calculation point comes
[in]engine_idthe id of engine from which the calcualtion point comes return A copy of the PanEngine calculation point (P_Point) object

◆ verify_dongle_for_plugin()

virtual int PFM_SDK::verify_dongle_for_plugin ( const char *  plugin_name,
char *  msg 
)
pure virtual

To verify the dongle information for user's plugin.

Note
To verify the dongle information for user's plugin
Parameters
[in]plugin_namethe name of the plugin
[in]msgerror message if any
Returns
true for success and otherwise false

The documentation for this class was generated from the following file: