コード例 #1
0
ファイル: HeatConductionApp.C プロジェクト: acasagran/moose
void
HeatConductionApp::associateSyntax(Syntax & syntax, ActionFactory & action_factory)
{
#undef registerAction
#define registerAction(tplt, action) action_factory.reg<tplt>(stringifyName(tplt), action)

    // This registers an action to add the "slave_flux" vector to the system at the right time
    registerTask("add_slave_flux_vector", false);
    addTaskDependency("add_slave_flux_vector", "ready_to_init");
    addTaskDependency("init_problem", "add_slave_flux_vector");
    registerAction(AddSlaveFluxVectorAction, "add_slave_flux_vector");
    syntax.registerActionSyntax("AddSlaveFluxVectorAction", "ThermalContact/*");


    syntax.registerActionSyntax("ThermalContactAuxBCsAction",       "ThermalContact/*", "add_aux_kernel");
    syntax.registerActionSyntax("ThermalContactAuxVarsAction",      "ThermalContact/*", "add_aux_variable");
    syntax.registerActionSyntax("ThermalContactBCsAction",          "ThermalContact/*", "add_bc");
    syntax.registerActionSyntax("ThermalContactDiracKernelsAction", "ThermalContact/*", "add_dirac_kernel");
    syntax.registerActionSyntax("ThermalContactMaterialsAction",    "ThermalContact/*", "add_material");

    registerAction(ThermalContactAuxBCsAction,       "add_aux_kernel");
    registerAction(ThermalContactAuxVarsAction,      "add_aux_variable");
    registerAction(ThermalContactBCsAction,          "add_bc");
    registerAction(ThermalContactDiracKernelsAction, "add_dirac_kernel");
    registerAction(ThermalContactMaterialsAction,    "add_material");

#undef registerAction
#define registerAction(tplt, action) action_factory.regLegacy<tplt>(stringifyName(tplt), action)
}
コード例 #2
0
ファイル: com_uart.c プロジェクト: miago/LP-blink
void initComUart(){

	uartMessage.source = com_uart_user;

	UCA0CTL1 = UCSWRST;							//RESET
	UCA0CTL1 |= UCSSEL_2;                     // SMCLK
	UCA0CTL0 = 0x00;
	UCA0BR0 = 104;                            // 1MHz 9600
	UCA0BR1 = 0;                              // 1MHz 9600
	UCA0MCTL = UCBRS0;                        // Modulation UCBRSx = 1

	P1SEL |= (UART_TXD + UART_RXD);             // Timer function for TXD/RXD pins
	P1SEL2 |= (UART_TXD + UART_RXD);            // Timer function for TXD/RXD pins

	P1DIR |= UART_TXD;
	P1DIR &= ~UART_RXD;

	UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
	IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt

	//UCA0TXBUF = 0x35;

	comUartTask.user = com_uart_user;
	comUartTask.handler = &comUartHandler;
	comUartTask.cmdName = comUartCmd;

	registerTask( &comUartTask );

}
コード例 #3
0
ファイル: ContactApp.C プロジェクト: Biyss/moose
void
ContactApp::associateSyntax(Syntax & syntax, ActionFactory & action_factory)
{
  syntax.registerActionSyntax("ContactAction", "Contact/*");

  syntax.registerActionSyntax("ContactPenetrationAuxAction", "Contact/*");
  syntax.registerActionSyntax("ContactPenetrationVarAction", "Contact/*");

  syntax.registerActionSyntax("ContactPressureAuxAction", "Contact/*");
  syntax.registerActionSyntax("ContactPressureVarAction", "Contact/*");

  syntax.registerActionSyntax("NodalAreaAction", "Contact/*");
  syntax.registerActionSyntax("NodalAreaVarAction", "Contact/*");

  registerAction(ContactAction, "add_aux_kernel");
  registerAction(ContactAction, "add_aux_variable");
  registerAction(ContactAction, "add_dirac_kernel");

  registerTask("output_penetration_info_vars", false);
  registerAction(ContactAction, "output_penetration_info_vars");
  syntax.addDependency("output_penetration_info_vars", "add_output");

  registerAction(ContactPenetrationAuxAction, "add_aux_kernel");
  registerAction(ContactPenetrationVarAction, "add_aux_variable");

  registerAction(ContactPressureAuxAction, "add_aux_kernel");
  registerAction(ContactPressureVarAction, "add_aux_variable");

  registerAction(NodalAreaAction, "add_user_object");
  registerAction(NodalAreaVarAction, "add_aux_variable");
}
コード例 #4
0
ファイル: local_store.c プロジェクト: EPLab/PipeTect-Roocas
void LOS_init(void)
{	
	if (media_init() == 0)
	{
        mSD_status = SD_ERR_INIT;
		printf("ERROR: Media init failed\n");
		return;
	}
	
	// Attach media access functions to library
    if (fl_attach_media(media_read, media_write) != FAT_INIT_OK)
    {
        mSD_status = SD_ERR_ATTACH;
		printf("ERROR: Media attach failed\n");
		return; 
    }

#ifndef __LOCAL_STORE_ACCEL_MODE__
	BQ_init(&LOS_queue, LOS_write_buffer, sizeof(LOS_write_buffer));
#endif
    
	LOS_tid = registerTask(LOS_proc, 0, 0, 0xFF);

#ifdef FRAM_ENABLED	
    FRAM_WR_init();
#endif
	
	// Delete File
	int i = 0;
    while ((i = fl_remove("/file.txt")) == -1);
	if (!i)
	{
		//printf("ERROR: Delete file failed\n");
    }
}
コード例 #5
0
ファイル: Moose.C プロジェクト: FHilty/moose
void
registerActions(Syntax & syntax,
                ActionFactory & action_factory,
                const std::set<std::string> & obj_labels)
{
  Registry::registerActionsTo(action_factory, obj_labels);

  // TODO: Why is this here?
  registerTask("finish_input_file_output", false);
}
コード例 #6
0
ファイル: button.c プロジェクト: miago/LP-blink
void initButton(){
	buttonTask.user = button_user;
	buttonTask.handler = &buttonHandler;
	buttonTask.cmdName = buttonCmd;
	registerTask( &buttonTask );

	P1DIR &= ~BUTTON; //Button input
	P1IE |= BUTTON; //interrupt for button enabled
	P1IFG &= ~BUTTON; //Interrupt flag enabled
	P1IES |= BUTTON; //Hi/lo edge
}
コード例 #7
0
ファイル: main.c プロジェクト: miago/LP-blink
int main( void ){

	disableWDT();// Stop watchdog timer
	initQueue();
	initScheduler();

	initButton();
	initLed();
	initComUart();

	initInfo();

	mainTask.cmdName = cmdNameMain;
	mainTask.user = main_user;
	mainTask.handler = &mainHandler;
	registerTask( &mainTask );

	setDCOCLK( DCO_1M );
	setSMCLK( SMCLK_DCO, CLK_DIV_1 );

	if( getFreeMessage( &mainMessage ) == queue_ok ){
		mainMessage->source = main_user;
		mainMessage->destination = led_user;
		mainMessage->id = MSG_ID_LED_GREEN;
		mainMessage->priority = normal_priority;
		mainMessage->event = undef_event;
		putMessage( mainMessage );
	}

	if( getFreeMessage( &mainMessage ) == queue_ok){
		mainMessage->destination = com_uart_user;
		mainMessage->source = main_user;
		mainMessage->id = MSG_ID_UART_WELCOME;
		putMessage( mainMessage );
	}

	initCli();

	enableTimerA0CCInterrupt();
	setTimerA0Mode( TAMODE_CONT );
	setTimerA0ClockSource( TA_SMCLK );
	setTimerA0Divider( TA_DIV_1 );

	__enable_interrupt();

	__bis_SR_register( 0x18 );

	//__bis_SR_register( 0x18 ); // LPM0 with interrupts enabled

	while( 1 ){};

	return 0;
}
コード例 #8
0
ファイル: XFEMApp.C プロジェクト: Biyss/moose
void
XFEMApp::associateSyntax(Syntax & syntax, ActionFactory & action_factory)
{
  registerTask("setup_xfem", false);
  registerAction(XFEMAction, "setup_xfem");
  syntax.addDependency("setup_xfem","setup_adaptivity");
  registerAction(XFEMAction, "add_aux_variable");
  registerAction(XFEMAction, "add_aux_kernel");

  syntax.registerActionSyntax("XFEMAction", "XFEM");
  syntax.registerActionSyntax("AddUserObjectAction", "XFEM/*");

}
コード例 #9
0
ファイル: NavierStokesApp.C プロジェクト: mangerij/moose
void
NavierStokesApp::associateSyntax(Syntax & syntax, ActionFactory & action_factory)
{
#undef registerAction
#define registerAction(type, action)                                                               \
  action_factory.reg<type>(stringifyName(type), action, __FILE__, __LINE__)

  // Create the syntax
  registerSyntax("AddNavierStokesVariablesAction", "Modules/NavierStokes/Variables");
  registerSyntax("AddNavierStokesICsAction", "Modules/NavierStokes/ICs");
  registerSyntax("AddNavierStokesKernelsAction", "Modules/NavierStokes/Kernels");
  registerSyntax("AddNavierStokesBCsAction", "Modules/NavierStokes/BCs/*");

  // add variables action
  registerTask("add_navier_stokes_variables", /*is_required=*/false);
  addTaskDependency("add_navier_stokes_variables", "add_variable");
  registerAction(AddNavierStokesVariablesAction, "add_navier_stokes_variables");

  // add ICs action
  registerTask("add_navier_stokes_ics", /*is_required=*/false);
  addTaskDependency("add_navier_stokes_ics", "add_ic");
  registerAction(AddNavierStokesICsAction, "add_navier_stokes_ics");

  // add Kernels action
  registerTask("add_navier_stokes_kernels", /*is_required=*/false);
  addTaskDependency("add_navier_stokes_kernels", "add_kernel");
  registerAction(AddNavierStokesKernelsAction, "add_navier_stokes_kernels");

  // add BCs actions
  registerMooseObjectTask("add_navier_stokes_bcs", NSWeakStagnationInletBC, /*is_required=*/false);
  appendMooseObjectTask("add_navier_stokes_bcs", NSNoPenetrationBC);
  appendMooseObjectTask("add_navier_stokes_bcs", NSStaticPressureOutletBC);
  addTaskDependency("add_navier_stokes_bcs", "add_bc");
  registerAction(AddNavierStokesBCsAction, "add_navier_stokes_bcs");

#undef registerAction
#define registerAction(type, action) action_factory.regLegacy<type>(stringifyName(type), action)
}
コード例 #10
0
ファイル: accel_handler.c プロジェクト: EPLab/PipeTect-Gopher
void initAccelHandler(void) {
    //unsigned short temp = 0;

    //  Initialize the platform
    QfPlat_Init();

    //  Init QF4A512 and SPI hardware to which the QF4A512 is attached.
    qf4a512_Init();

    //  Load the table of settings and FIR coefficients from the Quickfilter Pro PC
    //  software.  (see header above for instructions on how to generate the table)

    //num = QF_IMAGE_REGISTER_TABLE_DIMENSION;

    qf4a512_LoadImageRegisterTable();

    //QfPowerDown();
    //QFPlat_PowerDownBase();

    //for endless sampling
    accelSampleHandle = registerTask(&sample, 0, (unsigned short) 0, -1);
    //sleepHandle = registerTask(&sleep_WB, 0, (unsigned short) 100, -1);

    //pauseTask(sleepHandle);
    //temp = adis16209_get_status();
    //temp = 0;
    //temp = adis16209_get_sample_rate();
    //temp = 0;
    //temp = adis16209_get_status();
    //temp = 0;
    //temp = adis16209_get_sample_rate();
    //temp = 0;

    //canRegisterWhenWakeUp_WB(&AccelWakeUpByCAN);
    //can peripheral off
    //canSleep();
    //can transceiver off
    //QfPlat_ToggleActivityLED();
    //put cpu asleep
    //Sleep();

    //QFPlat_Sleep();
}
コード例 #11
0
ファイル: Moose.C プロジェクト: adamLange/moose
/**
 * Multiple Action class can be associated with a single input file section, in which case all associated Actions
 * will be created and "acted" on when the associated input file section is seen.b *
 * Example:
 *  "setup_mesh" <-----------> SetupMeshAction <---------
 *                                                        \
 *                                                         [Mesh]
 *                                                        /
 * "setup_mesh_complete" <---> SetupMeshCompleteAction <-
 *
 *
 * Action classes can also be registered to act on more than one input file section for a different task
 * if similar logic can work in multiple cases
 *
 * Example:
 * "add_variable" <-----                       -> [Variables/ *]
 *                       \                   /
 *                        CopyNodalVarsAction
 *                       /                   \
 * "add_aux_variable" <-                       -> [AuxVariables/ *]
 *
 *
 * Note: Placeholder "no_action" actions must be put in places where it is possible to match an object
 *       with a star or a more specific parent later on. (i.e. where one needs to negate the '*' matching
 *       prematurely)
 */
