/[escript]/trunk/paso/src/SystemMatrixPattern_unrollBlocks.cpp
ViewVC logotype

Contents of /trunk/paso/src/SystemMatrixPattern_unrollBlocks.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4869 - (show annotations)
Mon Apr 14 10:39:22 2014 UTC (5 years, 5 months ago) by caltinay
File size: 3460 byte(s)
all of paso now lives in its own namespace.

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2014 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17
18 /****************************************************************************/
19
20 /* Paso: SystemMatrixPattern::unrollBlocks */
21
22 /****************************************************************************/
23
24 /* Author: Lutz Gross, l.gross@uq.edu.au */
25
26 /****************************************************************************/
27
28 #include "SystemMatrixPattern.h"
29
30 namespace paso {
31
32 SystemMatrixPattern_ptr SystemMatrixPattern::unrollBlocks(
33 int newType, dim_t output_block_size,
34 dim_t input_block_size)
35 {
36 SystemMatrixPattern_ptr out;
37 Distribution_ptr new_output_distribution, new_input_distribution;
38 Connector_ptr new_col_connector, new_row_connector;
39
40 if ( (output_block_size == 1) && (input_block_size == 1) &&
41 ((type & MATRIX_FORMAT_OFFSET1) == (newType & MATRIX_FORMAT_OFFSET1)) ) {
42 out = shared_from_this();
43 } else {
44 Pattern_ptr new_mainPattern(mainPattern->unrollBlocks(newType,
45 output_block_size, input_block_size));
46 Pattern_ptr new_col_couplePattern(col_couplePattern->unrollBlocks(
47 newType, output_block_size, input_block_size));
48 Pattern_ptr new_row_couplePattern(row_couplePattern->unrollBlocks(
49 newType, output_block_size, input_block_size));
50 if (output_block_size > 1) {
51 new_output_distribution.reset(new Distribution(
52 output_distribution->mpi_info,
53 output_distribution->first_component,
54 output_block_size, 0));
55 new_row_connector = row_connector->unroll(output_block_size);
56 } else {
57 new_output_distribution = output_distribution;
58 new_row_connector = row_connector;
59 }
60 if (input_block_size > 1) {
61 new_input_distribution.reset(new Distribution(
62 input_distribution->mpi_info,
63 input_distribution->first_component,
64 input_block_size, 0));
65 new_col_connector = col_connector->unroll(input_block_size);
66 } else {
67 new_input_distribution = input_distribution;
68 new_col_connector = col_connector;
69 }
70
71 if (Esys_noError()) {
72 out.reset(new SystemMatrixPattern(newType, new_output_distribution,
73 new_input_distribution,
74 new_mainPattern,
75 new_col_couplePattern,
76 new_row_couplePattern,
77 new_col_connector,
78 new_row_connector));
79 }
80 }
81
82 if (!Esys_noError()) {
83 return SystemMatrixPattern_ptr();
84 }
85 return out;
86 }
87
88 } // namespace paso
89

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/amg_from_3530/paso/src/SystemMatrixPattern_unrollBlocks.cpp:3531-3826 /branches/lapack2681/paso/src/SystemMatrixPattern_unrollBlocks.cpp:2682-2741 /branches/pasowrap/paso/src/SystemMatrixPattern_unrollBlocks.cpp:3661-3674 /branches/py3_attempt2/paso/src/SystemMatrixPattern_unrollBlocks.cpp:3871-3891 /branches/restext/paso/src/SystemMatrixPattern_unrollBlocks.cpp:2610-2624 /branches/ripleygmg_from_3668/paso/src/SystemMatrixPattern_unrollBlocks.cpp:3669-3791 /branches/stage3.0/paso/src/SystemMatrixPattern_unrollBlocks.cpp:2569-2590 /branches/symbolic_from_3470/paso/src/SystemMatrixPattern_unrollBlocks.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/paso/src/SystemMatrixPattern_unrollBlocks.cpp:3517-3974 /release/3.0/paso/src/SystemMatrixPattern_unrollBlocks.cpp:2591-2601 /trunk/paso/src/SystemMatrixPattern_unrollBlocks.cpp:4257-4344 /trunk/ripley/test/python/paso/src/SystemMatrixPattern_unrollBlocks.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26