<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hi everyone,<br>
<br>
I have some questions about how to manage the degrees of freedom for a Dune::AdaptiveDiscreteFunction <
<font size="2">DiscreteFunctionSpaceImp</font> > instance.<br>
<br>
1) Suppose I need to set all the DoF to 1; how can I do?<br>
I tried in this way:<br>
<br>
const DiscreteFunctionType::DofIteratorType end = function.dend();<br>
int count_dof = 0;<br>
for( DiscreteFunctionType::DofIteratorType it = function.dbegin(); it != end; ++it )<br>
{<br>
count_dof += 1;<br>
std::cout << "D.o.f. " << count_dof << "-th: " << (* it) << "." << std::endl;<br>
(* it) = 1.;<br>
}<br>
<div><br>
but I notice that for a P1 Lagrange, scalar function the counter "count_dof" arrives to 162 or similar, and not to 3, as I may expect.<br>
Where am I wrong?<br>
<br>
I tried something with the method leakPointer (which "returns pointer to underlying array") but I got a compilation error.<br>
Any ideas?<br>
<br>
2) suppose I want to set to 1 the dof corresponding to the constant basis function, and 0 all the others.<br>
Which is the dof corresponding to the constant basis function? How can I access it?<br>
<br>
3) suppose I need to build a matrix, obtained by an outer (or tensor) product of two vectors, representing the dof of two scalar functions. Is it possible to do it directly?<br>
Or do I have to initialise a matrix with right dimensions, and then, entry by entry, perform the outer product extracting the right components from the two vectors (here question 1 is crucial!)?<br>
<br>
Many thanks for your help!<br>
<br>
Andrea<br>
<div style="font-family:Tahoma; font-size:13px"><br>
__________________________________________________________<br>
<br>
Andrea Sacconi<br>
PhD student, Applied Mathematics<br>
AMMP Section, Department of Mathematics, Imperial College London,<br>
London SW7 2AZ, UK<br>
a.sacconi11@imperial.ac.uk<br>
</div>
</div>
</div>
</body>
</html>