PureConvectionEdgeBased

From KratosWiki
Jump to: navigation, search

Contents

Needed classes

This class requires two helper classes to work. We have followed a bottom-up system in order to find out all the classes needed for the operation of the solver that we will discuss below.

WikiPureConvectionEdgeBased.JPG

Considerations

  • An action is a procedure which has not a return value (void).
  • A function is a procedure which has a return value (e.g.: integer, double. vector<MyStruct>...).

EdgeStructureType

Definition

This class defines the necessary structure for fast access to data using CSR format (Compressed Storage Row).

WikiEdgeStructureType.JPG

MatrixContainer

Definition

This class is the definition of the structure for fast data access using the CSR format, which is used in the solver to read and save to disk the data matrix.

WikiMatrixContainer.JPG

PureConvectionEdgeBased

Definition

The main class to solve the problem.

WikiPureConvectionEdgeBasedClass.JPG

Data flow in action Solve()

To better understanding in how the data is used, below is showed the process followed to execute the action Solve (). Anyway, before getting into its analysis, the following has to take into account:

  • When talking of vectors we refer, unless otherwise stated, to arrays of n_nodes length where n_nodes is the number of nodes which exist in the private variable mr_model_part that is in PureConvectionEdgeBased class.

WikiVector.JPG

  • When we speak of matrices we refer, unless otherwise indicated, to arrays of size n_nodes x TDIM where n_nodes is the same as in the case of vectors and TDIM is the size of each of the rows that have been defined in the matrix (in principle, the rows may be of variable length).

WikiMatrix.JPG

We will now focus on the issue at hand, following the "cutting" of the action. This is divided into 3 parts as explained in the following chart.

WikiParts.JPG

1st part

In this part 2 matrices are used (mUn1 and mUn) and 3 vectors (mphi_n1, mphi_n and mA) along with two double array of length 3 (VELOCITY and DISTANCE). Also the nodes of the private variable mr_model_part are used. In order to more easily understand what is happening is displayed, then, graphically and the improvements are marked (non-rectangular positions).

Wiki1stpart.JPG

2nd part

The second part is a simple parallelized for loop, which uses 3 vectors (mHmin, mA and mTau).

Wiki2ndpart.JPG

3rd part

The third part is the most complex, although similar to the first. It has been divided, therefore, in 4 sub-parts called 1st, 2nd, 3rd and 4rt in which 4 vectors are used (mphi_n, mWork, rhs and mphi_n1) and 3 matrices (mA, mUn and mUn1).

1st

Wiki3rdpart1st.JPG

2nd

The program follows the same pattern as 1st (except that the action AssignVectorToVector is not called).

3rd

Wiki3rdpart3rd.JPG

4rt

Non-rectangular shapes indicate possible improvements.

Wiki3rdpart4rt.JPG

Personal tools
Categories