Magnetostatic dipolar anisotropy energy and anisotropy constants in arrays of ferromagnetic nanowires as a function of their radius and interwall distance

Magnetostatic dipolar anisotropy energy and the total dipolar anisotropy constant, K total , in periodic arrays of ferromagnetic nanowires have been calculated as a function of the nanowire radius, the interwall distance of the nanowires in the arrays and the geometry of the array (square or hexagonal), by using a realistic atomistic model and the Ewald method. The simulated nanowires have a radius size up to 175 Å that corresponds to 31 500 atoms, and the simulated nanowire arrays have interwall distances between 35 and 3000 Å. The dependence of total magnetostatic dipolar anisotropy constant on the nanowire radius, their interwall distance and the type of array symmetry has been analyzed. The total dipolar anisotropy constant, which is the sum of the intrananowire dipolar anisotropy constant, K intra , due to the dipolar interactions inside an isolated nanowire and the main responsible of the shape anisotropy, and of the internanowire dipolar anisotropy constant, K inter , due to the magnetostatic dipolar interactions among nanowires in the array, have been calculated and compared with the magnetocrystalline anisotropy constant for three nanowire compositions and their crystalline structures. The simulations of the nanowire arrays with large interwall distances have been used to calculate the intrananowire anisotropy constant, K intra , and to analyze the competition between the intrananowire, internanowire and magnetocrystalline anisotropies. According to some magnetic theories, the ratio ∣ K inter / K intra ∣ equals to the areal filling fraction of a nanowire array. Present calculations indicate that the equation for the areal filling fraction matches perfectly for any interwall distance and radius of Ni and Co nanowire arrays. This first equation is used to write a general equation that relates the radius and interwall distance of nanowire arrays with the intrananowire, internanowire and magnetocrystalline anisotropies. This general equation allows to design the geometry of nanowire arrays with the desired orientation of the easy magnetization axis.