void
registerActions(Syntax & syntax, ActionFactory & action_factory)
{

#undef registerAction
#define registerAction(tplt, action) action_factory.reg<tplt>(stringifyName(tplt), action)


  registerAction(SetupPostprocessorDataAction, "setup_postprocessor_data");

  registerAction(SetupMeshAction, "setup_mesh");
  registerAction(SetupMeshCompleteAction, "prepare_mesh");
  registerAction(AddMeshModifierAction, "add_mesh_modifier");
  registerAction(AddMortarInterfaceAction, "add_mortar_interface");
  registerAction(SetupMeshCompleteAction, "execute_mesh_modifiers");
  registerAction(SetupMeshCompleteAction, "uniform_refine_mesh");
  registerAction(SetupMeshCompleteAction, "setup_mesh_complete");

  registerAction(AddFunctionAction, "add_function");
  registerAction(CreateExecutionerAction, "setup_executioner");
  registerAction(SetupTimeStepperAction, "setup_time_stepper");
  registerAction(SetupTimeIntegratorAction, "setup_time_integrator");
  registerAction(SetupTimePeriodsAction, "setup_time_periods");
  registerAction(CreateDisplacedProblemAction, "init_displaced_problem");
  registerAction(DetermineSystemType, "determine_system_type");
  registerAction(CreateProblemAction, "create_problem");
  registerAction(DynamicObjectRegistrationAction, "dynamic_object_registration");
  registerAction(AddOutputAction, "add_output");
  registerAction(CommonOutputAction, "common_output");
  registerAction(SetupRecoverFileBaseAction, "setup_recover_file_base");
  registerAction(GlobalParamsAction, "set_global_params");
  registerAction(SetupPredictorAction, "setup_predictor");
  registerAction(MaterialOutputAction, "setup_material_output");
  registerAction(CheckOutputAction, "check_output");

  /// Variable/AuxVariable Actions
  registerAction(AddVariableAction, "add_variable");
  registerAction(AddAuxVariableAction, "add_aux_variable");

  registerAction(CopyNodalVarsAction, "check_copy_nodal_vars");
  registerAction(CopyNodalVarsAction, "copy_nodal_vars");
  registerAction(CopyNodalVarsAction, "copy_nodal_aux_vars");

  // Initial Condition Actions
  registerAction(AddICAction, "add_ic");
  registerAction(AddInitialConditionAction, "add_ic");

  registerAction(AddKernelAction, "add_kernel");
  registerAction(AddKernelAction, "add_aux_kernel");
  registerAction(AddScalarKernelAction, "add_scalar_kernel");
  registerAction(AddScalarKernelAction, "add_aux_scalar_kernel");
  registerAction(AddDGKernelAction, "add_dg_kernel");
  registerAction(AddBCAction, "add_bc");
  registerAction(EmptyAction, "no_action");  // placeholder
  registerAction(AddPeriodicBCAction, "add_periodic_bc");
  registerAction(AddMaterialAction, "add_material");
  registerAction(AddPostprocessorAction, "add_postprocessor");
  registerAction(AddVectorPostprocessorAction, "add_vector_postprocessor");
  registerAction(AddDamperAction, "add_damper");
  registerAction(AddSplitAction, "add_split");
  registerAction(SetupPreconditionerAction, "add_preconditioning");
  registerAction(SetupQuadratureAction, "setup_quadrature");
  registerAction(DeprecatedBlockAction, "deprecated_block");
  registerAction(AddConstraintAction, "add_constraint");
  registerAction(AddUserObjectAction, "add_user_object");
  registerAction(AddControlAction, "add_control");
  registerAction(AddElementalFieldAction, "add_elemental_field_variable");
  registerAction(AddIndicatorAction, "add_indicator");
  registerAction(AddMarkerAction, "add_marker");
  registerAction(SetAdaptivityOptionsAction, "set_adaptivity_options");

  registerAction(AddNodalNormalsAction, "add_aux_variable");
  registerAction(AddNodalNormalsAction, "add_postprocessor");
  registerAction(AddNodalNormalsAction, "add_user_object");

#ifdef LIBMESH_ENABLE_AMR
  registerAction(AdaptivityAction, "setup_adaptivity");
#endif

  registerAction(AddDiracKernelAction, "add_dirac_kernel");
  registerAction(SetupDebugAction, "setup_debug");
  registerAction(SetupResidualDebugAction, "setup_residual_debug");

  registerAction(AddBoundsVectorsAction, "add_bounds_vectors");

  // NonParsedActions
  registerAction(SetupDampersAction, "setup_dampers");
  registerAction(EmptyAction, "ready_to_init");
  registerAction(InitProblemAction, "init_problem");
  registerAction(CheckIntegrityAction, "check_integrity");

  registerAction(AddMultiAppAction, "add_multi_app");
  registerAction(AddTransferAction, "add_transfer");

  // TODO: Why is this here?
  registerTask("finish_input_file_output", false);
  registerAction(EmptyAction, "finish_input_file_output");

#undef registerAction
#define registerAction(tplt, action) action_factory.regLegacy<tplt>(stringifyName(tplt), action)
}
コード例 #12
0
ファイル: Moose.C プロジェクト: adamLange/moose
void
addActionTypes(Syntax & syntax)
{
  /**
   * The second param here indicates whether the task must be satisfied or not for a successful run.
   * If set to true, then the ActionWarehouse will attempt to create "Action"s automatically if they have
   * not been explicitly created by the parser or some other mechanism.
   *
   * Note: Many of the actions in the "Minimal Problem" section are marked as false.  However, we can generally
   * force creation of these "Action"s as needed by registering them to syntax that we expect to see even
   * if those "Action"s  don't normally pick up parameters from the input file.
   */

  /**************************/
  /**** Register Actions ****/
  /**************************/
  registerMooseObjectTask("create_problem",               Problem,                 true);
  registerMooseObjectTask("setup_executioner",            Executioner,             true);

  // This task does not construct an object, but it needs all of the parameters that
  // would normally be used to construct an object.
  registerMooseObjectTask("determine_system_type",        Executioner,             true);

  registerMooseObjectTask("setup_mesh",                   MooseMesh,              false);
  registerMooseObjectTask("add_mesh_modifier",            MeshModifier,           false);

  registerMooseObjectTask("add_kernel",                   Kernel,                 false);
  appendMooseObjectTask  ("add_kernel",                   EigenKernel);

  registerMooseObjectTask("add_material",                 Material,               false);
  registerMooseObjectTask("add_bc",                       BoundaryCondition,      false);
  registerMooseObjectTask("add_function",                 Function,               false);

  registerMooseObjectTask("add_aux_kernel",               AuxKernel,              false);
  registerMooseObjectTask("add_elemental_field_variable", AuxKernel,              false);

  registerMooseObjectTask("add_scalar_kernel",            ScalarKernel,           false);
  registerMooseObjectTask("add_aux_scalar_kernel",        AuxScalarKernel,        false);
  registerMooseObjectTask("add_dirac_kernel",             DiracKernel,            false);
  registerMooseObjectTask("add_dg_kernel",                DGKernel,               false);
  registerMooseObjectTask("add_constraint",               Constraint,             false);

  registerMooseObjectTask("add_ic",                       InitialCondition,       false);
  appendMooseObjectTask  ("add_ic",                       ScalarInitialCondition);

  registerMooseObjectTask("add_damper",                   Damper,                 false);
  registerMooseObjectTask("setup_predictor",              Predictor,              false);
  registerMooseObjectTask("setup_time_stepper",           TimeStepper,            false);
  registerMooseObjectTask("setup_time_integrator",        TimeIntegrator,         false);

  registerMooseObjectTask("add_preconditioning",          MoosePreconditioner,    false);
  registerMooseObjectTask("add_split",                    Split,                  false);

  registerMooseObjectTask("add_user_object",              UserObject,             false);
  appendMooseObjectTask  ("add_user_object",              Postprocessor);

  registerMooseObjectTask("add_postprocessor",            Postprocessor,          false);
  registerMooseObjectTask("add_vector_postprocessor",     VectorPostprocessor,    false);

  registerMooseObjectTask("add_indicator",                Indicator,              false);
  registerMooseObjectTask("add_marker",                   Marker,                 false);

  registerMooseObjectTask("add_multi_app",                MultiApp,               false);
  registerMooseObjectTask("add_transfer",                 Transfer,               false);

  registerMooseObjectTask("add_output",                   Output,                 false);

  registerMooseObjectTask("add_control",                  Control,                false);

  registerTask("dynamic_object_registration", false);
  registerTask("common_output", true);
  registerTask("setup_recover_file_base", true);

  registerTask("add_bounds_vectors", false);
  registerTask("add_periodic_bc", false);
  registerTask("add_aux_variable", false);
  registerTask("add_variable", false);

  registerTask("execute_mesh_modifiers", false);
  registerTask("uniform_refine_mesh", false);
  registerTask("prepare_mesh", false);
  registerTask("setup_mesh_complete", false);  // calls prepare

  registerTask("init_displaced_problem", false);

  registerTask("init_problem", true);
  registerTask("check_copy_nodal_vars", true);
  registerTask("copy_nodal_vars", true);
  registerTask("copy_nodal_aux_vars", true);
  registerTask("setup_postprocessor_data", false);

  registerTask("setup_dampers", true);
  registerTask("check_integrity", true);
  registerTask("setup_quadrature", true);

  /// Additional Actions
  registerTask("no_action", false);  // Used for Empty Action placeholders
  registerTask("set_global_params", false);
  registerTask("setup_time_periods", true);
  registerTask("setup_adaptivity", false);
  registerTask("meta_action", false);
  registerTask("setup_debug", false);
  registerTask("setup_residual_debug", false);
  registerTask("setup_oversampling", false);
  registerTask("deprecated_block", false);
  registerTask("set_adaptivity_options", false);
  registerTask("add_mortar_interface", false);

  // Dummy Actions (useful for sync points in the dependencies)
  registerTask("setup_function_complete", false);
  registerTask("setup_variable_complete", false);
  registerTask("ready_to_init", true);

  // Output related actions
  registerTask("setup_material_output", true);
  registerTask("check_output", true);

  /**************************/
  /****** Dependencies ******/
  /**************************/
  /**
   * The following is the default set of action dependencies for a basic MOOSE problem.  The formatting
   * of this string is important.  Each line represents a set of dependencies that depend on the previous
   * line.  Items on the same line have equal weight and can be executed in any order.
   *
   * Additional dependencies can be inserted later inside of user applications with calls to
   * ActionWarehouse::addDependency("task", "pre_req")
   */
  syntax.addDependencySets(
"(meta_action)"
"(dynamic_object_registration)"
"(common_output)"
"(set_global_params)"
"(setup_recover_file_base)"
"(check_copy_nodal_vars)"
"(setup_mesh)"
"(prepare_mesh)"
"(add_mesh_modifier)"
"(add_mortar_interface)"
"(execute_mesh_modifiers)"
"(uniform_refine_mesh)"
"(setup_mesh_complete)"
"(determine_system_type)"
"(create_problem)"
"(setup_time_integrator)"
"(setup_executioner)"
"(setup_time_stepper)"
"(setup_predictor)"
"(setup_postprocessor_data)"
"(setup_time_periods)"
"(init_displaced_problem)"
"(add_aux_variable, add_variable, add_elemental_field_variable)"
"(setup_variable_complete)"
"(setup_quadrature)"
"(add_function)"
"(add_periodic_bc)"
"(add_user_object)"
"(setup_function_complete)"
"(setup_adaptivity)"
"(set_adaptivity_options)"
"(add_ic)"
"(add_preconditioning, add_constraint, add_split)"
"(ready_to_init)"
"(setup_dampers)"
"(setup_residual_debug)"
"(add_bounds_vectors)"
"(add_multi_app)"
"(add_transfer)"
"(copy_nodal_vars, copy_nodal_aux_vars)"
"(add_material)"
"(setup_material_output)"
"(init_problem)"
"(setup_debug)"
"(add_output)"
"(add_postprocessor)"
"(add_vector_postprocessor)"
"(add_aux_kernel, add_bc, add_damper, add_dirac_kernel, add_kernel, add_dg_kernel, add_scalar_kernel, add_aux_scalar_kernel, add_indicator, add_marker)"
"(add_control)"
"(check_output)"
"(check_integrity)"
);

}
コード例 #13
0
ファイル: Msp430-SPI.c プロジェクト: EPLab/PipeTect-Gopher
void QfSpi_Init(void) {
    /*
//  Sanity check SPI0 state.
Assert( Spi0State == Uninitialized );


SetBit( UCTL0, SWRST );          //  Hold the USART in Reset while configuring

ClearBit( IE1, URXIE0 );         //  Disable SPI0 Receive Interrupts

U0ME  |= UTXE0 + URXE0;          //  Enable USART0 transmit and receive modules

P3SEL |= 0x0E;                   //  Select the SPI option for USART0 pins (P3.1-3)

UCTL0 |= CHAR +                  //  Character length is 8 bits
         SYNC +                  //  Synchronous Mode (as opposed to UART)
         MM;                     //  8-bit SPI Master **SWRST**

UTCTL0 |= CKPH  +                //  UCLK delayed by 1/2 cycle
          SSEL1 + SSEL0 +        //  Clock source is SMCLK (implies Master mode)
                                 //         00 UCLKI               10 SMCLK
                                 //         01 ACLK  (fastest)     11 SMCLK
          STC;                   //  3-pin SPI mode (STE disabled)

URCTL0 = 0;                      //  Receive control register

UMCTL0 = SPI0_MODULATION_CONTROL;  //  No modulation
UBR10  = GetHiByte( SPI0_BAUD_DIVISOR );   //  Set baud rate
UBR00  = GetLoByte( SPI0_BAUD_DIVISOR );


URCTL0 = 0;                      //  Init receiver contol register


ME1  |= UTXE0 + URXE0;           //  Enable USART0 SPI transmit and receive.   (note that
                                 //  URXE0 and USPIE0 are one in the same on the '449)

ClearBit( UCTL0, SWRST );        //  Release USART state machine (begin operation).
                                 //  Doesn't do anything in SPI mode until a write
                                 //  to TXBUF0 occurs.
     */
    PIE1bits.SSPIE = 0;
    IPR1bits.SSPIP = 0; //spi interrupt low priority

    set_LIV_function(&Spi0ReadIsr);

    TRISCbits.TRISC3 = 0; //sck output
    TRISCbits.TRISC5 = 0; //sdo output
    //TRISAbits.TRISA5 = 1;	//ss input

    QfPlat_DeactivateQF4A512ChipSelect();
    OpenSPI(SPI_FOSC_16, MODE_00, SMPEND);

    Spi0State = Idle;

    //YEB
#ifndef __YEB_INTERRUPT__
#ifndef __YEB_IMMEDIATE__
    rememberHandle = registerTask(&rememberCallback, 0, (unsigned short) 0, -1);
    pauseTask(rememberHandle);
#endif
#endif
}
コード例 #14
0
ファイル: Moose.C プロジェクト: atomica/moose
/**
 * Multiple Action class can be associated with a single input file section, in which case all associated Actions
 * will be created and "acted" on when the associated input file section is seen.b *
 * Example:
 *  "setup_mesh" <-----------> SetupMeshAction <---------
 *                                                        \
 *                                                         [Mesh]
 *                                                        /
 * "setup_mesh_complete" <---> SetupMeshCompleteAction <-
 *
 *
 * Action classes can also be registered to act on more than one input file section for a different task
 * if similar logic can work in multiple cases
 *
 * Example:
 * "add_variable" <-----                       -> [Variables/ *]
 *                       \                   /
 *                        CopyNodalVarsAction
 *                       /                   \
 * "add_aux_variable" <-                       -> [AuxVariables/ *]
 *
 *
 * Note: Placeholder "no_action" actions must be put in places where it is possible to match an object
 *       with a star or a more specific parent later on. (i.e. where one needs to negate the '*' matching
 *       prematurely)
 */
