Text archives Help
- From: "Elisha Hughes" <erh0509@westminstercollege.edu>
- To: <scirun-users@sci.utah.edu>
- Subject: Re: [SCIRUN-USERS] zeroing out a field
- Date: Wed, 06 Jul 2005 13:44:56 -0600
Dear SCIRun,
I apologize in advance for a strange and long question, but I am seeing some
strange behavior from my new method which sets all the values in a field to
zero, and I wonder if you have any advice.
My module has 5 input ports. Currently, 2 of them are receiving identical
data - the output from a VectorMagnitude module. I am naming the first
VectorMagnitude field src_field, and the second is named compare_field. I
want to set all the data in src_field to zero, and to leave the compare_field
data alone. It seems that somehow my new method sets the data in both fields
to zero.
I looked at the TransformData module as an example, and wrote a method that
looks like this:
void zeroField(FSRC *src_field) {
src_mesh = src_field->get_typed_mesh().get_rep();
ASSERT(src_mesh);
typename LSRC::iterator src_itr, src_end_itr;
src_mesh->begin(src_itr);
src_mesh->end(src_end_itr);
while (src_itr != src_end_itr) {
src_field->fdata()[*src_itr]=0.;
++src_itr;
}
}
If I iterate through my compare_field before and after my method call -
zeroField(src_field); - I see that my compare_field has also been zeroed. Is
it possible that SCIRun is identifying these 2 fields as the same and
treating them as one?
Thanks again for your help,
Elisha
>
>> David Weinstein <dmw@sci.utah.edu> 07/05/05 12:56 AM >>>
Hi Elisha,
If your module is templated, you can look at the VectorMagnitude code
for an example; if it's not, you can use something simpler like this:
LatVolField<double> *myfield;
...
myfield->fdata().initialize(0);
Cheers,
Dave
On Jul 3, 2005, at 10:12 PM, Elisha Hughes wrote:
>
Dear SCIRun,
>
>
I am working with a homemade module that needs to set all the data
>
in a field to zero.
>
>
Do you have any advice regarding the best way to accomplish this?
>
>
Thanks for your help,
>
Elisha
>
>
======================================================================
>
=====
>
== The SCIRun Users mailing list: send email to
>
majordomo@sci.utah.edu ==
>
== for more
>
details. ==
>
== Please acknowledge use of SCIRun in your papers and
>
reports: ==
>
== see http://software.sci.utah.edu/scirun-
>
biopse_citation.bib ==
>
======================================================================
>
=====
>
===========================================================================
== The SCIRun Users mailing list: send email to majordomo@sci.utah.edu ==
== for more details. ==
== Please acknowledge use of SCIRun in your papers and reports: ==
== see
http://software.sci.utah.edu/scirun-biopse_citation.bib ==
===========================================================================
Archive powered by MHonArc 2.6.16.