Continuity FAQs

Contents

  1. General
    1. What kind of machine do you recommend for Continuity?
    2. How can I examine the contents of a Continuity cont6 file?
    3. How can I view the .continuity directory on the Mac
    4. What graphics card should I use?
  2. Mesh
    1. How are labels propagated during refinement?
    2. Which regular expressions work with Labels in Continuity?
  3. Biomechanics
    1. My Biomechanics simulation is crashing. What should I check?
    2. How do I change the initial conditions from a script?
    3. Why can’t I render a “deformed” mesh from a pickle file that contains a solution?
    4. Is Biomechanics->!ListNodalSolution the only way to access the deformed nodal data?
    5. I have a file with a list of strains/stresses (or some other quantity) defined by node. How can I render this file as a nodal field?
    6. How do I save the result of List Element Stress or List Element Strain in Biomechanics?
    7. Why am I getting errors for a simple stress listing output?
    8. What is the meaning of “APEX”, “BASE”, “BASE_EPI$”, etc. in Deformed Coordinates 1-3?
    9. Why did you set up the boundary conditions as described in your tutorials?
    10. When setting up the external pressure, why did you select 1.0 for the Specify Pressure Increment field? Is it normalized? What is the real pressure before normalization?
    11. When refining the elements to double size, why won’t the computation converge?
    12. When I listed the data using “Element Stress”, I don’t know the definition of X(j,0), Xi(i) in the Gaussian integration points. What kind of coordinates are they in? What are the equations to interpolate the stress and stain values at any point inside the control volume?
    13. Do you have a tutorial to explain the meanings of parameters in details?
  4. Electrophysiology
    1. How do I specify which nodes are listed in APout when solving an electrophysiology problem?
  5. Rendering
    1. My rendering screen disappeared. How can I get it back?
    2. What are the angle ranges for each color of fiber marker?
    3. Also, is there any way to correlate the individual fiber markers to the numbered angles on the export angle sheet?
    4. I am confused as to how (and in what form) to save the images with the markers or images that I have edited somehow
    5. Is there a way to open stacks of images or image sequences in the edit images window? Also, is there a way to save file sequences?
  6. Running Parallel Problems
    1. How do I run Multicore or Multiprocessor jobs with Continuity?
    2. What happened to threaded Continuity?
    3. What does this mean: Restarting python process because we were missing: LD_LIBRARY_PATH = <some_path>.
  7. Equations Editor
    1. What does the “Compiling what was already on server.” message mean?
    2. Is it possible to load a predefined model, edit it and save it as a new model?
    3. I’m concerned that values are not being set correctly in rPar.
    4. if some silly user sets a spatially varying parameter to the same field as another spatially varying parameter, perhaps they could be warned.
    5. When I try to compile I get this message: dynamic module Failed to access web service. Maybe its not listening?
    6. Can you recompile a module? I get a strange warning if the module has already been compiled
  8. Source code / svn
    1. Is possible for to access the code and make changes?
    2. How can I look at previous versions of files? Is there something on the Continuity website?
  9. Misc
    1. Continuity won’t start on my Mac with Mac OS 10.5.3
    2. My Continuity GPU processing suddenly stopped working after a Mac OS update
    3. Isn’t there another FAQ?
    4. How to search for information at this site using the search field?
    5. What are some user requested bug fixes?
    6. How to I enable contours from a script?

General

What kind of machine do you recommend for Continuity?

Continuity is compatible with Windows XP, Windows Vista, Linux 32 bit, Linux 64 bit, and Mac OS with an Intel CPU. Also, it is tested most frequently in that order.

I would recommend Windows XP with a minimum of 1GB of RAM, although preferably 4GB if you plan on running simulations with a large number of elements. Continuity also runs on Windows Vista, although we have frequently seen problems with the graphics due to bad drivers.