Introduction and motivation
In the last decades many research efforts have been focused on the synthesis and characterization of arrays of magnetic nanowires, due to the technological applications of these materials in diverse areas, such as: high density data storage [1], biosensors [2,3], MRAM devices [4,5], microwave electronics [6,7], magnetic field sensors [8], permanent magnets [9,10] and spin-torque nano-oscillators, STNO [11,12], among others. One of the most important properties of these nanoscaled materials is related to their magnetic anisotropy. There are four basic contributions to the magnetic anisotropy of nanowire arrays: the magnetocrystalline anisotropy, due to the simultaneous occurrence of the electron relativistic interaction and the spin-polarization, the intrananowire dipolar anisotropy, due to the dipolar interactions between the magnetic dipolar moments of the atoms of an isolated nanowire, the magnetoelastic anisotropy and the internanowire dipolar anisotropy, due to the dipolar interactions among the nanowires in the array. The intrananowire dipolar anisotropy is the main responsible of the shape anisotropy.
The magnetoelastic anisotropy is due to the coupling between the magnetization of the nanowire and the stress induced by the template and will create an easy magnetization axis parallel or perpendicular to the applied stress direction. Measurements of the magnetic properties of Co nanowire arrays in a wide range of temperatures, between 5 and 300 K, showed that the magnetoelastic anisotropy can be disregarded in these systems [13].
There is a strong competition between the magnetocrystalline, internanowire and intrananowire anisotropies in the arrays of magnetic nanowires. The first two anisotropies will induce an easy magnetization axis perpendicular to the nanowire axis, depending on the crystal phase and its growing direction, while the intrananowire anisotropy origins an easy magnetization axis parallel to the nanowire length. Some of the potential applications of nanowire arrays require to nullify or control the magnetostatic dipolar interactions on these materials and hence, the competition among the internanowire and the intrananowire anisotropies is an interesting research topic. The influence of long-range magnetostatic dipolar interactions among nanowires, the internanowire dipolar anisotropy, is one of the key factors in this competition to achieve a complete understanding of the magnetic behaviour of ferromagnetic nanowire arrays.
Experimental and theoretical facts address the importance of the mentioned competition between these three anisotropies and indicate that the competition is key to understand the magnetic properties developed by these nanostructured materials and to obtain the desired easy magnetization axis of the nanowires, which determine their magnetization reversal processes.
For instance, in some experiments [13], the analysis of the magnetic properties of Co nanowire arrays lead to the conclusion that their magnetic properties are dominated by the intrananowire anisotropy, due to the dipolar interactions inside an individual nanowire, more than by the magnetocrystalline anisotropy, the magnetoelastic anisotropy or the internanowire anisotropy, which is due to the dipolar interactions between nanowires. In another experiments it has been found that the magnetostatic interactions among nanowires modify partially the magnetic behaviour of the whole array [14].
The shape anisotropy energy becomes zero for isotropic systems of spherical shape, and negligibly small for slightly anisotropic systems, such as cobalt. However, the shape anisotropy energy of systems with a large anisotropy, such as layered materials and nanowires of ferromagnetic atoms, can not be disregarded because is comparable with or even larger than the magnetocrystalline anisotropy energy [15][16][17][18][19][20]. The elongated shape of nanowires enhances their shape anisotropy energy.
Magnetic modeling is a useful tool to understand the anisotropies competition, and the effects of the magnetostatic dipolar interactions, so as to learn about how to control the dipolar interactions in the nanowire arrays, but it is also a complicated task due to the long range character of the magnetostatic dipolar interaction and their dependence on the details of the nanowire arrays geometry, and therefore, some models are based on simplifications of real samples. Magnetic models of nanowire arrays falls into two main groups: micromagnetic and atomistic models [21]. Most of the magnetic modeling consists on numerical micromagnetics [22][23][24][25][26][27][28].
The basic idea of micromagnetics is that atomic magnetic moments can be approximated as a continuous vector field. Micromagnetics is useful to understand a broad range of magnetic effects, such as domain wall displacement and magnetization reversal in ferromagnetic nanostructures [29][30][31][32][33]. However, the micromagnetic calculations can not grasp the detailed atomic structure of the external walls of the nanowires, which is important to understand the magnetic properties of narrow nanowires, nanowire arrays with short interwall distances and multisegmented nanowire arrays. Micromagnetic calculations are computationally expensive and hence, calculations of arrays of nanowires are performed using a few nanowires. However, dipolar interactions among nanowires can not be reproduced correctly with a few nanowires.
Atomistic models of magnetic materials consider that each atom of the material has a local magnetic dipolar moment [21,34]. Some models of nanowire arrays [35][36][37] consider that each nanowire is a chain of magnetic nanoparticles with identical diameter and a magnetic moment parallel to each other and arranged in a square or hexagonal lattice. Nanowire arrays have been also modeled as square or hexagonal arrays of magnetic dipoles (where each individual nanowire can be considered as one magnetic macrodipole), disregarding the dipoles of the atoms that compose the nanowire [38][39][40][41][42][43].
Both, the chain and macrodipole models can be considered to calculate the dipolar interactions among nanowires if the dipolar approximation is valid, i.e. the distance between nanowires is much larger than the length of the nanowires (or nanoparticles), and the distribution of the magnetic dipoles inside the nanowire (or the nanoparticle) is uniform.
Instead of the chain and macrodipole models, a more realistic atomistic model that considers the local magnetic dipoles of each atom of the nanowires in the array and periodic cells has been used in the present work to simulate the collective magnetic behaviour of an infinite array of ferromagnetic nanowires. This model has been applied to study nanowire arrays with any value of radius and interwall, but also to study nanowire arrays with large radii and interwall distances, similar to the experimental values, which are relevant to study the dipolar interactions among nanowires.
Calculations of the total, intrananowire and internanowire anisotropy constants of periodic arrays of fcc-Ni, fcc-Co and hcp-Co nanowires as a function of the nanowire radius and the interwall distance (defined as the minimum distance between the walls of the nanowires in the periodic array) have been carried out in the present study by using the Ewald method in its usual form [44][45][46], to analyze the competition between intrananowire, internanowire and magnetocrystalline anisotropy.
The methodology is explained briefly in section 2, the periodic nanowire arrays are described in section 3 and the anisotropies are analyzed in section 4. The last section is devoted to explain how the calculations agree very well with the areal filling fraction equation [47] and how a general equation that relates the geometry of the nanowire arrays with the intrananowire, internanowire and magnetocrystalline anisotropies can be derived and used to design the geometry of nanowire arrays with a predetermined easy magnetization axis.
2. Methodology: calculation of the magnetostatic dipolar energy and the anisotropy constants 2.1. Magnetostatic dipolar energy of a lattice of magnetic moments The magnetostatic dipolar energy, MDE, of a lattice of magnetic moments is the summation of the magnetic dipolar interaction energies between the pairs of magnetic moments of the lattice. If all the magnetic moments of the cell are parallel to the direction  n , i.e. it is a ferromagnetic system, then the magnetostatic dipolar energy in atomic Rydberg units is given by: where the quantities ( )  M n pq are called the ferromagnetic dipolar Madelung constants and are given by  R n is the position of a lattice site: n a n b n c n a b c , where the index n stands for n=(n a , n b , n c ). The sum runs over all the lattice sites  R n , except over that for which the denominator in equation (2) is zero.
The Madelung constants have been computed by means of the traditional Ewald summation method [44][45][46]. An implementation of the traditional Ewald method that uses the symmetries of the periodic magnetic system to reduce substantially the computation time have been used in the present research. Details of this implementation and its application to any type of lattice, and especially to nanowire arrays, can be found elsewhere [48].

