#include <SecondOrderOperator.hpp>


Public Types | |
| enum | Type { firstorderop, firstorderopTransposed, divmugrad, secondorderop, massop } |
Public Member Functions | |
| bool | isSet (const int &i, const int &j) const |
| std::string | typeName () const |
| ConstReferenceCounting < ScalarFunctionBase > | A (const int &i, const int &j) const |
| ConstReferenceCounting < SecondOrderOperator::Matrix > | A () const |
| ConstReferenceCounting < PDEOperator > | operator* (const ConstReferenceCounting< ScalarFunctionBase > &c) const |
| ConstReferenceCounting < PDEOperator > | operator- () const |
| Returns a pointer on the opposed SecondOrderOperator operator. | |
| SecondOrderOperator (ReferenceCounting< SecondOrderOperator::Matrix > A) | |
| SecondOrderOperator (const SecondOrderOperator &O) | |
| ~SecondOrderOperator () | |
| const size_t & | numberOfSubOperators () const |
| const PDEOperator::Type & | type () const |
Protected Attributes | |
| const PDEOperator::Type | __type |
| size_t | __numberOfSubOperators |
Private Attributes | |
| ConstReferenceCounting < SecondOrderOperator::Matrix > | __A |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const PDEOperator &pdeOperator) |
Definition at line 39 of file SecondOrderOperator.hpp.
enum PDEOperator::Type [inherited] |
Definition at line 41 of file PDEOperator.hpp.
00041 { 00042 firstorderop, 00043 firstorderopTransposed, 00044 divmugrad, 00045 secondorderop, 00046 massop 00047 };
| SecondOrderOperator::SecondOrderOperator | ( | ReferenceCounting< SecondOrderOperator::Matrix > | A | ) | [inline] |
Constructor
| A | given matrix |
Definition at line 158 of file SecondOrderOperator.hpp.
Referenced by operator*(), and operator-().
00159 : PDEOperator(PDEOperator::secondorderop, 00160 9), 00161 __A(A) 00162 { 00163 ; 00164 }
| SecondOrderOperator::SecondOrderOperator | ( | const SecondOrderOperator & | O | ) | [inline] |
Copy constructor
| O | given operator |
Definition at line 171 of file SecondOrderOperator.hpp.
00172 : PDEOperator(O), 00173 __A(O.__A) 00174 { 00175 ; 00176 }
| SecondOrderOperator::~SecondOrderOperator | ( | ) | [inline] |
| bool SecondOrderOperator::isSet | ( | const int & | i, | |
| const int & | j | |||
| ) | const [inline] |
Checks if a coefficient of
is set
| i | line | |
| j | column |
has been set Definition at line 61 of file SecondOrderOperator.hpp.
References __A.
Referenced by DiscretizedOperators< FiniteElement::ElementaryMatrix >::DiscretizedOperators().
00063 { 00064 return ((*__A)(i,j) != 0); 00065 }
| std::string SecondOrderOperator::typeName | ( | ) | const [inline, virtual] |
Writes the name of the operator
Implements PDEOperator.
Definition at line 72 of file SecondOrderOperator.hpp.
| ConstReferenceCounting<ScalarFunctionBase> SecondOrderOperator::A | ( | const int & | i, | |
| const int & | j | |||
| ) | const [inline] |
Read-only access to the coefficient 
| i | line number | |
| j | column number |
Definition at line 86 of file SecondOrderOperator.hpp.
References __A.
Referenced by DiscretizedOperators< FiniteElement::ElementaryMatrix >::DiscretizedOperators().
00087 { 00088 return (*__A)(i,j); 00089 }
| ConstReferenceCounting<SecondOrderOperator::Matrix> SecondOrderOperator::A | ( | ) | const [inline] |
Read-only access to the matrix 
Definition at line 97 of file SecondOrderOperator.hpp.
References __A.
00098 { 00099 return __A; 00100 }
| ConstReferenceCounting<PDEOperator> SecondOrderOperator::operator* | ( | const ConstReferenceCounting< ScalarFunctionBase > & | c | ) | const [inline, virtual] |
"multiplies" the operator by a coefficient
| c | coefficient |
Implements PDEOperator.
Definition at line 110 of file SecondOrderOperator.hpp.
References __A, ScalarFunctionBuilder::getBuiltFunction(), BinaryOperation::product, SecondOrderOperator(), ScalarFunctionBuilder::setBinaryOperation(), and ScalarFunctionBuilder::setFunction().
00111 { 00112 ReferenceCounting<SecondOrderOperator::Matrix> A2 00113 = new SecondOrderOperator::Matrix; 00114 00115 for (size_t i=0; i<3; ++i) 00116 for (size_t j=0; j<3; ++j) { 00117 if ((*__A)(i,j) != 0) { 00118 ScalarFunctionBuilder functionBuilder; 00119 functionBuilder.setFunction((*__A)(i,j)); 00120 functionBuilder.setBinaryOperation(BinaryOperation::product,c); 00121 (*A2)(i,j) = functionBuilder.getBuiltFunction(); 00122 } 00123 } 00124 00125 return (new SecondOrderOperator(A2)); 00126 }