I would also recommend a machine with any CUDA compatible NVIDIA video card (see http://www.nvidia.com/object/cuda_learn_products.html) if you wish to take advantage of the GPU acceleration that we are working on in the future. This GPU support should be available on Linux, Windows, and MacOS as long as you are using a compatible graphics card.

A multicore CPU is also best for Continuity, preferably with at least 4 cores. The new Intel i7 quad core processors seem to be the best.

With Linux, I would recommend using the Ubuntu distribution (http://www.ubuntu.com/) because it should be much easier to install any prerequisites. I personally use Kubuntu 8.10, although this is purely a matter of preference.

One final point worth mentioning: if you plan on running extremely large simulations (e.g. an electrophysiology simulation with over 4,000 elements) I would recommend using 64-bit Linux with at least 12 GB of RAM.

How can I examine the contents of a Continuity cont6 file?

  • First you’ll need to load the file into Continuity (File > Load > Model). Currently there is no way to inspect cont6 file data without first loading it into Continuity.

  • Once it’s loaded you have a few options:
    1. You could simply open various forms and inspect the data (e.g. Mesh > Edit > Nodes… will show you the nodes data stored on the cont6 file).

    2. Alternatively, from the python shell (accessible by clicking the toolbar button right underneath the file menu) you can use some python introspection to see the data.
      • All of the data in a cont6 file works its way into a data structure called “self.stored_data”. So you can type “print dir(self.stored_data)” to see all the attributes of self.stored_data. For me I got a list like this: [‘basis’, ‘coord’, ‘elem’, ‘nodes’]
      • Most of these objects are “Container Objects” and thus have an “obj” attribute. Sometimes you can get addition info by just printing the “obj” data like this:
        •            print self.stored_data.coord.obj
          

           

          For me, this printed: !!python/object:pcty.cont_classes.CoordinatesData.CoordinatesData {coordinateSystem: 1,focus: ‘1.0’, version: 1}

      • If this doesn’t tell you want you want to know, you’ll need to use more python introspection like this:
        •             print dir(self.stored_data.coord.obj)
          

           

      • For me, this revealed a “getCoordinateSystem” attribute, which sounds interesting. So I might try something like this:
        •             print self.stored_data.coord.obj.getCoordinateSystem()
          

           

    3. You may be able to use yaml to inspect some data objects. For example:
      •          import yaml
                 yaml.dump(self.stored_data.nodes)
        

         

    4. We are working on a Continuity Model repository which in the future will have another way to view the currently loaded contents of a cont6 file.

How can I view the .continuity directory on the Mac

Open a Terminal and type the following:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

What graphics card should I use?

  • Different graphics cards seem to render things a little bit differently. We recommend using an NVidia card with the latest graphics drivers. ATI graphics cards also generally work, but seem to have some rendering bugs. In particular, line colors are not always rendering properly. Integrated Intel cards seem to be the worst and range between rendering colors very poorly to crashing entirely.
  • Test your graphics card as follows:
    • Run Continuity, and click ‘OK’ on the splash screen
    • Select File ► Read ► Python Session or Script
    • Navigate to examples/biomechanics01/example.py
    • Wait about 10 seconds for the test to run
    • Select Biomechanics ► Render ► Strain. Click ‘OK’ in the dialog box
    • The rendered image should look something like this:

Mesh

How are labels propagated during refinement?

  1. Element labels
    • Quite simply, when an element is refined, it’s label is propagated to all new elements that it contains. For example, if an element were labeled EPI, and EPI were subdivided into 3 new elements, all 3 new elements would now be labeled EPI.

  2. Node labels
    • While node label propagation is a bit more complicated, it’s also easy to understand, once you know the rules.
    • Label tokens
      • Label tokens are delimited with underscores. For example, the label EPI_BASE_OLD_A, has the tokens EPI, BASE, OLD, and A

    • Rules
      1. Nodes created on a line
        • Label is propagated if both nodes connecting that line had the same label, or have a token in common. If they have a token in common, only the token is propagated. For example. If node 1 were labeled EPI_BASE and node 2 were labeled EPI_APEX, then a node created on a line between these two nodes would be labeled EPI

      2. Nodes created on a face
        • Label is propagated if all 4 nodes which make up the face have the same label or have a token in common. If they have a token in common, only the token is propagated.

      3. Nodes created in an element
        • Label is propagated if all 8 nodes which make up the element have the same label or have a token in common. If they have a token in common, only the token is propagated.

      4. If no label is matched, the new node is labeled “default”

Which regular expressions work with Labels in Continuity?

Continuity directly uses the extremely powerful python regular expression parser. So there are dozens of different symbols you can use. Almost anything you can think of could be done.

For more info, check out these pages:

Specifically, Continuity uses “search” not “match” to parse its regular expressions.

Biomechanics

My Biomechanics simulation is crashing. What should I check?

  1. lower lv and rv pressure increments
  2. Delta used to calculate derivatives numerically for stiffness matrix is too high (can be found in the “solution scheme” tab under Biomechanics->Nonlinear solve”) and should be decreased, especially with meshes with large number of elements.

  3. bulk modulus is too high in the constitutive law (e.g. try 500 instead of 1000 or even lower)
  4. boundary conditions are too much or too less constraining. Also, with ventricular basal boundary conditions it is recommended to have nodes placed on the y and z-axes when boundary conditions are used to constrain circumferential motion (by constraining z or y movement).
  5. large gradients exist in either material properties or in fiber directions: higher order elements are needed or more elements to capture the gradient accurately that may also exist in the solution.
  6. other mesh problems: especially with higher order elements certain distorted elements are hard to see. It may help to render surfaces other than xi=0 or xi=1 (e.g. xi=0.1), to see potential distortions within elements. The determinants of the Jacobian of the element global to local coordinate system can be checked by going to: Mesh->List->RWG(Tabled)… (after sending to server and calculate mesh). This lists the determinants of the Jacobians for each gauss point per element in the mesh. When any of these is lower than zero it means that an element is locally turned inside out. In that case some derivatives could be changed (but is not easy to do) for that element, or re-fit the mesh.

I’ve listed them in the order they need to be investigated. Many times just lowering the pressure increment will solve it. Trying out a very low value, like 0.001 or even zero, will give some insight in this: if it still crashes, then leave the pressure increment at this low value, and go on to the next potential problem.

Also, check the question “When refining the elements to double size, why won’t the computation converge?” for some other ideas.

How do I change the initial conditions from a script?

Toggle line numbers

   1 from client.forms.boundaryForm import boundaryForm
   2 basis = self.stored_data.basis.obj
   3 bf = boundaryForm(None, self.stored_data.init.obj, basis = basis,testing = True)
   4 bf.ic.useExcelData('C:/Documents and Settings/Fred/Desktop/nodal_solution.xls')
   5 bf.submitOK()
   6 self.stored_data.store(bf.rval)

Why can’t I render a “deformed” mesh from a pickle file that contains a solution?

A pickle file doesn’t contain the deformed solution at all. What you could do is “Biomechanics->Update->Initial Conditions With Solution” after solving and before saving a pickle file. Then the pickle file’s initial conditions form would contain the solution and render deformed should work.

After doing this you simply can choose “deformed” on almost any of the rendering forms. (E.g. render elements, render nodes, etc.)

Is Biomechanics->!ListNodalSolution the only way to access the deformed nodal data?

All the “update” commands in the Biomechanics menu also give you indirect access to the deformed nodal data.

I have a file with a list of strains/stresses (or some other quantity) defined by node. How can I render this file as a nodal field?

  1. Open the nodes form (Mesh->Edit->Nodes)

  2. Click “Import/export graph”
  3. In the table manager that select File->Save from the menu

  4. Save it to a temporary file (e.g. temp.xls)
  5. Open your nodal strains (or whatever) file in excel. Copy the column you wish to view as a field.
  6. Open temp.xls (or whatever you called it) in excel. Paste the field somewhere before the last column.
  7. Make sure that the column header of that column is labeled like this: FieldVecX_VarY_val where X is the Vector, and Y is the variable number.
  8. Save temp.xls
  9. Back in Continuity in the table form, click File->Open… and select temp.xls

  10. Select “File->Close and update form”

  11. Select a basis function for the field you put the strain/stress in.
  12. Click “OK” in the nodes form
  13. Make sure to resend
  14. Calculate mesh if you haven’t already done so
  15. Mesh->Render->Field

How do I save the result of List Element Stress or List Element Strain in Biomechanics?

From the “Continuity Viewer” select the Formats->Tab Delimited. When the Continuity Table Manager launches select “File->Save”. Note: The “File->Save” and “File->Save As” menu options in the Continuity Viewer (not the Table Manager) do not work correctly and will likely be removed in the next version of Continuity.

Why am I getting errors for a simple stress listing output?

For simple meshes (such as linear-linear-linear cubes) there is a bug in which extra basis functions must be defined. We are working to fix this problem, but in the mean time you should be able to get stresses to work by ensuring that the following basis functions are defined in exactly this order:

What is the meaning of “APEX”, “BASE”, “BASE_EPI$”, etc. in Deformed Coordinates 1-3?

These are labels and are matched with the labels defined in the nodes form. $ indicates the end of a label, the underscore is like an AND. In the case of the boundary conditions, these labels are treated as the list of nodes that comprise the named regions. You can use the node form to assign any label you like to one or more nodes. Please see below for more information on labels and regular expressions.

Why did you set up the boundary conditions as described in your tutorials?

These labels will get preserved where possible following various rules when the mesh is refined. I believe these are illustrated in the mesh tutorials.

When setting up the external pressure, why did you select 1.0 for the Specify Pressure Increment field? Is it normalized? What is the real pressure before normalization?

The units of pressure are the same as the units of stress that you choose in the constitutive model. For the parameters in our examples we use kPa, so the units of pressure for these examples are kPa. The “increments” of pressure in the boundary conditions are pressure per unit time. The units of time are whatever the units you use for the time steps you specify in the solve form. So if we put a pressure increment of 1.0 and a time step of 0.1 then that means that at each time step an increment of 0.1kPa is being applied in this particular case.

When refining the elements to double size, why won’t the computation converge?

Convergence of these nonlinear models depends on numerous factors that require some experience in nonlinear mechanics to understand. Even the term convergence has several different meanings. You are talking about the numerical convergence of the Newton schemes. The main determinants of whether the Newton iterations will converge in this particular problem are: (1) the compressibility modulus for the slightly compressible models (augmented lagrangian) problems. As this is made higher, the stresses will be more converged and strains closer to incompressible, but the stresses being higher will require smaller loads steps and more Newton iterations to converge without stresses overflowing and causing NaNs (deprecated). Hence you may lower the modulus at least to get an initial estimate solution; (2) the step size: as the problem gets more degrees of freedom you often need to take smaller steps to get solustion without numerical instabilities; (3) the error tolerance for stopping the Newton scheme: Because these errors used to stop the iteration are actually sums of nodal residuals, refining the mesh to make more nodes increase the error even if the error per node is the same; Hence you may wish to relax the error tolerance because the true error per degree of freedom will be the tolerance divided by the number of dofs; (3) the delta used for finite difference estimation of the tangent stiffness matrix: this is adjustable in the solve form. As you refine the mesh you make the elements smaller. This makes the effective delta in displacements used to estimate the tangent stiffness matrix larger, which can cause numerical instabilities. If you decrease delta, this problem goes away.

When I listed the data using “Element Stress”, I don’t know the definition of X(j,0), Xi(i) in the Gaussian integration points. What kind of coordinates are they in? What are the equations to interpolate the stress and stain values at any point inside the control volume?

Xj are world coordinates according to the world coordinate system chosen for your model. Xi are local finite element coordinates. These are well documented in our papers and online. The displacements are interpolated using the well established Lagrange/Hermite basis functions in the Continuity again well documented in our papers available on the Continuity website. From the displacements strains and stresses are computed using the equations in the Constitutive model which are user readable and editable in the Edit Material Properties

Do you have a tutorial to explain the meanings of parameters in details?

Our website includes publications that include several of these test cases described in detail. See for example Cost et al, 1996ab

Electrophysiology

How do I specify which nodes are listed in APout when solving an electrophysiology problem?

In the Stimulus Form (Electrophysiology->Edit->Stimulus) specify which nodes you want in “Write AP data at nodes:”. You can also use a label, such as APout, if you’ve assigned these labels in the Nodes Form.

Rendering

My rendering screen disappeared. How can I get it back?

The Float Camera button in the Continuity GUI can cause unintended problems. This includes not being able to see the rendering screen or having it permanently undocked from the main GUI window. To fix this problem, delete the file continuity/pcty/perspective. Alternatively, you can remove the line ‘self.GUI.floatCamera()’ from the file.

What are the angle ranges for each color of fiber marker?

This question may be best answered by showing you the python code that determines the color code of each fiber marker:

Toggle line numbers

   1 g_angleTolerance = 25
   2 if ((angle > -1*g_angleTolerance) and (angle < g_angleTolerance)):
   3     color = "blue"
   4 elif ((angle < 45+g_angleTolerance) and (angle >= 45-g_angleTolerance)):
   5     color = "cyan"
   6 elif ((angle >= 45+g_angleTolerance) or (angle < -45-g_angleTolerance)):
   7     color = "red"
   8 else:
   9     color = "green"
  10 
  11 #which basically means...
  12 
  13 if -25 < angle < 25:
  14   "blue"
  15 elif  20 <= angle < 70:
  16   "cyan"
  17 elif angle >= 70 or angle < -70:
  18   "red"
  19 else:
  20   "green"

Also, is there any way to correlate the individual fiber markers to the numbered angles on the export angle sheet?

Not at the moment.

I am confused as to how (and in what form) to save the images with the markers or images that I have edited somehow

There are 3 ways:

  1. Export the angles as a tab delimited table:
    • Fiber->Angles->Export Angles…

  2. You can save the image with the the fiber angles embedded by selecting File->Save Image, and then saving the image as a tiff, jpeg, gif, or bmp.

  3. You can also sort of save the data in a continuity data file (i.e. a “pickle” file, by selecting File->Exit in the Edit Images form, and then selecting File->Save->Problem in the main Continuity 6.3 window. Note: I tested this at release 2486, and it was not working. I should have it working again by the subsequent release.

Is there a way to open stacks of images or image sequences in the edit images window? Also, is there a way to save file sequences?

No, it’s not possible to do open a stack of images or to save file sequences, but we plan to add such functionality in the future.

Running Parallel Problems

How do I run Multicore or Multiprocessor jobs with Continuity?

Please see this detailed page.

What happened to threaded Continuity?

When I got parallel Continuity working again, for some reason it had a really hard time with threads. I’m not sure why it is, but it works fine without them. Also, I don’t think threads has any real use for us now that Electrophys rendering is computed after the electrophys solution (to prevent frames from being dropped).

What does this mean: Restarting python process because we were missing: LD_LIBRARY_PATH = <some_path>.

How do I fix this?

Short answer: Don’t worry about it.

Long answer: This is much more of a debugging message than an error. Basically python notices that it’s missing paths required by it’s dynamically loaded libraries (i.e. *.so’s). However, paths required by dynamic libraries must be setup before the python interpreter starts, or the *.so’s won’t recognize them. So basically Continuity sets these paths up properly, and then restarts itself (including python.) Since this should only happen right at the start of Continuity it shouldn’t hurt anything. Another way to do this would be to run Continuity from a shell script with all these paths set up correctly to begin with. This seems to add an extra layer of complexity though, especially since these paths can be best determined dynamically from python at run time.

Equations Editor

What does the “Compiling what was already on server.” message mean?

If it’s something that’s compiling what was already on (like an equation) indeed this would be the case. However, changing a field from 5 to 4 shouldn’t involve recompilation so you should be fine.

To be safe, from the equations editor, while viewing the “Models” tab, you should be able to click on the model Stuart created, click “File->Save As…” and create your own model. Make sure, though, that the model is not currently “loaded” or it won’t let you save it.

Is it possible to load a predefined model, edit it and save it as a new model?

Not in quite in that order. So you’d open the equations editor, NOT load it, do a “save as” to create a new model with it, then load your new model, and edit it all you want.

I’m concerned that values are not being set correctly in rPar.

When you do an “initialize” there is some debugging info about rPar that should be displayed.

if some silly user sets a spatially varying parameter to the same field as another spatially varying parameter, perhaps they could be warned.

I’ll see what I can do about this.

When I try to compile I get this message: dynamic module Failed to access web service. Maybe its not listening?

Clearly the webservice process died or was shutdown on my computer in the lab. If you ever get this message this is very likely the case–please email me lionetti@bioeng.ucsd.edu and I’ll restart the process. Alternatively you can set up your own compiler so you won’t be dependent upon the reliability of my computer.

Can you recompile a module? I get a strange warning if the module has already been compiled

If you are previously compiled the module it will recompile it for you. If someone else compiled the module, you’ll have to change it’s name.

This is something Dr. McCulloch and I discussed a lot while we were designing how this would work. The idea is that eventually we’ll have a single Continuity Daemon running on some shared resource. In this scenario you wouldn’t want a user to be able to overwrite someone else’s model. Instead you can save the model using “save as…” under a different name, and thus make it your own. Alternatively you can open the metadata.f file on the server (<continuity>/pcty/server/problem/Electrophysiology/<your_model>/metdata.f) and change the “Created by” line to your Continuity user name. This is the same name that you see on the splash screen while Continuity starts up.

Source code / svn

Is possible for to access the code and make changes?

What kind of changes do you think you’d be interested in making? The source code very complex and not generally useful for most users. However, most aspects which pertain to the model are encapsulated into various user authorable modules, which any user can reprogram to meet specific needs. You may wish to explore this help page: Continuity Model Editor and this tutorial: Electrophysiology Equation Editor Example To see how a user can create their own ionic model for an electrophysiology problem.

That being said we can sometimes make the source code available for academic collaborators; but generally this won’t be the best way to accomplish what you’d like.

How can I look at previous versions of files? Is there something on the Continuity website?

The source code is only available for collaborators. If you do have source code access, there are several ways to see previous versions of files:

  1. svn update -rYourRevisionNumber myfile.py
  2. https://summit.ucsd.edu/cmrg/browser (after logging in). You’ll need to ask Chris Misleh for a log in to use this.

    • After selecting a file click on “revision log” in the upper right.
  3. Using tortoise svn, right click on a file in question, and click “show log”. Then double click on a revision. This is probably the best way to do it.

Misc

Continuity won’t start on my Mac with Mac OS 10.5.3

  1. You May need to install a newer version of X11: http://xquartz.macosforge.org/trac/wiki/X112.2.2

My Continuity GPU processing suddenly stopped working after a Mac OS update

  1. You may need to update your CUDA drivers and toolkit: http://developer.nvidia.com/object/cuda_3_0_downloads.html#MacOS. Get the “Developer Drivers for MacOS”, “CUDA Toolkit”, and “GPU Computing SDK code samples and more”.

Isn’t there another FAQ?

There is also a very old FAQ available (deprecated).

How to search for information at this site using the search field?

For quick title search, enter the text and hit “return” key; for comprehensive text search, click the “Go” button.

What are some user requested bug fixes?

Q. there may be a bug when adding a field-dependent exception. We tried modifying the tension at slack sarcomere length (default value=125 kPa) as follows: “When FIELD 1 is between -100 and 0 use VALUE 45” when trying to run a step, we get an error message: “name error: Global name FieldsAtThisGaussPt not defined” When we remove the exception, it works. We are also sure that the error is not due to the fact that we are changing the VALUE from 125 to 45. We actually “changed” the VALUE from 125 to 125 (as silly as that sounds) and got the same error message.

A. Fixed in revision 2486


How to I enable contours from a script?

A. If you want to add contours to the last rendered object use the following commands:

name = self.om.root.children[-1].name
step = 1.0
self.om.GUIMapping[name].contoursSkipEF.setvalue(step)
self.om.GUIMapping[name].drawContoursVar.set(1)
self.om.GUIMapping[name].drawContoursToggle()

This will render contours with a step of “1.0” between each contour.

Q. the File->Save does not work under the Mesh->List->ElementPoints form. We’ve been able to use File->Save in other forms, so I’m guessing this might be a quick fix. Also, if we list points at Xi=0, we should basically get the nodal coordinates, fiber angle, and field val. When comparing these values to the Node form, they are very close, but not exact. Is that due to round-off error or a precision issue when interpolating those points? This is probably a minor issue– we just want to be sure that we’re interpreting this form correctly.

A. Fixed in 2414