Magnetostatic dipolar anisotropy energy and anisotropy constants
The difference between the magnetostatic dipolar energies for two different magnetization directions is the magnetostatic dipolar anisotropy energy, MDAE. In the case of magnetizations  M parallel and perpendicular to the main axis of a nanowire,  c , the magnetostatic dipolar anisotropy energy is given by: M M is a unit vector along the magnetization,  c is a unit vector along the main axis of the nanowire and the magnetostatic dipolar energies E d are given by equation (1), using the corresponding unit vectors.
The MDAEs and MDEs are usually very small energies and therefore, these energies have been computed with a high precision of 10 −6 eV/cell. The convergence of the MDAEs and MDEs as a function of the real and reciprocal space cutoffs, r c and g c , respectively, was studied on a previous publication. It was found that the MDAE converges faster than the MDEs and that to obtain the mentioned precision of 10 −6 eV/cell for nanowire arrays, r c should be 38a and g c should be at least 9/a radian/Å, where a is the lattice parameter of bulk Ni or Co [48].
The anisotropy constant or density due to all the magnetostatic dipolar interactions in an array of nanowires is denoted by K total and is defined in this paper as: where V is the volume of the nanowire in the periodic cell, and parallel and perpendicular means parallel and perpendicular directions to the main axis of the nanowire, respectively. The physical meaning of the sign of K total , equation (4), is as follows: a negative value of K total means that the easy magnetization axis lies along the nanowire axis, while a positive value means that the easy magnetization axis is in the plane perpendicular to the nanowire axis.
The MDEs and MDAEs of arrays of nanowires calculated in the present research are the sum of two contributions: (a) The dipolar interactions inside the nanowire of the unit cell, a single nanowire, i.e. the intrananowire anisotropy, and (b) the dipolar interactions among the magnetic moments of the nanowire of the unit cell and the magnetic moments of the image or replicated cells (the lattice sites  R n in equation (2)), i.e. the magnetostatic dipolar interactions among nanowires or internanowire dipolar anisotropy. Therefore, the total dipolar anisotropy constant, K total , is given by the sum: where K intra and K inter are the intrananowire and the internanowire dipolar anisotropy constants, respectively. The third and last anisotropy is the magnetocrystalline anisotropy. The magnetocrystalline anisotropy constants, K cr , of fcc-Ni, fcc-Co and hcp-Co are 10 3 , 6.3 10 4 and 5 10 5 J m −3 , respectively. These values have been taken from references [13,[49][50][51][52].
To analyze the competition between the magnetocrystalline, the internanowire and the intrananowire dipolar anisotropies in arrays of magnetic nanowires, the sum of the corresponding three constants is considered: ), then the easy magnetization axis of these nanowire arrays is parallel to the nanowire axis. If then, the easy axis is perpendicular.

