Is most of the matter in the observable universe within galaxies? Do we know, either through observations or through theory driven computer simulations, the location of the majority of the visible matter in the observable universe?
That is, is it located within galaxies or outside of them, or do we know the ratio of mass distribution between these locations? 

Although deep space photos taken by say, the HST (as above), show almost uncountable numbers of galaxies, with apparently vast areas of empty space between them, when I see a picture of a computer simulation of filaments, and then also think of the possibly large numbers of dark dust clouds, I wonder how the matter is distributed and how we can trust our models.

Also, the inevitable corollary: Do we know if the distribution of dark matter follows that of visible matter?
I am aware that this may prove a much more difficult question to provide a definitive answer to.   
 A: This new paper addresses exactly this question, albeit with simulations.
Here's a partial breakdown of the distribution of matter in the Universe, summarized from the above paper:


*

*Dark matter makes up about 26% of the critical energy density budget of the Universe, while "baryonic matter" (which is jargon for "visible matter" and includes all baryons as well as leptons) accounts for about 4.8% of the critical value (measured from the cosmic microwave background (CMB)). Since we're fairly certain the Universe is flat (or near enough), the present critical density closely corresponds to the present total density.

*At high redshift (distances), the baryon density can be estimated from observations of neutral hydrogen absorption of quasar light by intervening gas clouds, called the Ly-$\alpha$ forest in the jargon. The density estimated in this way is in good agreement with the CMB value.

*At low redshift, estimates come up about 30% short of the CMB value; these baryons are "missing", but presumed to be in a diffuse warm-hot intergalactic medium (WHIM) that is difficult to detect.

*The paper presents the results of the Illustris simulation, finding that at present:


*

*49% of dark matter is in collapsed structures called haloes, the rest is in filaments and voids.

*23% of baryons are in haloes (which includes galaxies, and the "circumgalactic medium"). This is the number that closely corresponds to the amount of visible matter "in galaxies" that you asked about.

*The filaments contain a further 45% of the dark matter and 46% of the baryons, so there is very little dark matter, about 6%, in voids. There is a perhaps surprisingly large amount of baryons (31%) in voids, much of which has been ejected from haloes/filaments by "feedback", including AGB winds, SN explosions and AGN feedback. Feedback models are still an area of intense research, so this figure is perhaps a bit dubious.



I highly recommend having a look at the figures in the paper, they're all quite intuitive; many are pictures showing how various matter components are distributed. Others show the time evolution of distributions, and how the matter budget is split up between galactic systems of different sizes. I'll include one very nice figure from the paper here:

The left panel shows the dark matter distribution, similar to the purple millenium simulation graphic you showed in your question (though for a smaller region). The middle panel shows the distribution of baryonic matter, which roughly traces the dark matter. You can see lots of "bubbles" blown by feedback processes ejecting baryons from galaxies and into the voids. The right hand panel is a repeat of the same simulation, but with no star formation or feedback of any kind in the simulation (the baryons just gravitate and obey the hydrodynamical equations). In this case the baryons trace quite closely the DM distribution, but it's still not a 1:1 match, since baryons are subject to hydrodynamical forces and gravity, while DM only gravitates.
This is why baryons (and so also galaxies) are called "biased" tracers of the dark matter structure - there is obviously a strong correlation, but it's not a perfect 1:1 correlation. The study of the clustering of galaxies is rather technical, but I'll try to summarize briefly here. The measurable quantity we have to work with the the distribution of the separation distances between pairs of galaxies, called the two-point correlation function of galaxies $\xi_{gg}(r)$. This is then fit using a model for how galaxies are distributed in dark matter haloes: there is a contribution from two galaxies that reside in the same parent dark matter halo, and another contribution from pairs where each member is in a separate dark matter halo (the "one halo" and "two halo" terms). This can be related to the two-point correlation function of haloes $\xi(r)$. In the simplest case one assumes a "linear bias factor" $b_g$:
$$\xi_{gg}(r) = b_g^2\xi(r)$$
Of course this relation is much too simple (though it's a good approximation on large physical scales), so one adopts a more complicated form for the bias to try and do better - and this is still an area of active research. If you're interested in the technical details, there is a good short summary in Mo, van den Bosch and White (2010) section 15.6.
A: There are 4 general contributors to the mass density of our co-moving patch of what may be a larger universe:
(1)  Visible baryonic matter (including clouds of baryonic matter which may be visible only as shadows blocking galaxies).  NASA estimates 4.6% of all matter is baryonic (http://map.gsfc.nasa.gov/universe/uni_matter.html).
(2)  Dark matter (not visible, but gravitationally interacting with itself and with baryonic matter).  Dark matter is about 24% of the mass of the Universe, according to NASA.
(3)  Relativistic particles (photons and neutrinos).  These are a negligible part of the total current mass of the universe, but they provided a much larger contribution in the early stages of the Universe.
(4)  Dark energy - about 71.4% of the mass, according to NASA.
If our Universe (or at least our co-moving patch) is flat, all these contributions should sum to a density just sufficient to allow the Universe to stop its expansion after an infinite time without collapsing into itself.  This critical density may be considered a boundary which is less than a density which would cause the Universe to curve back into itself (closed universe), and more than a density which would allow the Universe to curve away from itself (open universe).
This critical density is sometimes represented as a ratio of 1.  Here is a link to an accounting of contributions to total density of the Universe:  http://hyperphysics.phy-astr.gsu.edu/hbase/astro/denpar.html.  You'll notice, however, that the linked page differs from NASA's estimate.  It claims 27% baryonic and dark matter, 73% dark energy; and its estimated split between baryonic and dark matter is not in synch with current consensus science, as Ross Millikan points out in his comment below.  Nevertheless, I've linked to this GSU page because its method of accounting expresses the critical density of the Universe as 1, and all the contributions as a fraction of 1.  The GSU estimate actually adds up to something slightly greater than 1, which is problematic as it would indicate a closed Universe.
The problem with a density that departs from the critical density is that inflation, the theory that explains the large scale homogeneity of our Universe, requires our Universe to be flat.
One estimate of critical density has it to be about 9.47 * 10^-27 Kg/m^3.  But we are aware only of our co-moving patch in what may be a larger Universe.  According to Wikipedia (https://en.wikipedia.org/wiki/Observable_universe) the volume of our co-moving patch is about 4 * 10^80 m^3.  That estimate should include volume that is not visible but which in theory could have existed before the Universe became transparent.  Density requires mass as well as volume, and this link is to an example of how one researcher estimated the mass of the Universe: http://www.scientificjournals.org/journals2009/articles/1437.pdf.
Fluctuations in the energy density of the early Universe may have become the large scale structure we now observe.  The tendency of galaxies to cluster and to follow filaments of dark matter, can provide clues to whether our Universe is closed, flat, or open.  Dark matter exerts gravitational attraction to visible matter, which appears in maps of galaxy clusters.  Here is a link to a map of one small part of the universe, showing how the visible structure of the universe clusters along filaments, which are thought to be dark matter: https://en.wikipedia.org/wiki/File:2dfdtfe.gif.  
Biasing of galaxy clusters along what may be a substructure of dark matter could provide evidence of how mass-energy fluctuated in the very early stages of our Universe, and how it acted during inflation.  Here's a description of how to quantify biasing of galaxies and clusters as non-local phenomena, and includes a way to measure it without having to assume a pre-determined structure of dark matter: http://ned.ipac.caltech.edu/level5/March12/Coil/Coil5.html.  If you navigate through the entire website, you may find it an excellent introduction to the large scale structure of the Universe, and an answer to your question of how researchers determine where visible and non-visible baryonic matter lies, and its relationship to the location of dark matter.  
The dynamic process of how baryons may have precipitated from denser matter into their present configuration may be accounted for by "friction" with dark matter.  Here's a link to a paper that explores this: http://arxiv.org/pdf/astro-ph/9410093.pdf.
This link is to an account of the most recent mapping of dark matter: http://www.sciencedaily.com/releases/2015/07/150702112045.htm.  Here's a link to a summary of how evidence for dark matter is collected: http://www.astro.cornell.edu/academics/courses/astro201/dm_evidence.htm
In sum, yes, it is believed that visible matter and dark matter cluster together in filaments.
