1552 |
Paso_SystemMatrixPattern_free(fsystemMatrixPattern); |
Paso_SystemMatrixPattern_free(fsystemMatrixPattern); |
1553 |
return SystemMatrixAdapter(fsystemMatrix,row_blocksize,row_functionspace,column_blocksize,column_functionspace); |
return SystemMatrixAdapter(fsystemMatrix,row_blocksize,row_functionspace,column_blocksize,column_functionspace); |
1554 |
} |
} |
1555 |
|
// creates a TransportProblemAdapter |
1556 |
|
TransportProblemAdapter MeshAdapter::newTransportProblem( |
1557 |
|
const double theta, |
1558 |
|
const double dt_max, |
1559 |
|
const int blocksize, |
1560 |
|
const escript::FunctionSpace& functionspace, |
1561 |
|
const int type) const |
1562 |
|
{ |
1563 |
|
int reduceOrder=0; |
1564 |
|
// is the domain right? |
1565 |
|
const MeshAdapter& domain=dynamic_cast<const MeshAdapter&>(functionspace.getDomain()); |
1566 |
|
if (domain!=*this) |
1567 |
|
throw FinleyAdapterException("Error - domain of function space does not match the domain of transport problem generator."); |
1568 |
|
// is the function space type right |
1569 |
|
if (functionspace.getTypeCode()==DegreesOfFreedom) { |
1570 |
|
reduceOrder=0; |
1571 |
|
} else if (functionspace.getTypeCode()==ReducedDegreesOfFreedom) { |
1572 |
|
reduceOrder=1; |
1573 |
|
} else { |
1574 |
|
throw FinleyAdapterException("Error - illegal function space type for system matrix rows."); |
1575 |
|
} |
1576 |
|
// generate matrix: |
1577 |
|
|
1578 |
|
Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder); |
1579 |
|
checkFinleyError(); |
1580 |
|
Paso_FCTransportProblem* transportProblem; |
1581 |
|
transportProblem=Paso_FCTransportProblem_alloc(theta,dt_max,fsystemMatrixPattern,blocksize); |
1582 |
|
checkPasoError(); |
1583 |
|
Paso_SystemMatrixPattern_free(fsystemMatrixPattern); |
1584 |
|
return TransportProblemAdapter(transportProblem,theta,dt_max,blocksize,functionspace); |
1585 |
|
} |
1586 |
|
|
1587 |
// |
// |
1588 |
// vtkObject MeshAdapter::createVtkObject() const |
// vtkObject MeshAdapter::createVtkObject() const |