Description of the Ni and Co periodic nanowire arrays
The arrays of nanowires have been simulated by means of large periodic cells of magnetic dipoles. An array of fcc-Ni, hcp-Co or fcc-Co nanowires consists of a periodic cell that contains one nanowire of radius r, with an interwall distance i, the minimum distance between the external walls of the neighbour or replicated nanowires (See figure 1). A fcc-Ni (fcc-Co, hcp-Co) nanowire is a solid, not empty, cylindrical wire of radius r composed by Ni (Co) atoms with the structure of bulk fcc-Ni (fcc-Co, hcp-Co), where each atom has a magnetic moment. The arrays of nanowires have been simulated using two types of periodic cells: tetragonal (square array of nanowires) and hexagonal (hexagonal array of nanowires) (See figure 1). According to the experiments, Ni and Co nanowires are usually ordered in arrays with hexagonal symmetry. Some reported simulations were also carried out with square arrays of nanowires, i.e. with tetragonal periodic cells [35,36,53]. The tetragonal or square cell has vectors , h is the height of the nanowire in the cell and i is the above mentioned interwall distance. The hexagonal cell has vectors  a 1 =s  u x and  a 2 = s cos π/3  u x + s sin π/3  u y and  a 3 =  u h z . The height h of the periodic cell for all the arrays of nanowires was kept fixed and equal to h=c, where c is one of the lattice parameter of the corresponding bulk material. The values of the lattice parameters a used to create the nanowires are 3.52, 2.51 and 3.54 Å for fcc-Ni, hcp-Co and fcc-Co, respectively. The ratio c/a used for hcp-Co is 1.623 and 1 for the fcc-based nanowires. The values of the magnetic moments of Ni and Co atoms used in the present work are 0.60 and 1.65 μ B , respectively. The periodic cell (square and hexagonal) and the basis atoms are such that the nanowires are infinite along the main axis of the nanowire (the z axis, or longitudinal direction) and have finite dimensions in the plane perpendicular to the main axis (the xy plane): finite radius and interwall distance i. Arrays of nanowires with a radius between r=3.5 and 175 Å and with interwall distances i between 35 and 3000 Å were studied. The number of atoms (or magnetic dipoles) in the periodic cells used in the calculations ranges from 10 to 31 500.
The ranges of radius and interwall distances of the simulated nanowire arrays are inside the ranges of the synthesized nanowire arrays: experimentally synthesized ferromagnetic nanowire arrays with diameter in the range 100-2000 Å, interwall distance in the range between 300 and 10 000 Å, together with one micrometer long are typical and suitable for basic science research and technological applications [51,52,[54][55][56][57][58]. Nanowire arrays with narrow internanowire distances are useful for magnetic recording media. The current conventional magnetic recording technologies can not reach densities beyond 1Tbit in −2 [59,60]. The internanowire distance s should be below 250 Å to exceed that limit [47]. Throughout this paper the region with s below 250 Å is called the atomistic region, and s=250 Å is the recording limit.
As regards to experimental data concerning the geometry of the arrays of Ni and Co nanowires, it can be found that the synthesized arrays of nanowires show a wide variety of nanowire diameters and interwall distances. In table 1 the results of the main reports about synthesized arrays of Ni and Co nanowires have been gathered.
The present simulated arrays of fcc-Ni nanowires with a radius of 175 Å and an interwall distance of 985 Å can be compared with the experimental Ni nanowire arrays obtained by Vázquez et al [14] and Vivas et al [55] (See table 1). The simulated fcc-Co and hcp-Co nanowire arrays with a radius of 75 Å and an interwall distance of 985 Å can be compared with the Co nanowire arrays with a diameter of 150 Å reported by Li et al [51] (See table 1).

Dependence of the anisotropy constants of arrays of fcc-Ni, fcc-Co and hcp-Co nanowires on their geometric parameters
The magnetostatic dipolar energies of arrays of fcc-Ni, fcc-Co and hcp-Co nanowires have been calculated for different orientations of the atomic magnetic moments of the nanowires, in order to find the orientation with the lowest MDE. It turns out that the configuration with the magnetic moments parallel to the main axis of the nanowires is the most stable. Then, the magnetostatic dipolar anisotropy energy and the corresponding anisotropy constant were calculated as the difference between the MDEs of the parallel and perpendicular configuration of the atomic magnetic moments of the nanowires, i.e. using equations (3) and (4), respectively. These two magnetic properties depend on the type of array (square or hexagonal), the nanowire radius and the interwall distance. In the case of hcp-Co nanowire arrays, these properties also depend on the relative orientation of the underlying bulk c axis with respect to the main nanowire axis.

4.1.
Dependence of the anisotropy constants on the type of nanowires arrangement: square vs hexagonal arrays Arrays of Co and Ni nanowires usually grow in an hexagonal array of nanowires, but they can also sometimes grow in a square array. Total dipolar anisotropy constants of arrays of Ni and Co nanowire as a function of the Table 1. Experimental values in Å of the diameter D and internanowire distance s of hexagonal arrays of ferromagnetic nanowires. The interwall distance i is given by s=D+i (See figure 1).
The anisotropy constant of square and hexagonal arrays decreases as the interwall distance increases. At small interwall distances, the relative difference between the anisotropy constant of square and hexagonal arrays is about 50%. At large interwall distances, equal or larger than 1000 Å, the difference is almost null (See figures 2 and 3). The long range nature of the magnetic dipolar interactions implies that these interactions sense more the details of the geometry of the arrays and nanowires at small than at large interwall distances. Hence, the total dipolar anisotropy constant depends on the type of array at small interwall distances and hardly depends on it at large interwall distances.
The total dipolar anisotropy constants of Ni and Co nanowire arrays as a function of the type of array and the nanowire radius have been plotted in figures 4 and 5, for two fixed values of the interwall distance i: 35 and 985 Å.
Outside the atomistic region, at i=985 Å, the total dipolar anisotropy constants of square and hexagonal arrays are practically the same for any value of the nanowire radius, as can be expected (See figures 4 and 5).
The results are different and more complicated at small interwall distances, i=35 Å, inside and outside the atomistic region: for very narrow nanowires, i.e. with a radius below approximately 20 Å and hence, below the recording limit, the total dipolar anisotropy constants of square and hexagonal arrays are almost the same and the difference between them increases as the nanowire radius increases.  At i=35 Å, the very narrow nanowires are so thin that the magnetic dipolar interactions do not sense the different type of array. Wider nanowires at i=35 Å have a larger circumference and external surface and hence, the magnetic dipolar interactions sense much more the different type of nanowires arrangement.
The anisotropy constants in the atomistic region depend on the radius and the interwall distance. According to the present comparison, in the atomistic region and for radius larger than 20 Å there are some differences between the constants of the square and hexagonal arrays, while outside that region, the differences are practically null.

Anisotropy constants of hcp-Co nanowires arrays as a function of the relative orientation of the underlying bulk c axis
Experimental results show that Co nanowires can grow or be electrodeposited in the fcc-Co phase, in the hcp-Co phase with the underlying bulk c axis preferentially perpendicular to the nanowire axis or even in both phases, depending on the synthesis conditions [13,24,49,52,55,61]. In hcp-Co nanowires with the underlying bulk c axis perpendicular there is a strong competition between magnetocrystalline anisotropy and intrananowire (shape) anisotropy. These experimental facts indicate that it makes sense to study the anisotropy constants of fcc-Co and hcp-Co nanowire arrays with the underlying bulk c axis parallel and perpendicular.
In the former subsections the hcp-Co nanowires have been built with the underlying bulk c axis parallel to the main axis of the nanowire. In this subsection the hcp-Co nanowires have been also built with the underlying bulk c axis perpendicular and both types of arrays of hcp-Co nanowires are compared.
In the nanowires with the underlying bulk c axis perpendicular to the main axis of the nanowire, the basal planes of the underlying bulk hcp-Co are parallel to the main axis of the nanowire. In both types of arrays of hcp-  Co nanowires, the most stable magnetic configuration (the most negative magnetostatic dipolar energy) is related to the case when all the magnetic moments are aligned parallel to the main axis of the nanowire.
The total dipolar anisotropy constants of hcp-Co nanowire arrays with the underlying bulk c axis parallel and perpendicular to the nanowire axis are plotted in figure 6 as a function of the interwall distance i, for a fixed radius of 75 Å, equal to the radius of some synthesized nanowires [51]. The difference between the anisotropy constants is practically null for any value of the interwall distance.
The total dipolar anisotropy constants of hcp-Co nanowire arrays with the underlying bulk c axis parallel and perpendicular are plotted and compared in figure 7 as a function of the nanowire radius, for interwall distances of 35 and 985 Å. It can be noticed in figure 7 that inside and outside the atomistic region the anisotropy constants of the two types of hcp-Co nanowire arrays have practically the same value for any nanowire radius larger than 20 Å, while below 20 Å, there are some differences between the anisotropy constants. Hence, this result depends only on the nanowire radius and not on the internanowire distance s.

Dependence of the anisotropy constants on the interwall distance
The total dipolar anisotropy constant, for a fixed value of r, decreases exponentially as the interwall distance i increases, and then tends to a constant value, as can be seen in figures 2 and 3. The interwall distance i is the minimum distance between the nanowire walls (See figure 1). The rightmost point of upper panel of figure 2  corresponds to r=175 Å and i=3000 Å: Those are the values of an experimental fcc-Ni nanowire array, with an hexagonal arrangement, reported by Vázquez et al [55]. The rightmost points of lower panel of figure 2 and of both panels of figure 3 correspond to the experimental fcc-Co and hcp-Co nanowire arrays, with r=75 Å and i=3000 Å, reported by Li et al [51], respectively.
For any interwall distance, the total dipolar anisotropy constants of the fcc-Ni nanowire arrays with r=175 Å and of fcc-Co nanowire arrays with r=75 Å are below -K cr , as can be noticed in figure 2, for the magnetocrystalline anisotropy energy. Therefore, and hence, the easy magnetization axis of these nanowire arrays is parallel to the nanowire axis. According to the results plotted in figure 3 for hcp-Co nanowire arrays with a radius of 75 Å, < -K K total cr for i>200 Å. In figures 2 and 3 there are only a few points (the two leftmost points of the Co nanowires) in the atomistic region. It can be noticed that in that region there are important differences between the anisotropy constants of square and hexagonal arrays. Figures 8 and 9 contain the plots of the total dipolar anisotropy constant versus the nanowire radius, for several interwall distances, i. The dependence of K total on the radius of the four types of nanowire arrays is monotonous for wide nanowires, with r above ≈20 Å. For narrow nanowires, with a radius below 20 Å, the dependence is not monotonous: There are oscillations of the anisotropy constant as r increases. Above r≈20 Å and for small values of i, K total increases (less negative) as r increases and for large values of i, K total tends to a constant value as r increases.  The total dipolar anisotropy constant of Ni and fcc-Co nanowire arrays has an absolute minimum as a function of the nanowire radius, for a fixed value of i (See figure 8). The location of the minimum depends strongly on i. For small values of i, it is located in the mentioned region of narrow nanowires. As i increases, the minimum shifts towards higher values of the radius and tends to an infinite value.

Dependence of the anisotropy constants on the nanowire radius
The total dipolar anisotropy constant of hcp-Co nanowire arrays as a function of the nanowire radius has a local minimum, for a fixed value of i (See figure 9). For small values of i, it is also located in the region of narrow nanowires and it also shifts towards higher values as i increases and tends to an infinite value. The absolute minimum of the total dipolar anisotropy constant of hcp-Co nanowire arrays is located at very narrow nanowires and tends to a null radius.
An important feature is that the absolute value of K total of fcc-Ni is about 10 times smaller than the absolute value of K total of fcc-Co and hcp-Co. The fcc-Co and hcp-Co nanowires have values of K total of the same order of magnitude. Another important feature is that the total dipolar anisotropy constant of the four nanowire arrays is almost constant for interwall distances very large, i985 Å, and r20 Å.

Total dipolar anisotropy vs magnetocrystalline anisotropy
The dependence of the anisotropy constants of Ni and Co nanowire arrays on the interwall distance and nanowire radius has been analyzed separately so far. An analysis of the anisotropy constants considering both geometric parameters at the same time, reveals that the total dipolar anisotropy constant of fcc-Ni (Co) nanowire arrays is one (two) orders of magnitude below (more negative) than the magnetocrystalline anisotropy constant, -K cr , of fcc-Ni (Co), for any value of r and i (See figure 8). This means that the arrays of fcc-Ni and fcc-Co have the easy magnetization axis along the nanowire axis for any value of r and i. The value of -K cr is also plotted as a black solid line in the figures of the total dipolar anisotropy constant, to guide the eye and make easier the comparisons. The magnetocrystalline anisotropy constants, K cr , of fcc-Ni, fcc-Co and hcp-Co are 10 3 , 6.3 10 4 and 5 10 5 J m −3 , respectively. These values have been taken from references [13,[49][50][51][52].
In the case of hcp-Co nanowire arrays, -K cr and the total dipolar anisotropy constant, K total , are of the same order of magnitude and there is a strong competition between them. The total dipolar anisotropy constant is below -K cr for certain values of r and i (See figure 9). As the interwall distance increases, more values of the nanowire radius r fall in the region of the easy magnetization axis parallel to the nanowire axis, the region below the line of -K cr . For i=985 Å, < -K K total cr for any value of r, and therefore, all the arrays with that interwall distance, have the easy magnetization axis along the nanowire axis.
To obtain an easy magnetization axis lying perpendicularly to the nanowire axis, the hcp-Co nanowire array should have values of (r,i) such that > -K K total cr . For instance, according to figure 9 arrays of hcp-Co nanowires with i=140 Å and r55 Å have their easy magnetization axis perpendicular to the nanowire axis.

Intrananowire and internanowire dipolar anisotropy constants
Calculations for very large interwall distances (2000 and 3000 Å) have been also carried out for both, square and hexagonal arrays of fcc-Ni and hcp-Co nanowires to obtain and analyze the intrananowire dipolar anisotropy constant, K intra , which due to the dipolar interactions inside an isolated nanowire. As can be noticed in figure 8, the total dipolar anisotropy constant has practically the same value for i=2000 and 3000 Å, and for any fixed value of the radius, i.e. at very large interwall distances, K total depends only on the radius. Hence, for interwall distances equal or larger than 3000 Å the magnetostatic dipolar interaction obtained in the calculations can be considered to come only from the magnetic dipolar interactions among the magnetic moments of the atoms that compose a single isolated nanowire. The total dipolar anisotropy constant at those interwall distances is, therefore, due only to the internal dipolar interactions and practically equal to the intrananowire or shape anisotropy.
The magnetostatic dipolar interactions among the nanowires in the array depend on their radius and interwall distance. The comparison of the anisotropy constant obtained at different values of the interwall distances in figures 8 and 9, shows that the dipolar interactions among the nanowires of the array contribute with positive numerical values to K total and that the contribution decreases (is less positive) as the interwall distance increases. The internanowire dipolar anisotropy constant increases as the radius of the nanowire increases.
The intrananowire anisotropy constant comes from non-interacting or isolated nanowires. At i=3000 Å the dipolar interactions between nanowires are practically null as can be seen in figure 8) and hence, it is a reasonable approximation to consider that the intrananowire anisotropy constant is equal to the total dipolar anisotropy constant at i=3000 Å: . Using this approach and equation (5), the internanowire dipolar anisotropy constant, due to the magnetostatic dipolar interactions among the nanowires in the array, can be approximated by: where r is the nanowire radius and s is the internanowire distance, given by s=2r+i, with i being the interwall distance (See figure 1 for the geometric meaning of r, i and s). This equation of the areal filling fraction f (r, i) of an hexagonal array of nanowires is identical to the equation of the porosity P of self-ordered porous alumina with an hexagonal structure [62].
The ratio of the anisotropy constants, | | K K inter intra , obtained in the present Ewald calculations, versus the areal filling fraction is plotted in figures 11-13 for fcc-Ni and hcp-Co arrays of nanowires, and for square and hexagonal arrays. The solid black line in these plots is the linear relationship between the ratio of the anisotropy constants and the areal filling fraction, i.e. the solid black line is equation (8). The ratio of the anisotropy constants corresponding to nanowires with the underlying bulk c axis perpendicular are shifted 0.1 points upwards in figure 12, to avoid the overlap with the c axis parallel ratio. The total dipolar anisotropy constants K total are obtained from the Ewald calculations of the dipolar interactions in arrays of nanowires. The intrananowire and internanowire anisotropy constants are obtained from the Ewald calculations of K total and the equations explained in a former section.       of fcc-Ni nanowire square arrays as a function of the internanowire distance, for small and large interwall distances, and for all the range of nanowire radii studied. underlying bulk c axis parallel and perpendicular to the nanowires length are also very similar between them, except for the case of narrow nanowires having a radius below ≈20 Å.
The total dipolar anisotropy constants of fcc-Ni and fcc-Co nanowire arrays are much smaller (more negative) than -K cr , the magnetocrystalline anisotropy constant, for any value of the nanowire radius and interwall distance, which means that the easy magnetization axis of these nanowire arrays lies along the nanowire axis for any nanowire radius and interwall distance. The total dipolar anisotropy constant of hcp-Co nanowires is smaller than -K cr for large values of the interwall distance. The easy magnetization axis of those nanowire arrays is parallel to the nanowire axis. The total dipolar anisotropy constant of hcp-Co nanowires is also smaller than -K cr for short and intermediate values of the interwall distance and narrow nanowires.
The total dipolar anisotropy constants of nanowire arrays have practically the same value for interwall distances 2000 Å, i.e. the magnetostatic dipolar interactions among the nanowires (i.e. inter-nanowires interactions) whose interwall distance is 2000 Å are negligible and the only present dipolar interactions are those between the magnetic moments inside of an individual nanowire (i.e. intra-nanowire interactions). Therefore, ( ) K r intra can be approximated by ( Å ) = K r i , 3000 total . The intrananowire and internanowire dipolar anisotropy constants obtained in the present Ewald calculations of Ni and Co nanowire arrays satisfy very well the equation | | ( ) inter intra [47], where f (r, i) is the areal filling fraction of a nanowire array with a radius r and an interwall distance i. That equation is satisfied inside the atomistic region (internanowire distance s smaller than 250 Å) and also outside that region. The agreement seems to be optimal for internanowire distances in the range 200-500 Å, around the atomistic region. This agreement with the ratio-areal filling fraction equation allows to write a general equation of the anisotropy constants as a function of the radius and interwall distance of the nanowire arrays. This general equation is a useful tool to design the geometry (radius and interwall distance) of nanowire arrays with the easy magnetization axis lying along a predetermined direction.