void
registerActions(Syntax & syntax, ActionFactory & action_factory)
{
  registerAction(SetupPostprocessorDataAction, "setup_postprocessor_data");

  registerAction(RecoverBaseAction, "recover_base");
  registerAction(SetupMeshAction, "setup_mesh");
  registerAction(SetupMeshCompleteAction, "prepare_mesh");
  registerAction(AddMeshModifierAction, "add_mesh_modifier");
  registerAction(AddMortarInterfaceAction, "add_mortar_interface");
  registerAction(SetupMeshCompleteAction, "setup_mesh_complete");

  registerAction(AddFunctionAction, "add_function");
  registerAction(CreateExecutionerAction, "setup_executioner");
  registerAction(SetupTimeStepperAction, "setup_time_stepper");
  registerAction(SetupTimePeriodsAction, "setup_time_periods");
  registerAction(InitDisplacedProblemAction, "init_displaced_problem");
  registerAction(CreateProblemAction, "create_problem");
  registerAction(SetupOutputAction, "setup_output"); /// \todo{remove w/ update system upgraded}
  registerAction(SetupOutputNameAction, "setup_output_name"); /// \todo{remove w/ update system upgraded}
  registerAction(AddOutputAction, "add_output");
  registerAction(CommonOutputAction, "meta_action");
  registerAction(GlobalParamsAction, "set_global_params");
  registerAction(SetupPredictorAction, "setup_predictor");

  /* The display of performance long is controlled by the Console outputter, if there is not one present
     logging must be disable externally from the object, this action does this */
  registerAction(PerfLogOutputAction, "perf_log_output");

  /// Variable/AuxVariable Actions
  registerAction(AddVariableAction, "add_variable");
  registerAction(AddVariableAction, "add_ic");     // initial condition shortcut syntax

  registerAction(AddAuxVariableAction, "add_aux_variable");
  registerAction(AddAuxVariableAction, "add_ic");  // initial condition shortcut syntax

  registerAction(CopyNodalVarsAction, "check_copy_nodal_vars");
  registerAction(CopyNodalVarsAction, "copy_nodal_vars");
  registerAction(CopyNodalVarsAction, "copy_nodal_aux_vars");

  // Initial Condition Actions
  registerAction(AddICAction, "add_ic");
  registerAction(AddInitialConditionAction, "add_ic");

  registerAction(AddKernelAction, "add_kernel");
  registerAction(AddKernelAction, "add_aux_kernel");
  registerAction(AddScalarKernelAction, "add_scalar_kernel");
  registerAction(AddScalarKernelAction, "add_aux_scalar_kernel");
  registerAction(AddDGKernelAction, "add_dg_kernel");
  registerAction(AddBCAction, "add_bc");
  registerAction(EmptyAction, "no_action");  // placeholder
  registerAction(AddPeriodicBCAction, "add_periodic_bc");
  registerAction(AddBCAction, "add_aux_bc");
  registerAction(AddMaterialAction, "add_material");
  registerAction(AddPostprocessorAction, "add_postprocessor");
  registerAction(AddDamperAction, "add_damper");
  registerAction(AddSplitAction, "add_split");
  registerAction(SetupPreconditionerAction, "add_preconditioning");
  registerAction(SetupQuadratureAction, "setup_quadrature");
  registerAction(SetupOverSamplingAction, "setup_oversampling");
  registerAction(DeprecatedBlockAction, "deprecated_block");
  registerAction(AddConstraintAction, "add_constraint");
  registerAction(AddUserObjectAction, "add_user_object");
  registerAction(AddElementalFieldAction, "add_elemental_field_variable");
  registerAction(AddIndicatorAction, "add_indicator");
  registerAction(AddMarkerAction, "add_marker");
  registerAction(SetAdaptivityOptionsAction, "set_adaptivity_options");

  registerAction(AddNodalNormalsAction, "add_aux_variable");
  registerAction(AddNodalNormalsAction, "add_postprocessor");
  registerAction(AddNodalNormalsAction, "add_user_object");

#ifdef LIBMESH_ENABLE_AMR
  registerAction(AdaptivityAction, "setup_adaptivity");
#endif

  registerAction(AddDiracKernelAction, "add_dirac_kernel");
  registerAction(SetupDebugAction, "setup_debug");
  registerAction(SetupResidualDebugAction, "setup_residual_debug");

  registerAction(AddBoundsVectorsAction, "add_bounds_vectors");

  // NonParsedActions
  registerAction(SetupDampersAction, "setup_dampers");
  registerAction(EmptyAction, "ready_to_init");
  registerAction(InitProblemAction, "init_problem");
  registerAction(CheckIntegrityAction, "check_integrity");

  // coupling
  registerAction(AddFEProblemAction, "add_feproblem");
  registerAction(AddCoupledVariableAction, "add_coupled_variable");

  registerAction(AddMultiAppAction, "add_multi_app");

  registerAction(AddTransferAction, "add_transfer");

  // TODO: Why is this here?
  registerTask("finish_input_file_output", false);
  registerAction(EmptyAction, "finish_input_file_output");
}
コード例 #15
0
ファイル: PhylipPlugin.cpp プロジェクト: ugeneunipro/ugene
void PhylipPlugin::processCmdlineOptions() {
    CMDLineRegistry *cmdLineRegistry = AppContext::getCMDLineRegistry();
    CHECK(cmdLineRegistry->hasParameter(PhylipCmdlineTask::PHYLIP_CMDLINE), );
    CHECK(cmdLineRegistry->hasParameter(CmdlineInOutTaskRunner::OUT_DB_ARG), );
    CHECK(cmdLineRegistry->hasParameter(CmdlineInOutTaskRunner::IN_DB_ARG), );
    CHECK(cmdLineRegistry->hasParameter(CmdlineInOutTaskRunner::IN_ID_ARG), );

    CreatePhyTreeSettings settings = fetchSettings();
    QString outDbString = cmdLineRegistry->getParameterValue(CmdlineInOutTaskRunner::OUT_DB_ARG);
    QString inDbString = cmdLineRegistry->getParameterValue(CmdlineInOutTaskRunner::IN_DB_ARG);
    QString idString = cmdLineRegistry->getParameterValue(CmdlineInOutTaskRunner::IN_ID_ARG);

    U2OpStatus2Log os;
    U2DbiRef outDbiRef = CmdlineInOutTaskRunner::parseDbiRef(outDbString, os);
    CHECK_OP(os, );
    U2DbiRef inDbiRef = CmdlineInOutTaskRunner::parseDbiRef(inDbString, os);
    CHECK_OP(os, );
    U2DataId dataId = CmdlineInOutTaskRunner::parseDataId(idString, inDbiRef, os);
    CHECK_OP(os, );

    Task *t = new PhylipTask(U2EntityRef(inDbiRef, dataId), outDbiRef, settings);
    connect(AppContext::getPluginSupport(), SIGNAL(si_allStartUpPluginsLoaded()), new TaskStarter(t), SLOT(registerTask()));
}
コード例 #16
0
ファイル: Moose.C プロジェクト: FHilty/moose
void
addActionTypes(Syntax & syntax)
{
  /**
   * The (optional) last param here indicates whether the task should trigger an Action auto-build.
   * If a task is marked as "true". Then MOOSE will attempt to build the associated Action if one is
   * not supplied by some other means (usually through the input file or custom Action). Only
   * Actions that do not have required parameters and have defaults for all optional parameters can
   * be built automatically (See ActionWarehouse.C).
   *
   * Note: Many of the actions in the "Minimal Problem" section are marked as false.  However, we
   * can generally force creation of these "Action"s as needed by registering them to syntax that we
   * expect to see even if those "Action"s  don't normally pick up parameters from the input file.
   */

  // clang-format off
  /**************************/
  /**** Register Actions ****/
  /**************************/
  registerMooseObjectTask("create_problem",               Problem,                false);
  registerMooseObjectTask("setup_executioner",            Executioner,            false);

  // This task does not construct an object, but it needs all of the parameters that
  // would normally be used to construct an object.
  registerMooseObjectTask("determine_system_type",        Executioner,            true);

  registerMooseObjectTask("setup_mesh",                   MooseMesh,              false);
  registerMooseObjectTask("init_mesh",                    MooseMesh,              false);
  registerMooseObjectTask("add_mesh_modifier",            MeshModifier,           false);

  registerMooseObjectTask("add_kernel",                   Kernel,                 false);
  appendMooseObjectTask  ("add_kernel",                   EigenKernel);
  appendMooseObjectTask  ("add_kernel",                   VectorKernel);

  registerMooseObjectTask("add_nodal_kernel",             NodalKernel,            false);

  registerMooseObjectTask("add_material",                 Material,               false);
  registerMooseObjectTask("add_bc",                       BoundaryCondition,      false);
  registerMooseObjectTask("add_function",                 Function,               false);
  registerMooseObjectTask("add_distribution",             Distribution,           false);
  registerMooseObjectTask("add_sampler",                  Sampler,                false);

  registerMooseObjectTask("add_aux_kernel",               AuxKernel,              false);
  registerMooseObjectTask("add_elemental_field_variable", AuxKernel,              false);

  registerMooseObjectTask("add_scalar_kernel",            ScalarKernel,           false);
  registerMooseObjectTask("add_aux_scalar_kernel",        AuxScalarKernel,        false);
  registerMooseObjectTask("add_dirac_kernel",             DiracKernel,            false);
  registerMooseObjectTask("add_dg_kernel",                DGKernel,               false);
  registerMooseObjectTask("add_interface_kernel",         InterfaceKernel,        false);
  registerMooseObjectTask("add_constraint",               Constraint,             false);

  registerMooseObjectTask("add_ic",                       InitialCondition,       false);
  appendMooseObjectTask  ("add_ic",                       ScalarInitialCondition);

  registerMooseObjectTask("add_damper",                   Damper,                 false);
  registerMooseObjectTask("setup_predictor",              Predictor,              false);
  registerMooseObjectTask("setup_time_stepper",           TimeStepper,            false);
  registerMooseObjectTask("setup_time_integrator",        TimeIntegrator,         false);

  registerMooseObjectTask("add_preconditioning",          MoosePreconditioner,    false);
  registerMooseObjectTask("add_field_split",              Split,                  false);

  registerMooseObjectTask("add_user_object",              UserObject,             false);
  appendMooseObjectTask  ("add_user_object",              Postprocessor);

  registerMooseObjectTask("add_postprocessor",            Postprocessor,          false);
  registerMooseObjectTask("add_vector_postprocessor",     VectorPostprocessor,    false);

  registerMooseObjectTask("add_indicator",                Indicator,              false);
  registerMooseObjectTask("add_marker",                   Marker,                 false);

  registerMooseObjectTask("add_multi_app",                MultiApp,               false);
  registerMooseObjectTask("add_transfer",                 Transfer,               false);

  registerMooseObjectTask("add_output",                   Output,                 false);

  registerMooseObjectTask("add_control",                  Control,                false);
  registerMooseObjectTask("add_partitioner",              MoosePartitioner,       false);

  // clang-format on

  registerTask("dynamic_object_registration", false);
  registerTask("common_output", true);
  registerTask("setup_recover_file_base", true);

  registerTask("add_bounds_vectors", false);
  registerTask("add_periodic_bc", false);
  registerTask("add_aux_variable", false);
  registerTask("add_external_aux_variables", true);
  registerTask("add_variable", false);

  registerTask("execute_mesh_modifiers", false);
  registerTask("uniform_refine_mesh", false);
  registerTask("prepare_mesh", false);
  registerTask("add_geometric_rm", true);
  registerTask("setup_mesh_complete", false); // calls prepare

  registerTask("init_displaced_problem", false);

  registerTask("add_algebraic_rm", true);
  registerTask("init_problem", true);
  registerTask("check_copy_nodal_vars", true);
  registerTask("copy_nodal_vars", true);
  registerTask("copy_nodal_aux_vars", true);
  registerTask("setup_postprocessor_data", false);

  registerTask("setup_dampers", true);
  registerTask("check_integrity", true);
  registerTask("check_integrity_early", true);
  registerTask("setup_quadrature", true);

  /// Additional Actions
  registerTask("no_action", false); // Used for Empty Action placeholders
  registerTask("set_global_params", false);
  registerTask("setup_adaptivity", false);
  registerTask("meta_action", false);
  registerTask("setup_debug", false);
  registerTask("setup_residual_debug", false);
  registerTask("setup_oversampling", false);
  registerTask("deprecated_block", false);
  registerTask("set_adaptivity_options", false);
  registerTask("add_mortar_interface", false);

  // Dummy Actions (useful for sync points in the dependencies)
  registerTask("setup_function_complete", false);
  registerTask("setup_variable_complete", false);
  registerTask("ready_to_init", true);

  // Output related actions
  registerTask("setup_material_output", true);
  registerTask("check_output", true);

  /**************************/
  /****** Dependencies ******/
  /**************************/
  /**
   * The following is the default set of action dependencies for a basic MOOSE problem.  The
   * formatting of this string is important.  Each line represents a set of dependencies that depend
   * on the previous line.  Items on the same line have equal weight and can be executed in any
   * order.
   *
   * Additional dependencies can be inserted later inside of user applications with calls to
   * ActionWarehouse::addDependency("task", "pre_req")
   */
  syntax.addDependencySets("(meta_action)"
                           "(dynamic_object_registration)"
                           "(common_output)"
                           "(set_global_params)"
                           "(setup_recover_file_base)"
                           "(check_copy_nodal_vars)"
                           "(setup_mesh)"
                           "(add_partitioner)"
                           "(add_geometric_rm)"
                           "(init_mesh)"
                           "(prepare_mesh)"
                           "(add_mesh_modifier)"
                           "(execute_mesh_modifiers)"
                           "(add_mortar_interface)"
                           "(uniform_refine_mesh)"
                           "(setup_mesh_complete)"
                           "(determine_system_type)"
                           "(create_problem)"
                           "(setup_postprocessor_data)"
                           "(setup_time_integrator)"
                           "(setup_executioner)"
                           "(check_integrity_early)"
                           "(setup_predictor)"
                           "(init_displaced_problem)"
                           "(add_aux_variable, add_variable, add_elemental_field_variable,"
                           " add_external_aux_variables)"
                           "(setup_variable_complete)"
                           "(setup_quadrature)"
                           "(add_function)"
                           "(add_distribution)"
                           "(add_sampler)"
                           "(add_periodic_bc)"
                           "(add_user_object)"
                           "(setup_function_complete)"
                           "(setup_adaptivity)"
                           "(set_adaptivity_options)"
                           "(add_ic)"
                           "(add_constraint, add_field_split)"
                           "(add_preconditioning)"
                           "(setup_time_stepper)"
                           "(ready_to_init)"
                           "(setup_dampers)"
                           "(setup_residual_debug)"
                           "(add_bounds_vectors)"
                           "(add_multi_app)"
                           "(add_transfer)"
                           "(copy_nodal_vars, copy_nodal_aux_vars)"
                           "(add_material)"
                           "(setup_material_output)"
                           "(add_algebraic_rm)"
                           "(init_problem)"
                           "(setup_debug)"
                           "(add_output)"
                           "(add_postprocessor)"
                           "(add_vector_postprocessor)" // MaterialVectorPostprocessor requires this
                                                        // to be after material objects are created.
                           "(add_aux_kernel, add_bc, add_damper, add_dirac_kernel, add_kernel,"
                           " add_nodal_kernel, add_dg_kernel, add_interface_kernel,"
                           " add_scalar_kernel, add_aux_scalar_kernel, add_indicator, add_marker)"
                           "(add_control)"
                           "(check_output)"
                           "(check_integrity)");
}