| ConstReferenceCounting<PDEOperator> SecondOrderOperator::operator- | ( | ) | const [inline, virtual] |
Returns a pointer on the opposed SecondOrderOperator operator.
gets the opposite operator
Implements PDEOperator.
Definition at line 135 of file SecondOrderOperator.hpp.
References __A, ScalarFunctionBuilder::getBuiltFunction(), SecondOrderOperator(), ScalarFunctionBuilder::setFunction(), and ScalarFunctionBuilder::setUnaryMinus().
00136 { 00137 ReferenceCounting<SecondOrderOperator::Matrix> A2 00138 = new SecondOrderOperator::Matrix; 00139 00140 for (size_t i=0; i<3; ++i) 00141 for (size_t j=0; j<3; ++j) { 00142 if ((*__A)(i,j) != 0) { 00143 ScalarFunctionBuilder functionBuilder; 00144 functionBuilder.setFunction((*__A)(i,j)); 00145 functionBuilder.setUnaryMinus(); 00146 (*A2)(i,j) = functionBuilder.getBuiltFunction(); 00147 } 00148 } 00149 00150 return (new SecondOrderOperator(A2)); 00151 }

| const size_t& PDEOperator::numberOfSubOperators | ( | ) | const [inline, inherited] |
Read only access to the number of sub-operators
Definition at line 63 of file PDEOperator.hpp.
References PDEOperator::__numberOfSubOperators.
00064 { 00065 return __numberOfSubOperators; 00066 }
| const PDEOperator::Type& PDEOperator::type | ( | ) | const [inline, inherited] |
Read-only access to the type of the operator
Definition at line 82 of file PDEOperator.hpp.
References PDEOperator::__type.
Referenced by DiscretizedOperators< FiniteElement::ElementaryMatrix >::DiscretizedOperators().
00083 { 00084 return __type; 00085 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const PDEOperator & | pdeOperator | |||
| ) | [friend, inherited] |
Writes a PDEOperator to a stream
| os | the output stream | |
| pdeOperator | a PDEOperator |
Definition at line 114 of file PDEOperator.hpp.
00115 { 00116 os << pdeOperator.typeName(); 00117 return os; 00118 }
ConstReferenceCounting<SecondOrderOperator::Matrix> SecondOrderOperator::__A [private] |
:
Definition at line 46 of file SecondOrderOperator.hpp.
Referenced by A(), isSet(), operator*(), and operator-().
const PDEOperator::Type PDEOperator::__type [protected, inherited] |
type of the operator
Definition at line 50 of file PDEOperator.hpp.
Referenced by PDEOperator::type().
size_t PDEOperator::__numberOfSubOperators [protected, inherited] |
This is used for "composed" operators to provied an efficient way to know how many elementary matrices are needed to discretize it
Definition at line 52 of file PDEOperator.hpp.
Referenced by PDEOperator::numberOfSubOperators().
1.5.6