Difference between revisions of "Tools"

From AQUAgpusph
Jump to: navigation, search
m
m
Line 16: Line 16:
  
 
<syntaxhighlight lang="xml">
 
<syntaxhighlight lang="xml">
<Tool action="ACTION" name="NAME" type="TYPE">
+
<Tool name="NAME" action="ACTION" type="TYPE">
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
Where <tt>ACTION</tt>, <tt>NAME</tt> and <tt>TYPE</tt> should be conveniently set. Depending on the selected "<tt>action</tt>" and "<tt>type</tt>" some other specific attributes will be required.
 
Where <tt>ACTION</tt>, <tt>NAME</tt> and <tt>TYPE</tt> should be conveniently set. Depending on the selected "<tt>action</tt>" and "<tt>type</tt>" some other specific attributes will be required.
 +
 +
=== Name ===
 +
 +
The name of the variable can be arbitrary selected. If the XML file was included providing a prefix, the final name of the tool will be the concatenation of the prefix and the provided name.
 +
 +
=== Actions ===
 +
 +
Actions can be used to specify the position of the kernel we are defining. The possibilities are described in the following subsections:
 +
 +
==== add ====
 +
 +
The new tool will be appended at the end of the list of tools. No additional attributes are required.
 +
 +
==== insert ====
 +
 +
The new tool will be inserted in a specific position. One of the following attributes should be provided:
 +
 +
* <tt>at="ID"</tt> : The tool will be placed in the position ''ID''.
 +
* <tt>before="REF"</tt> : The tool will be placed before the already existing tool ''REF''.
 +
* <tt>after="REF"</tt> : The tool will be placed after the already existing tool ''REF''.
 +
* <tt>before_prefix="REF"</tt> : The tool will be placed before the already existing tool ''PREFIXREF'', with ''PREFIXREF'' is the resulting text of joining the Prefix passed when the XML file was included, and ''REF''.
 +
* <tt>after_prefix="REF"</tt> : The tool will be placed after the already existing tool ''PREFIXREF'', with ''PREFIXREF'' is the resulting text of joining the Prefix passed when the XML file was included, and ''REF''.
 +
 +
==== remove ====
 +
 +
Then the tool with the [[#Name|provided name]] will be removed. No additional attributes are required.
 +
 +
==== replace ====
 +
 +
Then the tool with the [[#Name|provided name]] will be replaced with the new one.
  
 
[[Category:Tools]]
 
[[Category:Tools]]

Revision as of 16:57, 18 March 2015

Introduction

Since version 2.0, AQUAgpusph is designed like a sandbox, such that the tools that will be used to perform the simulation can be selected "on the fly". Anyway, in order to do more accessible the code some Presets are provided "out of the box", which are defining Variables, Definitions and Tools to carry out specific actions.

Defining new tools

In order to define new tools an specific section should be opened in the simulation definition XML input files (take a look on the examples to learn more about this):

<Tools>
    <!-- ... -->
</Tools>

The new tools will be defined between the new "Tools" opened section. Each tool is defined as follows:

<Tool name="NAME" action="ACTION" type="TYPE">

Where ACTION, NAME and TYPE should be conveniently set. Depending on the selected "action" and "type" some other specific attributes will be required.

Name

The name of the variable can be arbitrary selected. If the XML file was included providing a prefix, the final name of the tool will be the concatenation of the prefix and the provided name.

Actions

Actions can be used to specify the position of the kernel we are defining. The possibilities are described in the following subsections:

add

The new tool will be appended at the end of the list of tools. No additional attributes are required.

insert

The new tool will be inserted in a specific position. One of the following attributes should be provided:

  • at="ID" : The tool will be placed in the position ID.
  • before="REF" : The tool will be placed before the already existing tool REF.
  • after="REF" : The tool will be placed after the already existing tool REF.
  • before_prefix="REF" : The tool will be placed before the already existing tool PREFIXREF, with PREFIXREF is the resulting text of joining the Prefix passed when the XML file was included, and REF.
  • after_prefix="REF" : The tool will be placed after the already existing tool PREFIXREF, with PREFIXREF is the resulting text of joining the Prefix passed when the XML file was included, and REF.

remove

Then the tool with the provided name will be removed. No additional attributes are required.

replace

Then the tool with the provided name will be replaced with the new one.